From d578c9d28d73ad14c1ba5b95f3a58d725e26c688 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 11 Nov 2026 18:56:06 +0000 Subject: [PATCH 1/3] Configurations: 'specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/CognitiveServices/tspconfig.yaml', and CommitSHA: 'bb09e375334d3e064aa5bc06d83a0568ffca0b4c' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=7065615 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../azure-mgmt-cognitiveservices/CHANGELOG.md | 239 + .../_metadata.json | 10 +- .../azure-mgmt-cognitiveservices/api.md | 4824 +--- .../api.metadata.yml | 6 +- .../apiview-properties.json | 196 +- .../azure/mgmt/cognitiveservices/_client.py | 60 +- .../mgmt/cognitiveservices/_configuration.py | 9 +- .../mgmt/cognitiveservices/_utils/utils.py | 34 +- .../azure/mgmt/cognitiveservices/_version.py | 2 +- .../mgmt/cognitiveservices/aio/_client.py | 60 +- .../cognitiveservices/aio/_configuration.py | 9 +- .../aio/operations/__init__.py | 20 - .../aio/operations/_operations.py | 14013 ++------- .../aio/operations/_patch.py | 219 +- .../mgmt/cognitiveservices/models/__init__.py | 208 +- .../mgmt/cognitiveservices/models/_enums.py | 339 +- .../mgmt/cognitiveservices/models/_models.py | 9955 ++----- .../cognitiveservices/operations/__init__.py | 20 - .../operations/_operations.py | 24096 +++++----------- .../cognitiveservices/operations/_patch.py | 267 +- .../azure/mgmt/cognitiveservices/types.py | 2131 +- .../add_rai_blocklist_items.py | 2 +- .../calculate_model_capacity.py | 2 +- .../check_domain_availability.py | 2 +- .../check_sku_availability.py | 2 +- .../generated_samples/create.py | 2 +- .../generated_samples/create_account.py | 7 +- .../generated_samples/create_account_min.py | 2 +- ...ccount_with_agent_hosting_configuration.py | 15 +- ...count_with_trusted_certificate_sources.py} | 39 +- .../generated_samples/create_or_update.py | 2 +- .../create_or_update_adapter_deployment.py | 49 - .../create_or_update_arc_deployment.py | 56 - ..._or_update_arc_deployment_with_template.py | 57 - ...te_or_update_managed_compute_deployment.py | 56 - .../create_or_update_managed_network_v2.py | 2 +- .../create_or_update_quota_tier.py | 2 +- .../create_or_update_rule_v2.py | 2 +- ...or_update_vm_managed_compute_deployment.py | 56 - .../generated_samples/create_project.py | 12 +- .../generated_samples/create_project_min.py | 2 +- .../create_shared_commitment_plan.py | 2 +- ...eate_shared_commitment_plan_association.py | 2 +- .../generated_samples/delete.py | 2 +- .../generated_samples/delete_account.py | 2 +- .../delete_adapter_deployment.py | 42 - .../delete_arc_deployment.py | 42 - .../delete_commitment_plan.py | 2 +- .../generated_samples/delete_compute.py | 42 - .../generated_samples/delete_deployment.py | 2 +- .../delete_encryption_scope.py | 2 +- .../delete_managed_compute_deployment.py | 42 - .../delete_managed_network_v2.py | 2 +- .../delete_private_endpoint_connection.py | 2 +- .../generated_samples/delete_project.py | 2 +- .../generated_samples/delete_rai_binding.py | 42 - .../generated_samples/delete_rai_blocklist.py | 2 +- .../delete_rai_blocklist_item.py | 2 +- .../delete_rai_blocklist_items.py | 2 +- .../delete_rai_external_safety_provider.py | 2 +- .../generated_samples/delete_rai_policy.py | 2 +- .../delete_rai_policy_acs.py | 2 +- .../generated_samples/delete_rai_rego.py | 42 - .../delete_rai_tool_label.py | 2 +- .../generated_samples/delete_rai_topic.py | 2 +- .../generated_samples/delete_rule_v2.py | 2 +- .../delete_shared_commitment_plan.py | 2 +- ...lete_shared_commitment_plan_association.py | 2 +- .../delete_subscription_rai_policy.py | 2 +- .../generated_samples/delete_workbench.py | 43 - .../generated_samples/disable.py | 2 +- .../generated_samples/enable.py | 2 +- .../evaluate_deployment_policies.py | 57 - .../generated_samples/get.py | 2 +- .../generated_samples/get_account.py | 2 +- ...count_with_trusted_certificate_sources.py} | 9 +- .../get_adapter_deployment.py | 43 - .../generated_samples/get_arc_deployment.py | 43 - .../generated_samples/get_commitment_plan.py | 2 +- .../get_compute_operation_status.py | 42 - .../get_container_instance_compute.py | 43 - .../get_defender_for_ai_setting.py | 2 +- .../generated_samples/get_deleted_account.py | 2 +- .../generated_samples/get_deployment.py | 2 +- .../generated_samples/get_encryption_scope.py | 2 +- .../generated_samples/get_legacy.py | 43 - .../get_managed_compute_deployment.py | 43 - .../get_managed_network_v2.py | 2 +- ...twork_security_perimeter_configurations.py | 2 +- .../generated_samples/get_operations.py | 2 +- .../get_private_endpoint_connection.py | 2 +- .../generated_samples/get_project.py | 2 +- .../generated_samples/get_quota_tier.py | 2 +- .../generated_samples/get_rai_binding.py | 43 - .../generated_samples/get_rai_blocklist.py | 2 +- .../get_rai_blocklist_item.py | 2 +- .../get_rai_content_filter.py | 2 +- .../get_rai_external_safety_provider.py | 2 +- .../generated_samples/get_rai_policy.py | 2 +- .../generated_samples/get_rai_policy_acs.py | 2 +- .../generated_samples/get_rai_rego.py | 43 - .../generated_samples/get_rai_tool_label.py | 2 +- .../generated_samples/get_rai_topic.py | 2 +- .../generated_samples/get_rule_v2.py | 2 +- .../get_shared_commitment_plan.py | 2 +- .../get_shared_commitment_plan_association.py | 2 +- .../generated_samples/get_skus.py | 2 +- .../get_subscription_rai_policy.py | 2 +- .../generated_samples/get_usages.py | 2 +- .../get_usages_classic_scope.py | 2 +- .../get_usages_data_zone_scope.py | 2 +- .../get_usages_global_scope.py | 2 +- .../get_vm_managed_compute_deployment.py | 43 - .../generated_samples/list.py | 2 +- .../generated_samples/list_account_models.py | 2 +- .../list_accounts_by_resource_group.py | 2 +- .../list_accounts_by_subscription.py | 2 +- .../list_adapter_deployments.py | 43 - .../generated_samples/list_agents.py | 2 +- .../generated_samples/list_blocklist_items.py | 2 +- .../generated_samples/list_blocklists.py | 2 +- .../list_commitment_plans.py | 2 +- .../list_commitment_tiers.py | 2 +- .../generated_samples/list_computes.py | 43 - .../list_defender_for_ai_setting.py | 2 +- .../list_deleted_accounts_by_subscription.py | 2 +- .../generated_samples/list_deployment_skus.py | 2 +- .../generated_samples/list_deployments.py | 2 +- .../list_encryption_scopes.py | 2 +- .../generated_samples/list_keys.py | 2 +- .../list_location_based_model_capacities.py | 2 +- ...on_based_model_capacities_classic_scope.py | 2 +- ..._based_model_capacities_data_zone_scope.py | 2 +- ...ion_based_model_capacities_global_scope.py | 2 +- .../generated_samples/list_location_models.py | 2 +- .../list_managed_compute_capacities.py | 2 +- ...ged_compute_capacities_with_deployment.py} | 9 +- ...naged_compute_capacities_with_location.py} | 9 +- ...e_capacities_with_unsupported_location.py} | 9 +- .../list_managed_compute_deployments.py | 43 - .../list_managed_compute_usages.py | 42 - .../list_managed_network_v2.py | 2 +- .../list_model_capacities.py | 2 +- .../list_model_capacities_classic_scope.py | 2 +- .../list_model_capacities_data_zone_scope.py | 2 +- .../list_model_capacities_global_scope.py | 2 +- ...twork_security_perimeter_configurations.py | 2 +- .../list_private_endpoint_connections.py | 2 +- .../list_private_link_resources.py | 2 +- .../generated_samples/list_projects.py | 2 +- .../generated_samples/list_quota_tiers.py | 2 +- .../list_rai_content_filters.py | 2 +- .../list_rai_external_safety_providers.py | 2 +- .../generated_samples/list_rai_policies.py | 2 +- .../generated_samples/list_rai_tool_labels.py | 2 +- .../generated_samples/list_rai_topics.py | 2 +- .../generated_samples/list_rule_v2.py | 2 +- ...ist_shared_commitment_plan_associations.py | 2 +- ...ared_commitment_plans_by_resource_group.py | 2 +- ...shared_commitment_plans_by_subscription.py | 2 +- .../generated_samples/list_skus.py | 2 +- .../generated_samples/list_usages.py | 2 +- .../list_usages_classic_scope.py | 2 +- .../list_usages_data_zone_scope.py | 2 +- .../list_usages_global_scope.py | 2 +- .../list_usages_with_resource_metadata.py | 2 +- .../list_vm_managed_compute_deployments.py | 43 - .../generated_samples/list_workbenches.py | 44 - .../patch_managed_network_v2.py | 2 +- .../generated_samples/pause_deployment.py | 2 +- .../post_outbound_rules_v2.py | 2 +- .../provision_managed_network.py | 2 +- .../purge_deleted_account.py | 2 +- .../generated_samples/put_commitment_plan.py | 2 +- .../generated_samples/put_compute.py | 53 - .../put_defender_for_ai_setting.py | 2 +- .../generated_samples/put_deployment.py | 2 +- ...ut_deployment_with_speculative_decoding.py | 12 +- .../generated_samples/put_encryption_scope.py | 2 +- .../put_private_endpoint_connection.py | 2 +- .../generated_samples/put_rai_binding.py | 50 - .../generated_samples/put_rai_blocklist.py | 2 +- .../put_rai_blocklist_item.py | 2 +- .../put_rai_external_safety_provider.py | 2 +- .../generated_samples/put_rai_policy.py | 2 +- .../generated_samples/put_rai_policy_acs.py | 65 +- .../put_rai_policy_acs_without_tools.py | 20 +- .../put_rai_policy_with_egress.py | 2 +- .../generated_samples/put_rai_rego.py | 51 - .../generated_samples/put_rai_tool_label.py | 2 +- .../generated_samples/put_rai_topic.py | 2 +- .../put_subscription_rai_policy.py | 2 +- .../generated_samples/put_workbench.py | 62 - ...twork_security_perimeter_configurations.py | 2 +- .../generated_samples/regenerate_key.py | 2 +- .../restart_container_instance_compute.py | 42 - .../generated_samples/restart_workbench.py | 43 - .../generated_samples/resume_deployment.py | 2 +- .../generated_samples/start.py | 2 +- .../start_container_instance_compute.py | 42 - .../generated_samples/start_workbench.py | 43 - .../generated_samples/stop.py | 2 +- .../stop_container_instance_compute.py | 42 - .../generated_samples/stop_workbench.py | 43 - .../test_rai_external_safety_provider.py | 2 +- .../generated_samples/update.py | 2 +- .../generated_samples/update_account.py | 14 +- ...ount_clear_trusted_certificate_sources.py} | 13 +- ...t_preserve_trusted_certificate_sources.py} | 14 +- ...unt_rotate_trusted_certificate_sources.py} | 24 +- .../update_arc_deployment.py | 50 - .../update_defender_for_ai_setting.py | 2 +- .../generated_samples/update_deployment.py | 2 +- .../update_managed_compute_deployment.py | 44 - .../generated_samples/update_metadata.py | 44 - .../generated_samples/update_projects.py | 2 +- .../generated_samples/update_quota_tier.py | 2 +- .../generated_samples/update_rai_binding.py | 50 - .../update_rai_policy_acs.py | 62 +- .../generated_samples/update_rai_rego.py | 50 - .../update_shared_commitment_plan.py | 2 +- .../update_vm_managed_compute_deployment.py | 44 - .../update_workbench_compute_properties.py | 59 - ...date_workbench_reset_compute_properties.py | 45 - ...services_management_accounts_operations.py | 77 +- ...es_management_accounts_operations_async.py | 77 +- ...nagement_adapter_deployments_operations.py | 93 - ...nt_adapter_deployments_operations_async.py | 98 - ...s_management_arc_deployments_operations.py | 128 - ...gement_arc_deployments_operations_async.py | 135 - ...anagement_compute_operations_operations.py | 30 - ...ent_compute_operations_operations_async.py | 31 - ...services_management_computes_operations.py | 124 - ...es_management_computes_operations_async.py | 135 - ...ces_management_cost_controls_operations.py | 134 - ...nagement_cost_controls_operations_async.py | 135 - ...vices_management_deployments_operations.py | 26 - ...management_deployments_operations_async.py | 26 - ..._managed_compute_deployments_operations.py | 109 - ...ed_compute_deployments_operations_async.py | 120 - ...mpute_usages_operation_group_operations.py | 29 - ...usages_operation_group_operations_async.py | 30 - ...services_management_projects_operations.py | 2 - ...es_management_projects_operations_async.py | 2 - ...ices_management_rai_bindings_operations.py | 82 - ...anagement_rai_bindings_operations_async.py | 83 - ...ices_management_rai_policies_operations.py | 81 - ...anagement_rai_policies_operations_async.py | 81 - ...ervices_management_rai_regos_operations.py | 82 - ...s_management_rai_regos_operations_async.py | 83 - ...ment_subscription_rai_policy_operations.py | 81 - ...ubscription_rai_policy_operations_async.py | 81 - ...vices_management_workbenches_operations.py | 179 - ...management_workbenches_operations_async.py | 190 - .../pyproject.toml | 5 +- .../tests/test_cost_controls_live.py | 5 +- .../tests/test_cost_controls_operations.py | 1 - .../test_cost_controls_operations_async.py | 1 - .../tsp-location.yaml | 2 +- 259 files changed, 14935 insertions(+), 47102 deletions(-) rename sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/{put_container_instance_compute.py => create_account_with_trusted_certificate_sources.py} (55%) delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_adapter_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_arc_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_arc_deployment_with_template.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_managed_compute_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_vm_managed_compute_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_adapter_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_arc_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_compute.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_managed_compute_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_binding.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_rego.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_workbench.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/evaluate_deployment_policies.py rename sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/{get_compute.py => get_account_with_trusted_certificate_sources.py} (85%) delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_adapter_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_arc_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_compute_operation_status.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_container_instance_compute.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_legacy.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_managed_compute_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_binding.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_rego.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_vm_managed_compute_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_adapter_deployments.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_computes.py rename sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/{list_rai_bindings.py => list_managed_compute_capacities_with_deployment.py} (85%) rename sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/{list_rai_regos.py => list_managed_compute_capacities_with_location.py} (85%) rename sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/{list_arc_deployments.py => list_managed_compute_capacities_with_unsupported_location.py} (84%) delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_deployments.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_usages.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_vm_managed_compute_deployments.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_workbenches.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_compute.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_binding.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_rego.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_workbench.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/restart_container_instance_compute.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/restart_workbench.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start_container_instance_compute.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start_workbench.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop_container_instance_compute.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop_workbench.py rename sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/{get_workbench.py => update_account_clear_trusted_certificate_sources.py} (80%) rename sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/{update_workbench.py => update_account_preserve_trusted_certificate_sources.py} (78%) rename sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/{put_workbench_pending.py => update_account_rotate_trusted_certificate_sources.py} (61%) delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_arc_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_managed_compute_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_metadata.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_binding.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_rego.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_vm_managed_compute_deployment.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench_compute_properties.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench_reset_compute_properties.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_adapter_deployments_operations.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_adapter_deployments_operations_async.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_arc_deployments_operations.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_arc_deployments_operations_async.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_compute_operations_operations.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_compute_operations_operations_async.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_computes_operations.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_computes_operations_async.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_cost_controls_operations.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_cost_controls_operations_async.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_deployments_operations.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_deployments_operations_async.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_usages_operation_group_operations.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_usages_operation_group_operations_async.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_bindings_operations.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_bindings_operations_async.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_regos_operations.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_regos_operations_async.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_workbenches_operations.py delete mode 100644 sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_workbenches_operations_async.py diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md index 92d72ef25b42..c4124715cf75 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md @@ -1,5 +1,244 @@ # Release History +## 15.0.0 (2026-11-11) + +### Features Added + + - Client `CognitiveServicesManagementClient` added parameter `content_type` in method `calculate_model_capacity` + - Client `CognitiveServicesManagementClient` added parameter `content_type` in method `check_domain_availability` + - Client `CognitiveServicesManagementClient` added parameter `content_type` in method `check_sku_availability` + - Client `CognitiveServicesManagementClient` added method `send_request` + - Client `CognitiveServicesManagementClient` added operation group `agent_applications` + - Client `CognitiveServicesManagementClient` added operation group `agent_deployments` + - Client `CognitiveServicesManagementClient` added operation group `managed_compute_capacities` + - Client `CognitiveServicesManagementClient` added operation group `managed_network_provisions` + - Client `CognitiveServicesManagementClient` added operation group `managed_network_settings` + - Client `CognitiveServicesManagementClient` added operation group `outbound_rule` + - Client `CognitiveServicesManagementClient` added operation group `outbound_rules` + - Client `CognitiveServicesManagementClient` added operation group `rai_external_safety_provider` + - Client `CognitiveServicesManagementClient` added operation group `rai_external_safety_providers` + - Client `CognitiveServicesManagementClient` added operation group `rai_tool_labels` + - Client `CognitiveServicesManagementClient` added operation group `subscription_rai_policy` + - Client `CognitiveServicesManagementClient` added operation group `test_rai_external_safety_provider` + - Model `AccountProperties` added property `a365_logging_enabled` + - Model `AccountProperties` added property `trusted_certificate_sources` + - Model `CapabilityHostProperties` added property `enable_public_hosting_environment` + - Model `CommitmentPlanAccountAssociation` added property `properties` + - Enum `ConnectionAuthType` added member `ACCOUNT_MANAGED_IDENTITY` + - Enum `ConnectionAuthType` added member `AGENTIC_IDENTITY_TOKEN` + - Enum `ConnectionAuthType` added member `AGENTIC_USER` + - Enum `ConnectionAuthType` added member `AGENT_USER_IMPERSONATION` + - Enum `ConnectionAuthType` added member `DELEGATED_SAS` + - Enum `ConnectionAuthType` added member `PROJECT_MANAGED_IDENTITY` + - Enum `ConnectionAuthType` added member `USER_ENTRA_TOKEN` + - Enum `ConnectionCategory` added member `API_MANAGEMENT` + - Enum `ConnectionCategory` added member `APP_CONFIG` + - Enum `ConnectionCategory` added member `APP_INSIGHTS` + - Enum `ConnectionCategory` added member `AZURE_CONTAINER_APP_ENVIRONMENT` + - Enum `ConnectionCategory` added member `AZURE_KEY_VAULT` + - Enum `ConnectionCategory` added member `DATABRICKS` + - Enum `ConnectionCategory` added member `GROUNDING_WITH_BING_SEARCH` + - Enum `ConnectionCategory` added member `GROUNDING_WITH_CUSTOM_SEARCH` + - Enum `ConnectionCategory` added member `MICROSOFT_FABRIC` + - Enum `ConnectionCategory` added member `MODEL_GATEWAY` + - Enum `ConnectionCategory` added member `POWER_PLATFORM_ENVIRONMENT` + - Enum `ConnectionCategory` added member `REMOTE_A2_A` + - Enum `ConnectionCategory` added member `REMOTE_TOOL` + - Enum `ConnectionCategory` added member `SHAREPOINT` + - Model `DefenderForAISetting` added property `properties` + - Model `DeploymentProperties` added property `context_cache_container_id` + - Model `DeploymentProperties` added property `deployment_state` + - Model `DeploymentProperties` added property `routing` + - Model `DeploymentProperties` added property `service_tier` + - Model `ModelSkuCapacityProperties` added property `scope_id` + - Model `ModelSkuCapacityProperties` added property `scope_type` + - Model `RaiPolicyContentFilter` added property `action` + - Enum `RaiPolicyContentSource` added member `POST_RUN` + - Enum `RaiPolicyContentSource` added member `POST_TOOL_CALL` + - Enum `RaiPolicyContentSource` added member `PRE_RUN` + - Enum `RaiPolicyContentSource` added member `PRE_TOOL_CALL` + - Model `RaiPolicyProperties` added property `egress_policy` + - Model `RaiPolicyProperties` added property `safety_providers` + - Model `ResourceSkuRestrictions` added property `values_property` + - Model `Usage` added property `id` + - Model `Usage` added property `scope_id` + - Model `Usage` added property `scope_type` + - Model `Usage` added property `type` + - Added model `AgentApplication` + - Added model `AgentDeployment` + - Added model `AgentDeploymentProperties` + - Added enum `AgentDeploymentProvisioningState` + - Added enum `AgentDeploymentState` + - Added enum `AgentDeploymentType` + - Added enum `AgentProtocol` + - Added model `AgentProtocolVersion` + - Added model `AgentReference` + - Added model `AgentReferenceProperties` + - Added model `AgentReferenceResourceArmPaginatedResult` + - Added model `AgenticApplicationProperties` + - Added enum `AgenticApplicationProvisioningState` + - Added model `ApplicationAuthorizationPolicy` + - Added model `ApplicationTrafficRoutingPolicy` + - Added model `AssignedIdentity` + - Added enum `BuiltInAuthorizationScheme` + - Added model `CertificateBundleReference` + - Added model `ChannelsBuiltInAuthorizationPolicy` + - Added model `CommitmentPlanAccountAssociationProperties` + - Added model `DefenderForAISettingProperties` + - Added model `DeploymentRouting` + - Added model `DeploymentSizeCapacity` + - Added enum `DeploymentState` + - Added enum `FirewallSku` + - Added model `FqdnOutboundRule` + - Added model `HostedAgentDeployment` + - Added enum `IdentityKind` + - Added enum `IdentityManagementType` + - Added enum `IdentityProvisioningState` + - Added enum `IsolationMode` + - Added model `ManagedAgentDeployment` + - Added model `ManagedComputeCapacity` + - Added model `ManagedComputeCapacityProperties` + - Added enum `ManagedNetworkKind` + - Added model `ManagedNetworkProvisionOptions` + - Added model `ManagedNetworkProvisionStatus` + - Added enum `ManagedNetworkProvisioningState` + - Added model `ManagedNetworkSettings` + - Added model `ManagedNetworkSettingsBasicResource` + - Added model `ManagedNetworkSettingsEx` + - Added model `ManagedNetworkSettingsProperties` + - Added model `ManagedNetworkSettingsPropertiesBasicResource` + - Added enum `ManagedNetworkStatus` + - Added model `OrganizationSharedBuiltInAuthorizationPolicy` + - Added model `OutboundRule` + - Added model `OutboundRuleBasicResource` + - Added model `PrivateEndpointOutboundRule` + - Added model `PrivateEndpointOutboundRuleDestination` + - Added model `ProjectCapabilityHost` + - Added model `ProjectCapabilityHostProperties` + - Added enum `QuotaScopeType` + - Added enum `RaiActionType` + - Added enum `RaiEgressDefaultAction` + - Added enum `RaiEgressHeaderOperation` + - Added model `RaiEgressHeaderTransform` + - Added model `RaiEgressHeaderValueRef` + - Added model `RaiEgressManagedIdentityRef` + - Added enum `RaiEgressMode` + - Added model `RaiEgressPolicyConfig` + - Added model `RaiEgressRewriteTarget` + - Added model `RaiEgressRule` + - Added model `RaiEgressRuleAction` + - Added enum `RaiEgressRuleActionType` + - Added model `RaiEgressRuleMatch` + - Added enum `RaiEgressRuleType` + - Added enum `RaiEgressScheme` + - Added model `RaiEgressSecretRef` + - Added model `RaiExternalSafetyProviderSchema` + - Added model `RaiExternalSafetyProviderSchemaProperties` + - Added model `RaiSafetyProviderConfig` + - Added model `RaiToolLabel` + - Added model `RaiToolLabelProperties` + - Added model `RaiToolLabelPropertiesAccountScope` + - Added model `RaiToolLabelPropertiesProjectScopesItem` + - Added model `RoleBasedBuiltInAuthorizationPolicy` + - Added enum `RoutingMode` + - Added enum `RuleAction` + - Added enum `RuleCategory` + - Added enum `RuleStatus` + - Added enum `RuleType` + - Added model `SafetyProviderConfig` + - Added model `ServiceTagOutboundRule` + - Added model `ServiceTagOutboundRuleDestination` + - Added enum `ServiceTier` + - Added enum `TrafficRoutingProtocol` + - Added model `TrafficRoutingRule` + - Added model `TrustedCertificateSource` + - Added enum `TrustedCertificateSourceType` + - Added model `VersionedAgentReference` + - Model `AccountCapabilityHostsOperations` added method `list` + - Model `AccountsOperations` added parameter `content_type` in method `regenerate_key` + - Model `DeploymentsOperations` added method `pause` + - Model `DeploymentsOperations` added method `resume` + - Model `ProjectCapabilityHostsOperations` added method `list` + - Model `RaiBlocklistItemsOperations` added parameter `content_type` in method `batch_delete` + - Added operation group `AgentApplicationsOperations` + - Added operation group `AgentDeploymentsOperations` + - Added operation group `ManagedComputeCapacitiesOperations` + - Added operation group `ManagedNetworkProvisionsOperations` + - Added operation group `ManagedNetworkSettingsOperations` + - Added operation group `OutboundRuleOperations` + - Added operation group `OutboundRulesOperations` + - Added operation group `RaiExternalSafetyProviderOperations` + - Added operation group `RaiExternalSafetyProvidersOperations` + - Added operation group `RaiToolLabelsOperations` + - Added operation group `SubscriptionRaiPolicyOperations` + - Added operation group `TestRaiExternalSafetyProviderOperations` + +### Breaking Changes + + - Method `CognitiveServicesManagementClient.calculate_model_capacity` inserted a `positional_or_keyword` parameter `parameters` + - Method `CognitiveServicesManagementClient.calculate_model_capacity` deleted or renamed its parameter `model` of kind `positional_or_keyword` + - Method `CognitiveServicesManagementClient.calculate_model_capacity` deleted or renamed its parameter `sku_name` of kind `positional_or_keyword` + - Method `CognitiveServicesManagementClient.calculate_model_capacity` deleted or renamed its parameter `workloads` of kind `positional_or_keyword` + - Method `CognitiveServicesManagementClient.check_domain_availability` inserted a `positional_or_keyword` parameter `parameters` + - Method `CognitiveServicesManagementClient.check_domain_availability` deleted or renamed its parameter `kind` of kind `positional_or_keyword` + - Method `CognitiveServicesManagementClient.check_domain_availability` deleted or renamed its parameter `subdomain_name` of kind `positional_or_keyword` + - Method `CognitiveServicesManagementClient.check_domain_availability` deleted or renamed its parameter `type` of kind `positional_or_keyword` + - Method `CognitiveServicesManagementClient.check_sku_availability` inserted a `positional_or_keyword` parameter `parameters` + - Method `CognitiveServicesManagementClient.check_sku_availability` deleted or renamed its parameter `kind` of kind `positional_or_keyword` + - Method `CognitiveServicesManagementClient.check_sku_availability` deleted or renamed its parameter `skus` of kind `positional_or_keyword` + - Method `CognitiveServicesManagementClient.check_sku_availability` deleted or renamed its parameter `type` of kind `positional_or_keyword` + - Model `CommitmentPlanAccountAssociation` deleted or renamed its instance variable `account_id` + - Model `CustomKeys` deleted or renamed its instance variable `keys` + - Model `DefenderForAISetting` deleted or renamed its instance variable `state` + - Model `RaiPolicyProperties` deleted or renamed its instance variable `custom_topics` + - Model `ResourceSkuRestrictions` deleted or renamed its instance variable `values` + - Deleted or renamed model `AccountListResult` + - Deleted or renamed model `AccountModelListResult` + - Deleted or renamed model `AzureEntityResource` + - Deleted or renamed model `CommitmentPlanAccountAssociationListResult` + - Deleted or renamed model `CommitmentPlanListResult` + - Deleted or renamed model `CommitmentTierListResult` + - Deleted or renamed model `ConnectionPropertiesV2BasicResourceArmPaginatedResult` + - Deleted or renamed model `CustomTopicConfig` + - Deleted or renamed model `DefenderForAISettingResult` + - Deleted or renamed model `DeploymentListResult` + - Deleted or renamed model `DeploymentSkuListResult` + - Deleted or renamed model `EncryptionScopeListResult` + - Deleted or renamed model `ErrorDetailAutoGenerated` + - Deleted or renamed model `ErrorResponseAutoGenerated` + - Deleted or renamed model `ModelCapacityListResult` + - Deleted or renamed model `ModelListResult` + - Deleted or renamed model `NetworkSecurityPerimeterConfigurationList` + - Deleted or renamed model `OperationListResult` + - Deleted or renamed model `ProjectListResult` + - Deleted or renamed model `QuotaTierListResult` + - Deleted or renamed model `RaiBlockListItemsResult` + - Deleted or renamed model `RaiBlockListResult` + - Deleted or renamed model `RaiContentFilterListResult` + - Deleted or renamed model `RaiPolicyListResult` + - Deleted or renamed model `RaiTopicConfig` + - Deleted or renamed model `RaiTopicResult` + - Deleted or renamed model `ResourceSkuListResult` + - Method `AccountConnectionsOperations.list` changed its parameter `category` from `positional_or_keyword` to `keyword_only` + - Method `AccountConnectionsOperations.list` changed its parameter `include_all` from `positional_or_keyword` to `keyword_only` + - Method `AccountConnectionsOperations.list` changed its parameter `target` from `positional_or_keyword` to `keyword_only` + - Method `AccountsOperations.regenerate_key` inserted a `positional_or_keyword` parameter `parameters` + - Method `AccountsOperations.regenerate_key` deleted or renamed its parameter `key_name` of kind `positional_or_keyword` + - Method `LocationBasedModelCapacitiesOperations.list` changed its parameter `model_format` from `positional_or_keyword` to `keyword_only` + - Method `LocationBasedModelCapacitiesOperations.list` changed its parameter `model_name` from `positional_or_keyword` to `keyword_only` + - Method `LocationBasedModelCapacitiesOperations.list` changed its parameter `model_version` from `positional_or_keyword` to `keyword_only` + - Method `ModelCapacitiesOperations.list` changed its parameter `model_format` from `positional_or_keyword` to `keyword_only` + - Method `ModelCapacitiesOperations.list` changed its parameter `model_name` from `positional_or_keyword` to `keyword_only` + - Method `ModelCapacitiesOperations.list` changed its parameter `model_version` from `positional_or_keyword` to `keyword_only` + - Method `ProjectCapabilityHostsOperations.begin_create_or_update` changed type of its parameter `capability_host` from `CapabilityHost` to `ProjectCapabilityHost` + - Method `ProjectConnectionsOperations.list` changed its parameter `category` from `positional_or_keyword` to `keyword_only` + - Method `ProjectConnectionsOperations.list` changed its parameter `include_all` from `positional_or_keyword` to `keyword_only` + - Method `ProjectConnectionsOperations.list` changed its parameter `target` from `positional_or_keyword` to `keyword_only` + - Method `RaiBlocklistItemsOperations.batch_delete` changed type of its parameter `rai_blocklist_items_names` from `JSON` to `List[str]` + - Method `ProjectCapabilityHostsOperations.begin_create_or_update` changed return type from `AsyncLROPoller[CapabilityHost]` to `AsyncLROPoller[ProjectCapabilityHost]` + - Method `ProjectCapabilityHostsOperations.begin_create_or_update` changed return type from `LROPoller[CapabilityHost]` to `LROPoller[ProjectCapabilityHost]` + - Method `ProjectCapabilityHostsOperations.get` changed return type from `CapabilityHost` to `ProjectCapabilityHost` + ## 15.0.0b6 (2026-10-10) ### Features Added diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/_metadata.json b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/_metadata.json index 39d3d3c6ec5d..3a6695e86cbd 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/_metadata.json +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/_metadata.json @@ -1,11 +1,11 @@ { - "apiVersion": "2026-09-15-preview", + "apiVersion": "2026-11-01", "apiVersions": { - "Microsoft.CognitiveServices": "2026-09-15-preview" + "Microsoft.CognitiveServices": "2026-11-01" }, - "commit": "8554bdf73142233b9584500c9661522d67380638", + "commit": "bb09e375334d3e064aa5bc06d83a0568ffca0b4c", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/CognitiveServices", - "emitterVersion": "0.63.9", - "httpClientPythonVersion": "0.38.1" + "emitterVersion": "0.63.11", + "httpClientPythonVersion": "0.40.0" } \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/api.md b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/api.md index 2edc1c50663b..9aa2e59219b9 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/api.md +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/api.md @@ -5,23 +5,16 @@ namespace azure.mgmt.cognitiveservices account_capability_hosts: AccountCapabilityHostsOperations account_connections: AccountConnectionsOperations accounts: AccountsOperations - adapter_deployments: AdapterDeploymentsOperations agent_applications: AgentApplicationsOperations agent_deployments: AgentDeploymentsOperations - arc_deployments: ArcDeploymentsOperations commitment_plans: CommitmentPlansOperations commitment_tiers: CommitmentTiersOperations - compute_operations: ComputeOperationsOperations - computes: ComputesOperations - cost_controls: CostControlsOperations defender_for_ai_settings: DefenderForAISettingsOperations deleted_accounts: DeletedAccountsOperations deployments: DeploymentsOperations encryption_scopes: EncryptionScopesOperations location_based_model_capacities: LocationBasedModelCapacitiesOperations managed_compute_capacities: ManagedComputeCapacitiesOperations - managed_compute_deployments: ManagedComputeDeploymentsOperations - managed_compute_usages_operation_group: ManagedComputeUsagesOperationGroupOperations managed_network_provisions: ManagedNetworkProvisionsOperations managed_network_settings: ManagedNetworkSettingsOperations model_capacities: ModelCapacitiesOperations @@ -36,21 +29,18 @@ namespace azure.mgmt.cognitiveservices project_connections: ProjectConnectionsOperations projects: ProjectsOperations quota_tiers: QuotaTiersOperations - rai_bindings: RaiBindingsOperations rai_blocklist_items: RaiBlocklistItemsOperations rai_blocklists: RaiBlocklistsOperations rai_content_filters: RaiContentFiltersOperations rai_external_safety_provider: RaiExternalSafetyProviderOperations rai_external_safety_providers: RaiExternalSafetyProvidersOperations rai_policies: RaiPoliciesOperations - rai_regos: RaiRegosOperations rai_tool_labels: RaiToolLabelsOperations rai_topics: RaiTopicsOperations resource_skus: ResourceSkusOperations subscription_rai_policy: SubscriptionRaiPolicyOperations test_rai_external_safety_provider: TestRaiExternalSafetyProviderOperations usages: UsagesOperations - workbenches: WorkbenchesOperations def __init__( self, @@ -165,23 +155,16 @@ namespace azure.mgmt.cognitiveservices.aio account_capability_hosts: AccountCapabilityHostsOperations account_connections: AccountConnectionsOperations accounts: AccountsOperations - adapter_deployments: AdapterDeploymentsOperations agent_applications: AgentApplicationsOperations agent_deployments: AgentDeploymentsOperations - arc_deployments: ArcDeploymentsOperations commitment_plans: CommitmentPlansOperations commitment_tiers: CommitmentTiersOperations - compute_operations: ComputeOperationsOperations - computes: ComputesOperations - cost_controls: CostControlsOperations defender_for_ai_settings: DefenderForAISettingsOperations deleted_accounts: DeletedAccountsOperations deployments: DeploymentsOperations encryption_scopes: EncryptionScopesOperations location_based_model_capacities: LocationBasedModelCapacitiesOperations managed_compute_capacities: ManagedComputeCapacitiesOperations - managed_compute_deployments: ManagedComputeDeploymentsOperations - managed_compute_usages_operation_group: ManagedComputeUsagesOperationGroupOperations managed_network_provisions: ManagedNetworkProvisionsOperations managed_network_settings: ManagedNetworkSettingsOperations model_capacities: ModelCapacitiesOperations @@ -196,21 +179,18 @@ namespace azure.mgmt.cognitiveservices.aio project_connections: ProjectConnectionsOperations projects: ProjectsOperations quota_tiers: QuotaTiersOperations - rai_bindings: RaiBindingsOperations rai_blocklist_items: RaiBlocklistItemsOperations rai_blocklists: RaiBlocklistsOperations rai_content_filters: RaiContentFiltersOperations rai_external_safety_provider: RaiExternalSafetyProviderOperations rai_external_safety_providers: RaiExternalSafetyProvidersOperations rai_policies: RaiPoliciesOperations - rai_regos: RaiRegosOperations rai_tool_labels: RaiToolLabelsOperations rai_topics: RaiTopicsOperations resource_skus: ResourceSkusOperations subscription_rai_policy: SubscriptionRaiPolicyOperations test_rai_external_safety_provider: TestRaiExternalSafetyProviderOperations usages: UsagesOperations - workbenches: WorkbenchesOperations def __init__( self, @@ -585,39 +565,6 @@ namespace azure.mgmt.cognitiveservices.aio.operations **kwargs: Any ) -> AsyncLROPoller[Account]: ... - @overload - async def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: EvaluateDeploymentPoliciesRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluateDeploymentPoliciesResponse: ... - - @overload - async def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: EvaluateDeploymentPoliciesRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluateDeploymentPoliciesResponse: ... - - @overload - async def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluateDeploymentPoliciesResponse: ... - @distributed_trace_async async def get( self, @@ -704,89 +651,6 @@ namespace azure.mgmt.cognitiveservices.aio.operations ) -> ApiKeys: ... - class azure.mgmt.cognitiveservices.aio.operations.AdapterDeploymentsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: AdapterDeployment, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> AsyncLROPoller[AdapterDeployment]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: AdapterDeployment, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> AsyncLROPoller[AdapterDeployment]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> AsyncLROPoller[AdapterDeployment]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'adapter_deployment_name', 'etag', 'match_condition']}, api_versions_list=['2026-09-15-preview']) - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'adapter_deployment_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - async def get( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - **kwargs: Any - ) -> AdapterDeployment: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> AsyncItemPaged[AdapterDeployment]: ... - - class azure.mgmt.cognitiveservices.aio.operations.AgentApplicationsOperations: def __init__( @@ -1013,116 +877,6 @@ namespace azure.mgmt.cognitiveservices.aio.operations ) -> None: ... - class azure.mgmt.cognitiveservices.aio.operations.ArcDeploymentsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: ArcDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ArcDeployment]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: ArcDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ArcDeployment]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ArcDeployment]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-07-15-preview', params_added_on={'2026-07-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'deployment_name']}, api_versions_list=['2026-07-15-preview', '2026-09-15-preview']) - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: ArcDeploymentUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ArcDeployment]: ... - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: ArcDeploymentUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ArcDeployment]: ... - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ArcDeployment]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-07-15-preview', params_added_on={'2026-07-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'deployment_name', 'accept']}, api_versions_list=['2026-07-15-preview', '2026-09-15-preview']) - async def get( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - **kwargs: Any - ) -> ArcDeployment: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-07-15-preview', params_added_on={'2026-07-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2026-07-15-preview', '2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> AsyncItemPaged[ArcDeployment]: ... - - class azure.mgmt.cognitiveservices.aio.operations.CommitmentPlansOperations: def __init__( @@ -1364,25 +1118,7 @@ namespace azure.mgmt.cognitiveservices.aio.operations ) -> AsyncItemPaged[CommitmentTier]: ... - class azure.mgmt.cognitiveservices.aio.operations.ComputeOperationsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-01-15-preview', params_added_on={'2026-01-15-preview': ['api_version', 'subscription_id', 'location', 'operation_id', 'accept']}, api_versions_list=['2026-01-15-preview', '2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def get( - self, - location: str, - operation_id: str, - **kwargs: Any - ) -> ComputeOperationStatus: ... - - - class azure.mgmt.cognitiveservices.aio.operations.ComputesOperations: + class azure.mgmt.cognitiveservices.aio.operations.DefenderForAISettingsOperations: def __init__( self, @@ -1391,102 +1127,96 @@ namespace azure.mgmt.cognitiveservices.aio.operations ) -> None: ... @overload - async def begin_create_or_update( + async def create_or_update( self, resource_group_name: str, account_name: str, - compute_name: str, - resource: Compute, + defender_for_ai_setting_name: str, + defender_for_ai_settings: DefenderForAISetting, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[Compute]: ... + ) -> DefenderForAISetting: ... @overload - async def begin_create_or_update( + async def create_or_update( self, resource_group_name: str, account_name: str, - compute_name: str, - resource: Compute, + defender_for_ai_setting_name: str, + defender_for_ai_settings: DefenderForAISetting, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[Compute]: ... + ) -> DefenderForAISetting: ... @overload - async def begin_create_or_update( + async def create_or_update( self, resource_group_name: str, account_name: str, - compute_name: str, - resource: IO[bytes], + defender_for_ai_setting_name: str, + defender_for_ai_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[Compute]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'compute_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> DefenderForAISetting: ... @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'compute_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def begin_restart( + async def get( self, resource_group_name: str, account_name: str, - compute_name: str, + defender_for_ai_setting_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> DefenderForAISetting: ... - @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'compute_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def begin_start( + @distributed_trace + def list( self, resource_group_name: str, account_name: str, - compute_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> AsyncItemPaged[DefenderForAISetting]: ... - @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'compute_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def begin_stop( + @overload + async def update( self, resource_group_name: str, account_name: str, - compute_name: str, + defender_for_ai_setting_name: str, + defender_for_ai_settings: DefenderForAISetting, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> DefenderForAISetting: ... - @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'compute_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def get( + @overload + async def update( self, resource_group_name: str, account_name: str, - compute_name: str, + defender_for_ai_setting_name: str, + defender_for_ai_settings: DefenderForAISetting, + *, + content_type: str = "application/json", **kwargs: Any - ) -> Compute: ... + ) -> DefenderForAISetting: ... - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def list( + @overload + async def update( self, resource_group_name: str, account_name: str, + defender_for_ai_setting_name: str, + defender_for_ai_settings: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[Compute]: ... + ) -> DefenderForAISetting: ... - class azure.mgmt.cognitiveservices.aio.operations.CostControlsOperations: + class azure.mgmt.cognitiveservices.aio.operations.DeletedAccountsOperations: def __init__( self, @@ -1494,233 +1224,10 @@ namespace azure.mgmt.cognitiveservices.aio.operations **kwargs ) -> None: ... - @overload - async def create_or_update( + @distributed_trace_async + async def begin_purge( self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: CostControl, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> CostControl: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: CostControl, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> CostControl: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> CostControl: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'cost_control_name', 'etag', 'match_condition']}, api_versions_list=['2026-09-15-preview']) - async def delete( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'cost_control_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - async def get( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - **kwargs: Any - ) -> CostControl: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> AsyncItemPaged[CostControl]: ... - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: CostControlPatch, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> CostControl: ... - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: CostControlPatch, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> CostControl: ... - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> CostControl: ... - - - class azure.mgmt.cognitiveservices.aio.operations.DefenderForAISettingsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: DefenderForAISetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> DefenderForAISetting: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: DefenderForAISetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> DefenderForAISetting: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> DefenderForAISetting: ... - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - **kwargs: Any - ) -> DefenderForAISetting: ... - - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> AsyncItemPaged[DefenderForAISetting]: ... - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: DefenderForAISetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> DefenderForAISetting: ... - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: DefenderForAISetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> DefenderForAISetting: ... - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> DefenderForAISetting: ... - - - class azure.mgmt.cognitiveservices.aio.operations.DeletedAccountsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace_async - async def begin_purge( - self, - location: str, + location: str, resource_group_name: str, account_name: str, **kwargs: Any @@ -1973,18 +1480,19 @@ namespace azure.mgmt.cognitiveservices.aio.operations ) -> None: ... @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'offer', 'accelerator_type', 'deployment_id', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) + @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'offer', 'accelerator_type', 'deployment_id', 'accept'], '2026-11-01': ['location']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview', '2026-11-01']) def list( self, *, accelerator_type: Optional[str] = ..., deployment_id: Optional[str] = ..., + location: Optional[str] = ..., offer: str, **kwargs: Any ) -> AsyncItemPaged[ManagedComputeCapacity]: ... - class azure.mgmt.cognitiveservices.aio.operations.ManagedComputeDeploymentsOperations: + class azure.mgmt.cognitiveservices.aio.operations.ManagedNetworkProvisionsOperations: def __init__( self, @@ -1993,246 +1501,119 @@ namespace azure.mgmt.cognitiveservices.aio.operations ) -> None: ... @overload - async def begin_create_or_update( + async def begin_provision_managed_network( self, resource_group_name: str, account_name: str, - deployment_name: str, - resource: ManagedComputeDeployment, + managed_network_name: str, + body: Optional[ManagedNetworkProvisionOptions] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ManagedComputeDeployment]: ... + ) -> AsyncLROPoller[ManagedNetworkProvisionStatus]: ... @overload - async def begin_create_or_update( + async def begin_provision_managed_network( self, resource_group_name: str, account_name: str, - deployment_name: str, - resource: ManagedComputeDeployment, + managed_network_name: str, + body: Optional[ManagedNetworkProvisionOptions] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ManagedComputeDeployment]: ... + ) -> AsyncLROPoller[ManagedNetworkProvisionStatus]: ... @overload - async def begin_create_or_update( + async def begin_provision_managed_network( self, resource_group_name: str, account_name: str, - deployment_name: str, - resource: IO[bytes], + managed_network_name: str, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ManagedComputeDeployment]: ... + ) -> AsyncLROPoller[ManagedNetworkProvisionStatus]: ... + + + class azure.mgmt.cognitiveservices.aio.operations.ManagedNetworkSettingsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'deployment_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) + @api_version_validation(method_added_on='2026-01-15-preview', params_added_on={'2026-01-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'managed_network_name']}, api_versions_list=['2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-05-01', '2026-05-15-preview', '2026-07-01', '2026-07-15-preview', '2026-09-01', '2026-09-15-preview', '2026-11-01']) async def begin_delete( self, resource_group_name: str, account_name: str, - deployment_name: str, + managed_network_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload - async def begin_update( + async def begin_patch( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: PatchResourceSku, + managed_network_name: str, + body: Optional[ManagedNetworkSettingsPropertiesBasicResource] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ManagedComputeDeployment]: ... + ) -> AsyncLROPoller[ManagedNetworkSettingsPropertiesBasicResource]: ... @overload - async def begin_update( + async def begin_patch( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: PatchResourceSku, + managed_network_name: str, + body: Optional[ManagedNetworkSettingsPropertiesBasicResource] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ManagedComputeDeployment]: ... + ) -> AsyncLROPoller[ManagedNetworkSettingsPropertiesBasicResource]: ... @overload - async def begin_update( + async def begin_patch( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: IO[bytes], + managed_network_name: str, + body: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[ManagedComputeDeployment]: ... + ) -> AsyncLROPoller[ManagedNetworkSettingsPropertiesBasicResource]: ... - @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'deployment_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def get( + @overload + async def begin_put( self, resource_group_name: str, account_name: str, - deployment_name: str, + managed_network_name: str, + body: ManagedNetworkSettingsPropertiesBasicResource, + *, + content_type: str = "application/json", **kwargs: Any - ) -> ManagedComputeDeployment: ... + ) -> AsyncLROPoller[ManagedNetworkSettingsPropertiesBasicResource]: ... - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def list( + @overload + async def begin_put( self, resource_group_name: str, account_name: str, + managed_network_name: str, + body: ManagedNetworkSettingsPropertiesBasicResource, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncItemPaged[ManagedComputeDeployment]: ... - - - class azure.mgmt.cognitiveservices.aio.operations.ManagedComputeUsagesOperationGroupOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'location', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncItemPaged[ManagedComputeUsage]: ... - - - class azure.mgmt.cognitiveservices.aio.operations.ManagedNetworkProvisionsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def begin_provision_managed_network( - self, - resource_group_name: str, - account_name: str, - managed_network_name: str, - body: Optional[ManagedNetworkProvisionOptions] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ManagedNetworkProvisionStatus]: ... - - @overload - async def begin_provision_managed_network( - self, - resource_group_name: str, - account_name: str, - managed_network_name: str, - body: Optional[ManagedNetworkProvisionOptions] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ManagedNetworkProvisionStatus]: ... - - @overload - async def begin_provision_managed_network( - self, - resource_group_name: str, - account_name: str, - managed_network_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ManagedNetworkProvisionStatus]: ... - - - class azure.mgmt.cognitiveservices.aio.operations.ManagedNetworkSettingsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-01-15-preview', params_added_on={'2026-01-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'managed_network_name']}, api_versions_list=['2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-05-01', '2026-05-15-preview', '2026-07-01', '2026-07-15-preview', '2026-09-01', '2026-09-15-preview']) - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - managed_network_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @overload - async def begin_patch( - self, - resource_group_name: str, - account_name: str, - managed_network_name: str, - body: Optional[ManagedNetworkSettingsPropertiesBasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ManagedNetworkSettingsPropertiesBasicResource]: ... - - @overload - async def begin_patch( - self, - resource_group_name: str, - account_name: str, - managed_network_name: str, - body: Optional[ManagedNetworkSettingsPropertiesBasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ManagedNetworkSettingsPropertiesBasicResource]: ... - - @overload - async def begin_patch( - self, - resource_group_name: str, - account_name: str, - managed_network_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ManagedNetworkSettingsPropertiesBasicResource]: ... - - @overload - async def begin_put( - self, - resource_group_name: str, - account_name: str, - managed_network_name: str, - body: ManagedNetworkSettingsPropertiesBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ManagedNetworkSettingsPropertiesBasicResource]: ... - - @overload - async def begin_put( - self, - resource_group_name: str, - account_name: str, - managed_network_name: str, - body: ManagedNetworkSettingsPropertiesBasicResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[ManagedNetworkSettingsPropertiesBasicResource]: ... + ) -> AsyncLROPoller[ManagedNetworkSettingsPropertiesBasicResource]: ... @overload async def begin_put( @@ -2939,91 +2320,6 @@ namespace azure.mgmt.cognitiveservices.aio.operations ) -> QuotaTier: ... - class azure.mgmt.cognitiveservices.aio.operations.RaiBindingsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: RaiBinding, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> RaiBinding: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: RaiBinding, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> RaiBinding: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> RaiBinding: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_binding_name', 'etag', 'match_condition']}, api_versions_list=['2026-09-15-preview']) - async def delete( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_binding_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - async def get( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - **kwargs: Any - ) -> RaiBinding: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'top', 'accept']}, api_versions_list=['2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - *, - top: Optional[int] = ..., - **kwargs: Any - ) -> AsyncItemPaged[RaiBinding]: ... - - class azure.mgmt.cognitiveservices.aio.operations.RaiBlocklistItemsOperations: def __init__( @@ -3330,15 +2626,12 @@ namespace azure.mgmt.cognitiveservices.aio.operations ) -> None: ... @distributed_trace_async - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_policy_name', 'etag', 'match_condition']}, api_versions_list=['2026-09-15-preview']) + @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_policy_name']}, api_versions_list=['2026-09-15-preview', '2026-11-01']) async def begin_delete( self, resource_group_name: str, account_name: str, rai_policy_name: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any ) -> AsyncLROPoller[None]: ... @@ -3351,8 +2644,6 @@ namespace azure.mgmt.cognitiveservices.aio.operations rai_policy: RaiPolicy, *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any ) -> RaiPolicy: ... @@ -3365,8 +2656,6 @@ namespace azure.mgmt.cognitiveservices.aio.operations rai_policy: RaiPolicy, *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any ) -> RaiPolicy: ... @@ -3379,13 +2668,11 @@ namespace azure.mgmt.cognitiveservices.aio.operations rai_policy: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any ) -> RaiPolicy: ... @distributed_trace_async - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_policy_name', 'accept']}, api_versions_list=['2026-09-15-preview']) + @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_policy_name', 'accept']}, api_versions_list=['2026-09-15-preview', '2026-11-01']) async def get( self, resource_group_name: str, @@ -3403,91 +2690,6 @@ namespace azure.mgmt.cognitiveservices.aio.operations ) -> AsyncItemPaged[RaiPolicy]: ... - class azure.mgmt.cognitiveservices.aio.operations.RaiRegosOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - rai_rego: RaiRego, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> RaiRego: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - rai_rego: RaiRego, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> RaiRego: ... - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - rai_rego: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> RaiRego: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_rego_name', 'etag', 'match_condition']}, api_versions_list=['2026-09-15-preview']) - async def delete( - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_rego_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - async def get( - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - **kwargs: Any - ) -> RaiRego: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'top', 'accept']}, api_versions_list=['2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - *, - top: Optional[int] = ..., - **kwargs: Any - ) -> AsyncItemPaged[RaiRego]: ... - - class azure.mgmt.cognitiveservices.aio.operations.RaiToolLabelsOperations: def __init__( @@ -3758,159 +2960,7 @@ namespace azure.mgmt.cognitiveservices.aio.operations ) -> AsyncItemPaged[Usage]: ... - class azure.mgmt.cognitiveservices.aio.operations.WorkbenchesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: Workbench, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Workbench]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: Workbench, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Workbench]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[Workbench]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'workbench_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'workbench_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def begin_restart( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'workbench_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def begin_start( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'workbench_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def begin_stop( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'workbench_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - async def get( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - **kwargs: Any - ) -> Workbench: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - project_name: str, - **kwargs: Any - ) -> AsyncItemPaged[Workbench]: ... - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: WorkbenchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Workbench: ... - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: WorkbenchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Workbench: ... - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Workbench: ... - - -namespace azure.mgmt.cognitiveservices.models +namespace azure.mgmt.cognitiveservices.models class azure.mgmt.cognitiveservices.models.AADAuthTypeConnectionProperties(ConnectionPropertiesV2, discriminator='AAD'): auth_type: Literal[ConnectionAuthType.AAD] @@ -4122,7 +3172,6 @@ namespace azure.mgmt.cognitiveservices.models class azure.mgmt.cognitiveservices.models.AccountProperties(_Model): a365_logging_enabled: Optional[bool] abuse_penalty: Optional[AbusePenalty] - agent_hosting_configurations: Optional[list[AgentHostingConfiguration]] allow_project_management: Optional[bool] allowed_fqdn_list: Optional[list[str]] aml_workspace: Optional[UserOwnedAmlWorkspace] @@ -4130,10 +3179,7 @@ namespace azure.mgmt.cognitiveservices.models associated_projects: Optional[list[str]] call_rate_limit: Optional[CallRateLimit] capabilities: Optional[list[SkuCapability]] - capability_settings: Optional[CapabilitySettings] commitment_plan_associations: Optional[list[CommitmentPlanAssociation]] - cost_control_connections: Optional[CostControlConnections] - cost_control_ids: Optional[list[str]] custom_sub_domain_name: Optional[str] date_created: Optional[str] default_project: Optional[str] @@ -4143,7 +3189,6 @@ namespace azure.mgmt.cognitiveservices.models encryption: Optional[Encryption] endpoint: Optional[str] endpoints: Optional[dict[str, str]] - foundry_auto_upgrade: Optional[FoundryAutoUpgrade] internal_id: Optional[str] is_migrated: Optional[bool] locations: Optional[MultiRegionSettings] @@ -4160,6 +3205,7 @@ namespace azure.mgmt.cognitiveservices.models scheduled_purge_date: Optional[str] sku_change_info: Optional[SkuChangeInfo] stored_completions_disabled: Optional[bool] + trusted_certificate_sources: Optional[list[TrustedCertificateSource]] user_owned_storage: Optional[list[UserOwnedStorage]] @overload @@ -4167,21 +3213,16 @@ namespace azure.mgmt.cognitiveservices.models self, *, a365_logging_enabled: Optional[bool] = ..., - agent_hosting_configurations: Optional[list[AgentHostingConfiguration]] = ..., allow_project_management: Optional[bool] = ..., allowed_fqdn_list: Optional[list[str]] = ..., aml_workspace: Optional[UserOwnedAmlWorkspace] = ..., api_properties: Optional[ApiProperties] = ..., associated_projects: Optional[list[str]] = ..., - capability_settings: Optional[CapabilitySettings] = ..., - cost_control_connections: Optional[CostControlConnections] = ..., - cost_control_ids: Optional[list[str]] = ..., custom_sub_domain_name: Optional[str] = ..., default_project: Optional[str] = ..., disable_local_auth: Optional[bool] = ..., dynamic_throttling_enabled: Optional[bool] = ..., encryption: Optional[Encryption] = ..., - foundry_auto_upgrade: Optional[FoundryAutoUpgrade] = ..., locations: Optional[MultiRegionSettings] = ..., migration_token: Optional[str] = ..., network_acls: Optional[NetworkRuleSet] = ..., @@ -4191,6 +3232,7 @@ namespace azure.mgmt.cognitiveservices.models restore: Optional[bool] = ..., restrict_outbound_network_access: Optional[bool] = ..., stored_completions_disabled: Optional[bool] = ..., + trusted_certificate_sources: Optional[list[TrustedCertificateSource]] = ..., user_owned_storage: Optional[list[UserOwnedStorage]] = ... ) -> None: ... @@ -4232,79 +3274,6 @@ namespace azure.mgmt.cognitiveservices.models INTERNAL = "Internal" - class azure.mgmt.cognitiveservices.models.AdapterDeployment(ProxyResource): - etag: Optional[str] - id: str - name: str - properties: Optional[AdapterDeploymentProperties] - system_data: SystemData - type: str - - @overload - def __init__( - self, - *, - properties: Optional[AdapterDeploymentProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.AdapterDeploymentLastOperation(_Model): - completed_at: Optional[datetime] - requested_target_deployment_name: Optional[str] - started_at: datetime - status: Union[str, AdapterDeploymentOperationState] - type: Union[str, AdapterDeploymentOperationType] - - @overload - def __init__( - self, - *, - completed_at: Optional[datetime] = ..., - requested_target_deployment_name: Optional[str] = ..., - started_at: datetime, - status: Union[str, AdapterDeploymentOperationState], - type: Union[str, AdapterDeploymentOperationType] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.AdapterDeploymentOperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACCEPTED = "Accepted" - FAILED = "Failed" - RUNNING = "Running" - SUCCEEDED = "Succeeded" - - - class azure.mgmt.cognitiveservices.models.AdapterDeploymentOperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATE = "Create" - DELETE = "Delete" - UPDATE = "Update" - - - class azure.mgmt.cognitiveservices.models.AdapterDeploymentProperties(_Model): - active_target_deployment_name: Optional[str] - last_operation: Optional[AdapterDeploymentLastOperation] - provisioning_state: Optional[Union[str, ProvisioningState]] - source_model_id: str - target_deployment_name: str - - @overload - def __init__( - self, - *, - source_model_id: str, - target_deployment_name: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.AgentApplication(ProxyResource): id: str name: str @@ -4396,26 +3365,6 @@ namespace azure.mgmt.cognitiveservices.models MANAGED = "Managed" - class azure.mgmt.cognitiveservices.models.AgentHostingConfiguration(_Model): - hosting_type: str - name: str - - @overload - def __init__( - self, - *, - hosting_type: str, - name: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.AgentHostingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED_CLUSTER = "ManagedCluster" - - class azure.mgmt.cognitiveservices.models.AgentProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): A2_A = "A2A" AGENT = "Agent" @@ -4644,377 +3593,125 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.ArcDeployment(ProxyResource): - etag: Optional[str] - id: str - name: str - properties: ArcDeploymentProperties - sku: ArcDeploymentSku - system_data: SystemData - type: str + class azure.mgmt.cognitiveservices.models.AssignedIdentity(_Model): + client_id: str + kind: Union[str, IdentityKind] + principal_id: str + provisioning_state: Optional[Union[str, IdentityProvisioningState]] + subject: Optional[str] + tenant_id: str + type: Union[str, IdentityManagementType] @overload def __init__( self, *, - properties: ArcDeploymentProperties, - sku: ArcDeploymentSku + client_id: str, + kind: Union[str, IdentityKind], + principal_id: str, + subject: Optional[str] = ..., + tenant_id: str, + type: Union[str, IdentityManagementType] ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.ArcDeploymentComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CPU = "cpu" - GPU = "gpu" - - - class azure.mgmt.cognitiveservices.models.ArcDeploymentCpuMemoryResourceRequirements(_Model): - cpu: str - memory: str + class azure.mgmt.cognitiveservices.models.BillingMeterInfo(_Model): + meter_id: Optional[str] + name: Optional[str] + unit: Optional[str] @overload def __init__( self, *, - cpu: str, - memory: str + meter_id: Optional[str] = ..., + name: Optional[str] = ..., + unit: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.ArcDeploymentKubernetesResources(_Model): - limits: Optional[ArcDeploymentResourceRequirements] - requests: Optional[ArcDeploymentCpuMemoryResourceRequirements] + class azure.mgmt.cognitiveservices.models.BuiltInAuthorizationScheme(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CHANNELS = "Channels" + CUSTOM = "Custom" + DEFAULT = "Default" + ORGANIZATION_SCOPE = "OrganizationScope" + + + class azure.mgmt.cognitiveservices.models.ByPassSelection(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SERVICES = "AzureServices" + NONE = "None" + + + class azure.mgmt.cognitiveservices.models.CalculateModelCapacityParameter(_Model): + model: Optional[DeploymentModel] + sku_name: Optional[str] + workloads: Optional[list[ModelCapacityCalculatorWorkload]] @overload def __init__( self, *, - limits: Optional[ArcDeploymentResourceRequirements] = ..., - requests: Optional[ArcDeploymentCpuMemoryResourceRequirements] = ... + model: Optional[DeploymentModel] = ..., + sku_name: Optional[str] = ..., + workloads: Optional[list[ModelCapacityCalculatorWorkload]] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.ArcDeploymentModel(_Model): - format: str - name: str + class azure.mgmt.cognitiveservices.models.CalculateModelCapacityResult(_Model): + estimated_capacity: Optional[CalculateModelCapacityResultEstimatedCapacity] + model: Optional[DeploymentModel] + sku_name: Optional[str] @overload def __init__( self, *, - format: str, - name: str + estimated_capacity: Optional[CalculateModelCapacityResultEstimatedCapacity] = ..., + model: Optional[DeploymentModel] = ..., + sku_name: Optional[str] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.ArcDeploymentPatchCpuMemoryResourceRequirements(_Model): - cpu: Optional[str] - memory: Optional[str] + class azure.mgmt.cognitiveservices.models.CalculateModelCapacityResultEstimatedCapacity(_Model): + deployable_value: Optional[int] + value: Optional[int] @overload def __init__( self, *, - cpu: Optional[str] = ..., - memory: Optional[str] = ... + deployable_value: Optional[int] = ..., + value: Optional[int] = ... ) -> None: ... @overload def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.ArcDeploymentPatchKubernetesResources(_Model): - limits: Optional[ArcDeploymentResourceRequirements] - requests: Optional[ArcDeploymentPatchCpuMemoryResourceRequirements] + class azure.mgmt.cognitiveservices.models.CallRateLimit(_Model): + count: Optional[float] + renewal_period: Optional[float] + rules: Optional[list[ThrottlingRule]] @overload def __init__( self, *, - limits: Optional[ArcDeploymentResourceRequirements] = ..., - requests: Optional[ArcDeploymentPatchCpuMemoryResourceRequirements] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ArcDeploymentProperties(_Model): - capabilities: Optional[dict[str, str]] - compute: Union[str, ArcDeploymentComputeType] - deployment_state: Optional[Union[str, DeploymentState]] - deployment_template: Optional[str] - extension_id: str - inference_endpoint: Optional[str] - model: ArcDeploymentModel - node_selector: Optional[dict[str, str]] - provisioning_details: Optional[ArcDeploymentProvisioningDetails] - provisioning_state: Optional[Union[str, ProvisioningState]] - rai_policy_name: Optional[str] - replicas: int - resources: ArcDeploymentKubernetesResources - runtime: Union[str, ArcDeploymentRuntime] - vllm_parameters: Optional[ArcDeploymentVllmParameters] - - @overload - def __init__( - self, - *, - compute: Union[str, ArcDeploymentComputeType], - deployment_state: Optional[Union[str, DeploymentState]] = ..., - deployment_template: Optional[str] = ..., - extension_id: str, - model: ArcDeploymentModel, - node_selector: Optional[dict[str, str]] = ..., - rai_policy_name: Optional[str] = ..., - replicas: int, - resources: ArcDeploymentKubernetesResources, - runtime: Union[str, ArcDeploymentRuntime] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ArcDeploymentProvisioningDetails(_Model): - last_operation_timestamp: Optional[datetime] - message: Optional[str] - - @overload - def __init__( - self, - *, - last_operation_timestamp: Optional[datetime] = ..., - message: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ArcDeploymentResourceRequirements(_Model): - cpu: Optional[str] - gpu: Optional[int] - memory: Optional[str] - - @overload - def __init__( - self, - *, - cpu: Optional[str] = ..., - gpu: Optional[int] = ..., - memory: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ArcDeploymentRuntime(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ONNX = "onnx-genai" - VLLM = "vllm" - - - class azure.mgmt.cognitiveservices.models.ArcDeploymentSku(_Model): - name: Union[str, ArcDeploymentSkuName] - - @overload - def __init__( - self, - *, - name: Union[str, ArcDeploymentSkuName] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ArcDeploymentSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ARC = "Arc" - - - class azure.mgmt.cognitiveservices.models.ArcDeploymentUpdate(_Model): - properties: Optional[ArcDeploymentUpdateProperties] - - @overload - def __init__( - self, - *, - properties: Optional[ArcDeploymentUpdateProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ArcDeploymentUpdateProperties(_Model): - node_selector: Optional[dict[str, str]] - replicas: Optional[int] - resources: Optional[ArcDeploymentPatchKubernetesResources] - - @overload - def __init__( - self, - *, - node_selector: Optional[dict[str, str]] = ..., - replicas: Optional[int] = ..., - resources: Optional[ArcDeploymentPatchKubernetesResources] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ArcDeploymentVllmParameters(_Model): - enforce_eager: Optional[bool] - gpu_memory_utilization: Optional[float] - max_model_len: Optional[int] - tensor_parallel_size: Optional[int] - - @overload - def __init__( - self, - *, - enforce_eager: Optional[bool] = ..., - gpu_memory_utilization: Optional[float] = ..., - max_model_len: Optional[int] = ..., - tensor_parallel_size: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.AssignedIdentity(_Model): - client_id: str - kind: Union[str, IdentityKind] - principal_id: str - provisioning_state: Optional[Union[str, IdentityProvisioningState]] - subject: Optional[str] - tenant_id: str - type: Union[str, IdentityManagementType] - - @overload - def __init__( - self, - *, - client_id: str, - kind: Union[str, IdentityKind], - principal_id: str, - subject: Optional[str] = ..., - tenant_id: str, - type: Union[str, IdentityManagementType] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.BillingMeterInfo(_Model): - meter_id: Optional[str] - name: Optional[str] - unit: Optional[str] - - @overload - def __init__( - self, - *, - meter_id: Optional[str] = ..., - name: Optional[str] = ..., - unit: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.BuiltInAuthorizationScheme(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CHANNELS = "Channels" - CUSTOM = "Custom" - DEFAULT = "Default" - ORGANIZATION_SCOPE = "OrganizationScope" - - - class azure.mgmt.cognitiveservices.models.ByPassSelection(str, Enum, metaclass=CaseInsensitiveEnumMeta): - AZURE_SERVICES = "AzureServices" - NONE = "None" - - - class azure.mgmt.cognitiveservices.models.CalculateModelCapacityParameter(_Model): - model: Optional[DeploymentModel] - sku_name: Optional[str] - workloads: Optional[list[ModelCapacityCalculatorWorkload]] - - @overload - def __init__( - self, - *, - model: Optional[DeploymentModel] = ..., - sku_name: Optional[str] = ..., - workloads: Optional[list[ModelCapacityCalculatorWorkload]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CalculateModelCapacityResult(_Model): - estimated_capacity: Optional[CalculateModelCapacityResultEstimatedCapacity] - model: Optional[DeploymentModel] - sku_name: Optional[str] - - @overload - def __init__( - self, - *, - estimated_capacity: Optional[CalculateModelCapacityResultEstimatedCapacity] = ..., - model: Optional[DeploymentModel] = ..., - sku_name: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CalculateModelCapacityResultEstimatedCapacity(_Model): - deployable_value: Optional[int] - value: Optional[int] - - @overload - def __init__( - self, - *, - deployable_value: Optional[int] = ..., - value: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CallRateLimit(_Model): - count: Optional[float] - renewal_period: Optional[float] - rules: Optional[list[ThrottlingRule]] - - @overload - def __init__( - self, - *, - count: Optional[float] = ..., - renewal_period: Optional[float] = ..., - rules: Optional[list[ThrottlingRule]] = ... + count: Optional[float] = ..., + renewal_period: Optional[float] = ..., + rules: Optional[list[ThrottlingRule]] = ... ) -> None: ... @overload @@ -5083,24 +3780,6 @@ namespace azure.mgmt.cognitiveservices.models UPDATING = "Updating" - class azure.mgmt.cognitiveservices.models.CapabilitySettings(_Model): - blob_store: Optional[str] - document_store: Optional[str] - vector_store: Optional[str] - - @overload - def __init__( - self, - *, - blob_store: Optional[str] = ..., - document_store: Optional[str] = ..., - vector_store: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.CapacityConfig(_Model): allowed_values: Optional[list[int]] default: Optional[int] @@ -5123,6 +3802,22 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.cognitiveservices.models.CertificateBundleReference(_Model): + secret_name: str + secret_version: str + + @overload + def __init__( + self, + *, + secret_name: str, + secret_version: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + class azure.mgmt.cognitiveservices.models.ChannelsBuiltInAuthorizationPolicy(ApplicationAuthorizationPolicy, discriminator='Channels'): type: Literal[BuiltInAuthorizationScheme.CHANNELS] @@ -5169,28 +3864,6 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.ClusterComputeProperties(ComputeProperties, discriminator='Cluster'): - compute_type: Literal[ComputeType.CLUSTER] - creation_time: datetime - errors: list[ErrorDetail] - location: str - pools: list[Pool] - provisioning_state: Union[str, ComputeProvisioningState] - subnet_arm_id: Optional[str] - - @overload - def __init__( - self, - *, - location: str, - pools: list[Pool], - subnet_arm_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.CommitmentCost(_Model): commitment_meter_id: Optional[str] overage_meter_id: Optional[str] @@ -5393,120 +4066,16 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.Compute(ProxyResource): - etag: Optional[str] - id: str - identity: Optional[Identity] - kind: Optional[str] - name: str - properties: ComputeProperties - system_data: SystemData - type: str + class azure.mgmt.cognitiveservices.models.ConnectionAccessKey(_Model): + access_key_id: Optional[str] + secret_access_key: Optional[str] @overload def __init__( self, *, - identity: Optional[Identity] = ..., - kind: Optional[str] = ..., - properties: ComputeProperties - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ComputeOperationStatus(ProxyResource): - id: str - name: str - properties: Optional[ComputeOperationStatusProperties] - system_data: SystemData - type: str - - @overload - def __init__( - self, - *, - properties: Optional[ComputeOperationStatusProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ComputeOperationStatusProperties(_Model): - end_time: Optional[datetime] - error: Optional[ErrorDetail] - start_time: Optional[datetime] - status: Optional[Union[str, ComputeOperationStatusType]] - - @overload - def __init__( - self, - *, - error: Optional[ErrorDetail] = ..., - status: Optional[Union[str, ComputeOperationStatusType]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ComputeOperationStatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELED = "Canceled" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - - - class azure.mgmt.cognitiveservices.models.ComputeProperties(_Model): - compute_type: str - creation_time: Optional[datetime] - errors: Optional[list[ErrorDetail]] - location: str - provisioning_state: Optional[Union[str, ComputeProvisioningState]] - - @overload - def __init__( - self, - *, - compute_type: str, - location: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ComputeProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACCEPTED = "Accepted" - CANCELED = "Canceled" - DELETING = "Deleting" - DISABLED = "Disabled" - FAILED = "Failed" - RESTARTING = "Restarting" - SCALING = "Scaling" - STARTING = "Starting" - STOPPED = "Stopped" - STOPPING = "Stopping" - SUCCEEDED = "Succeeded" - - - class azure.mgmt.cognitiveservices.models.ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLUSTER = "Cluster" - CONTAINER_INSTANCE = "ContainerInstance" - - - class azure.mgmt.cognitiveservices.models.ConnectionAccessKey(_Model): - access_key_id: Optional[str] - secret_access_key: Optional[str] - - @overload - def __init__( - self, - *, - access_key_id: Optional[str] = ..., - secret_access_key: Optional[str] = ... + access_key_id: Optional[str] = ..., + secret_access_key: Optional[str] = ... ) -> None: ... @overload @@ -5641,7 +4210,6 @@ namespace azure.mgmt.cognitiveservices.models ODBC = "Odbc" OFFICE365 = "Office365" OPEN_AI = "OpenAI" - OPEN_API = "OpenAPI" ORACLE = "Oracle" ORACLE_CLOUD_STORAGE = "OracleCloudStorage" ORACLE_SERVICE_CLOUD = "OracleServiceCloud" @@ -5873,239 +4441,12 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.ConnectivityEndpoints(_Model): - public_ip_address: Optional[str] - ssh_port: Optional[int] - - - class azure.mgmt.cognitiveservices.models.ContainerInstanceComputeProperties(ComputeProperties, discriminator='ContainerInstance'): - compute_type: Literal[ComputeType.CONTAINER_INSTANCE] - connectivity_endpoints: Optional[ConnectivityEndpoints] - creation_time: datetime - errors: list[ErrorDetail] - idle_time_before_shutdown: Optional[str] - image_link: str - location: str - provisioning_state: Union[str, ComputeProvisioningState] - ssh_settings: Optional[SshSettings] - target_cluster_id: str - - @overload - def __init__( - self, - *, - idle_time_before_shutdown: Optional[str] = ..., - image_link: str, - location: str, - ssh_settings: Optional[SshSettings] = ..., - target_cluster_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.ContentLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): HIGH = "High" LOW = "Low" MEDIUM = "Medium" - class azure.mgmt.cognitiveservices.models.CostControl(ProxyResource): - etag: Optional[str] - id: str - name: str - properties: Optional[CostControlProperties] - system_data: SystemData - type: str - - @overload - def __init__( - self, - *, - properties: Optional[CostControlProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CostControlConnections(_Model): - app_insights_connection_id: Optional[str] - event_grid_connection_id: Optional[str] - - @overload - def __init__( - self, - *, - app_insights_connection_id: Optional[str] = ..., - event_grid_connection_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CostControlDimension(_Model): - attribute: Optional[str] - type: Union[str, CostControlDimensionType] - - @overload - def __init__( - self, - *, - type: Union[str, CostControlDimensionType] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CostControlDimensionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACCOUNT = "Account" - AGENT = "Agent" - CUSTOM = "Custom" - IDENTITY = "Identity" - PROJECT = "Project" - SESSION = "Session" - - - class azure.mgmt.cognitiveservices.models.CostControlMatch(_Model): - agent_resource_ids: Optional[list[str]] - identity_object_ids: Optional[list[str]] - project_ids: Optional[list[str]] - session_ids: Optional[list[str]] - - @overload - def __init__( - self, - *, - agent_resource_ids: Optional[list[str]] = ..., - identity_object_ids: Optional[list[str]] = ..., - project_ids: Optional[list[str]] = ..., - session_ids: Optional[list[str]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CostControlPatch(_Model): - properties: Optional[CostControlPatchProperties] - - @overload - def __init__( - self, - *, - properties: Optional[CostControlPatchProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CostControlPatchProperties(_Model): - display_name: Optional[str] - rules: Optional[list[CostControlRule]] - - @overload - def __init__( - self, - *, - display_name: Optional[str] = ..., - rules: Optional[list[CostControlRule]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CostControlPeriod(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DAY = "Day" - HOUR = "Hour" - MINUTE = "Minute" - MONTH = "Month" - WEEK = "Week" - YEAR = "Year" - - - class azure.mgmt.cognitiveservices.models.CostControlProperties(_Model): - display_name: Optional[str] - rules: list[CostControlRule] - - @overload - def __init__( - self, - *, - display_name: Optional[str] = ..., - rules: list[CostControlRule] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CostControlRule(_Model): - amount: float - counter_key: CostControlDimension - match: Optional[CostControlMatch] - name: str - period: Optional[Union[str, CostControlPeriod]] - recurring: Optional[bool] - thresholds: Optional[list[CostControlThreshold]] - unit: Union[str, CostControlUnit] - - @overload - def __init__( - self, - *, - amount: float, - counter_key: CostControlDimension, - match: Optional[CostControlMatch] = ..., - name: str, - period: Optional[Union[str, CostControlPeriod]] = ..., - recurring: Optional[bool] = ..., - thresholds: Optional[list[CostControlThreshold]] = ..., - unit: Union[str, CostControlUnit] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CostControlThreshold(_Model): - action: Union[str, CostControlThresholdAction] - type: Union[str, CostControlThresholdType] - value: float - - @overload - def __init__( - self, - *, - action: Union[str, CostControlThresholdAction], - type: Union[str, CostControlThresholdType], - value: float - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.CostControlThresholdAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALERT = "Alert" - AUDIT = "Audit" - BLOCK = "Block" - - - class azure.mgmt.cognitiveservices.models.CostControlThresholdType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ABSOLUTE = "Absolute" - PERCENTAGE = "Percentage" - - - class azure.mgmt.cognitiveservices.models.CostControlUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - USD = "Usd" - - class azure.mgmt.cognitiveservices.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): APPLICATION = "Application" KEY = "Key" @@ -6300,30 +4641,11 @@ namespace azure.mgmt.cognitiveservices.models ONCE_NEW_DEFAULT_VERSION_AVAILABLE = "OnceNewDefaultVersionAvailable" - class azure.mgmt.cognitiveservices.models.DeploymentPolicyEvaluationResult(_Model): - error_message: Optional[str] - evaluation_outcome: Optional[Union[str, PolicyEvaluationOutcome]] - non_compliant_assignments: Optional[list[PolicyAssignmentEvaluationDetails]] - - @overload - def __init__( - self, - *, - error_message: Optional[str] = ..., - evaluation_outcome: Optional[Union[str, PolicyEvaluationOutcome]] = ..., - non_compliant_assignments: Optional[list[PolicyAssignmentEvaluationDetails]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.DeploymentProperties(_Model): call_rate_limit: Optional[CallRateLimit] capabilities: Optional[dict[str, str]] capacity_settings: Optional[DeploymentCapacitySettings] context_cache_container_id: Optional[str] - cost_control_ids: Optional[list[str]] current_capacity: Optional[int] deployment_state: Optional[Union[str, DeploymentState]] dynamic_throttling_enabled: Optional[bool] @@ -6335,7 +4657,6 @@ namespace azure.mgmt.cognitiveservices.models routing: Optional[DeploymentRouting] scale_settings: Optional[DeploymentScaleSettings] service_tier: Optional[Union[str, ServiceTier]] - speculative_decoding: Optional[DeploymentSpeculativeDecoding] spillover_deployment_name: Optional[str] version_upgrade_option: Optional[Union[str, DeploymentModelVersionUpgradeOption]] @@ -6345,7 +4666,6 @@ namespace azure.mgmt.cognitiveservices.models *, capacity_settings: Optional[DeploymentCapacitySettings] = ..., context_cache_container_id: Optional[str] = ..., - cost_control_ids: Optional[list[str]] = ..., current_capacity: Optional[int] = ..., deployment_state: Optional[Union[str, DeploymentState]] = ..., model: Optional[DeploymentModel] = ..., @@ -6354,7 +4674,6 @@ namespace azure.mgmt.cognitiveservices.models routing: Optional[DeploymentRouting] = ..., scale_settings: Optional[DeploymentScaleSettings] = ..., service_tier: Optional[Union[str, ServiceTier]] = ..., - speculative_decoding: Optional[DeploymentSpeculativeDecoding] = ..., spillover_deployment_name: Optional[str] = ..., version_upgrade_option: Optional[Union[str, DeploymentModelVersionUpgradeOption]] = ... ) -> None: ... @@ -6418,22 +4737,6 @@ namespace azure.mgmt.cognitiveservices.models total_available_capacity: Optional[int] - class azure.mgmt.cognitiveservices.models.DeploymentSpeculativeDecoding(_Model): - draft_model: DeploymentModel - draft_token_count: Optional[int] - - @overload - def __init__( - self, - *, - draft_model: DeploymentModel, - draft_token_count: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.DeploymentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): PAUSED = "Paused" RUNNING = "Running" @@ -6564,125 +4867,26 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesDeployment(_Model): - name: str - properties: EvaluateDeploymentPoliciesDeploymentProperties + class azure.mgmt.cognitiveservices.models.FirewallSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BASIC = "Basic" + STANDARD = "Standard" + + + class azure.mgmt.cognitiveservices.models.FqdnOutboundRule(OutboundRule, discriminator='FQDN'): + category: Union[str, RuleCategory] + destination: Optional[str] + error_information: str + parent_rule_names: list[str] + status: Union[str, RuleStatus] + type: Literal[RuleType.FQDN] @overload def __init__( self, *, - name: str, - properties: EvaluateDeploymentPoliciesDeploymentProperties - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesDeploymentProperties(_Model): - model: DeploymentModel - rai_policy_name: Optional[str] - - @overload - def __init__( - self, - *, - model: DeploymentModel, - rai_policy_name: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesRequest(_Model): - deployments: list[EvaluateDeploymentPoliciesDeployment] - - @overload - def __init__( - self, - *, - deployments: list[EvaluateDeploymentPoliciesDeployment] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesResponse(_Model): - results: Optional[dict[str, DeploymentPolicyEvaluationResult]] - - @overload - def __init__( - self, - *, - results: Optional[dict[str, DeploymentPolicyEvaluationResult]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.FirewallSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BASIC = "Basic" - STANDARD = "Standard" - - - class azure.mgmt.cognitiveservices.models.FoundryAutoUpgrade(_Model): - mode: Optional[Union[str, FoundryAutoUpgradeMode]] - planned_by_microsoft: Optional[bool] - scheduled_at: Optional[datetime] - status_reason: Optional[str] - - @overload - def __init__( - self, - *, - mode: Optional[Union[str, FoundryAutoUpgradeMode]] = ..., - planned_by_microsoft: Optional[bool] = ..., - scheduled_at: Optional[datetime] = ..., - status_reason: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.FoundryAutoUpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DISABLED = "Disabled" - ENABLED = "Enabled" - - - class azure.mgmt.cognitiveservices.models.FqdnOutboundRule(OutboundRule, discriminator='FQDN'): - category: Union[str, RuleCategory] - destination: Optional[str] - error_information: str - parent_rule_names: list[str] - status: Union[str, RuleStatus] - type: Literal[RuleType.FQDN] - - @overload - def __init__( - self, - *, - category: Optional[Union[str, RuleCategory]] = ..., - destination: Optional[str] = ..., - status: Optional[Union[str, RuleStatus]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.GatedModelAccessProperties(_Model): - connection_id: str - - @overload - def __init__( - self, - *, - connection_id: str + category: Optional[Union[str, RuleCategory]] = ..., + destination: Optional[str] = ..., + status: Optional[Union[str, RuleStatus]] = ... ) -> None: ... @overload @@ -6847,29 +5051,6 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.ManagedClusterAgentHostingConfiguration(AgentHostingConfiguration, discriminator='ManagedCluster'): - cluster_resource_id: str - hosting_management_identity_resource_id: str - hosting_type: Literal[AgentHostingType.MANAGED_CLUSTER] - name: str - storage_account_resource_id: str - workload_identity_resource_id: str - - @overload - def __init__( - self, - *, - cluster_resource_id: str, - hosting_management_identity_resource_id: str, - name: str, - storage_account_resource_id: str, - workload_identity_resource_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.ManagedComputeCapacity(ProxyResource): id: str name: str @@ -6892,140 +5073,9 @@ namespace azure.mgmt.cognitiveservices.models accelerator_type: Optional[str] available_accelerators: Optional[int] deployment_size_capacities: Optional[list[DeploymentSizeCapacity]] - - - class azure.mgmt.cognitiveservices.models.ManagedComputeDeployment(ProxyResource): - etag: Optional[str] - id: str - name: str - properties: Optional[ManagedComputeDeploymentProperties] - sku: Optional[Sku] - system_data: SystemData - type: str - - @overload - def __init__( - self, - *, - properties: Optional[ManagedComputeDeploymentProperties] = ..., - sku: Optional[Sku] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentInfo(_Model): - accelerator_count: Optional[int] - deployment_id: Optional[str] - instance_count: Optional[int] - model_id: Optional[str] - project_id: Optional[str] - - @overload - def __init__( - self, - *, - accelerator_count: Optional[int] = ..., - deployment_id: Optional[str] = ..., - instance_count: Optional[int] = ..., - model_id: Optional[str] = ..., - project_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentProperties(_Model): - accelerator_type: Optional[str] - accelerators_per_instance: Optional[int] - capabilities: Optional[dict[str, str]] - compute_id: Optional[str] - deployment_template: Optional[str] - gated_model_access: Optional[GatedModelAccessProperties] - model: str - priority: Optional[str] - provisioning_details: Optional[ManagedComputeDeploymentProvisioningDetails] - provisioning_state: Optional[Union[str, ProvisioningState]] - routes: Optional[ManagedComputeDeploymentRoutes] - total_accelerators: Optional[int] - version_upgrade_option: Optional[Union[str, DeploymentModelVersionUpgradeOption]] - - @overload - def __init__( - self, - *, - accelerator_type: Optional[str] = ..., - compute_id: Optional[str] = ..., - deployment_template: Optional[str] = ..., - gated_model_access: Optional[GatedModelAccessProperties] = ..., - model: str, - priority: Optional[str] = ..., - version_upgrade_option: Optional[Union[str, DeploymentModelVersionUpgradeOption]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentProvisioningDetails(_Model): - last_operation_timestamp: Optional[datetime] - message: Optional[str] - - @overload - def __init__( - self, - *, - last_operation_timestamp: Optional[datetime] = ..., - message: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentRoutes(_Model): - chat_completions_scoring_path: Optional[str] - messages_api_scoring_path: Optional[str] - swagger: Optional[str] - - @overload - def __init__( - self, - *, - chat_completions_scoring_path: Optional[str] = ..., - messages_api_scoring_path: Optional[str] = ..., - swagger: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.ManagedComputeUsage(_Model): - current_value: Optional[float] - deployments: Optional[list[ManagedComputeDeploymentInfo]] - id: Optional[str] - limit: Optional[float] - name: Optional[MetricName] offer_scope: Optional[str] - type: Optional[str] - unit: Optional[Union[str, UnitType]] - - @overload - def __init__( - self, - *, - current_value: Optional[float] = ..., - deployments: Optional[list[ManagedComputeDeploymentInfo]] = ..., - limit: Optional[float] = ..., - offer_scope: Optional[str] = ..., - unit: Optional[Union[str, UnitType]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + scope_id: Optional[str] + total_available_accelerators: Optional[int] class azure.mgmt.cognitiveservices.models.ManagedIdentityAuthTypeConnectionProperties(ConnectionPropertiesV2, discriminator='ManagedIdentity'): @@ -7777,20 +5827,6 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.PatchResourceSku(_Model): - sku: Optional[Sku] - - @overload - def __init__( - self, - *, - sku: Optional[Sku] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.PatchResourceTags(_Model): tags: Optional[dict[str, str]] @@ -7821,82 +5857,6 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.PolicyAssignmentEvaluationDetails(_Model): - assignment_id: Optional[str] - effect: Optional[str] - evaluation_outcome: Optional[Union[str, PolicyEvaluationOutcome]] - expression_evaluations: Optional[list[PolicyExpressionEvaluationDetails]] - non_compliance_reason: Optional[str] - policy_definition_id: Optional[str] - policy_set_definition_id: Optional[str] - - @overload - def __init__( - self, - *, - assignment_id: Optional[str] = ..., - effect: Optional[str] = ..., - evaluation_outcome: Optional[Union[str, PolicyEvaluationOutcome]] = ..., - expression_evaluations: Optional[list[PolicyExpressionEvaluationDetails]] = ..., - non_compliance_reason: Optional[str] = ..., - policy_definition_id: Optional[str] = ..., - policy_set_definition_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.PolicyEvaluationOutcome(str, Enum, metaclass=CaseInsensitiveEnumMeta): - COMPLIANT = "Compliant" - ERROR = "Error" - NON_COMPLIANT = "NonCompliant" - - - class azure.mgmt.cognitiveservices.models.PolicyExpressionEvaluationDetails(_Model): - expression: Optional[str] - expression_kind: Optional[str] - expression_value: Optional[str] - operator: Optional[str] - result: Optional[str] - target_value: Optional[str] - - @overload - def __init__( - self, - *, - expression: Optional[str] = ..., - expression_kind: Optional[str] = ..., - expression_value: Optional[str] = ..., - operator: Optional[str] = ..., - result: Optional[str] = ..., - target_value: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.Pool(_Model): - instance_type: str - name: str - node_count: int - vm_priority: Optional[Union[str, VmPriority]] - - @overload - def __init__( - self, - *, - instance_type: str, - name: str, - node_count: int, - vm_priority: Optional[Union[str, VmPriority]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.PrivateEndpoint(_Model): id: Optional[str] @@ -8139,7 +6099,6 @@ namespace azure.mgmt.cognitiveservices.models class azure.mgmt.cognitiveservices.models.ProjectProperties(_Model): - capability_settings: Optional[CapabilitySettings] description: Optional[str] display_name: Optional[str] endpoints: Optional[dict[str, str]] @@ -8150,7 +6109,6 @@ namespace azure.mgmt.cognitiveservices.models def __init__( self, *, - capability_settings: Optional[CapabilitySettings] = ..., description: Optional[str] = ..., display_name: Optional[str] = ... ) -> None: ... @@ -8202,7 +6160,6 @@ namespace azure.mgmt.cognitiveservices.models CANCELED = "Canceled" CREATING = "Creating" DELETING = "Deleting" - EXTENSION_UNREACHABLE = "ExtensionUnreachable" FAILED = "Failed" MOVING = "Moving" RESOLVING_DNS = "ResolvingDNS" @@ -8308,281 +6265,29 @@ namespace azure.mgmt.cognitiveservices.models UNKNOWN = "Unknown" - class azure.mgmt.cognitiveservices.models.RaiAcsEmptyObject(_Model): - - - class azure.mgmt.cognitiveservices.models.RaiAcsHarmCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HATE = "Hate" - PROMPT_INJECTION = "PromptInjection" - PROTECTED_MATERIAL_CODE = "ProtectedMaterialCode" - PROTECTED_MATERIAL_TEXT = "ProtectedMaterialText" - SELF_HARM = "SelfHarm" - SEXUAL = "Sexual" - VIOLENCE = "Violence" + class azure.mgmt.cognitiveservices.models.RaiActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANNOTATING = "ANNOTATING" + BLOCKING = "BLOCKING" + HITL = "HITL" + NONE = "None" + RETRY = "RETRY" - class azure.mgmt.cognitiveservices.models.RaiAcsHarmConfiguration(_Model): - category: Union[str, RaiAcsHarmCategory] - harm_config_id: Optional[str] + class azure.mgmt.cognitiveservices.models.RaiBlocklist(ProxyResource): + etag: Optional[str] + id: str + name: str + properties: Optional[RaiBlocklistProperties] + system_data: SystemData + tags: Optional[dict[str, str]] + type: str @overload def __init__( self, *, - category: Union[str, RaiAcsHarmCategory], - harm_config_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiAcsInterventionPoint(_Model): - annotations: Optional[RaiAcsEmptyObject] - policy: RaiAcsPolicyBinding - policy_target: Union[str, RaiAcsPolicyTarget] - policy_target_kind: Union[str, RaiAcsPolicyTargetKind] - - @overload - def __init__( - self, - *, - annotations: Optional[RaiAcsEmptyObject] = ..., - policy: RaiAcsPolicyBinding, - policy_target: Union[str, RaiAcsPolicyTarget], - policy_target_kind: Union[str, RaiAcsPolicyTargetKind] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiAcsInterventionPoints(_Model): - input: Optional[RaiAcsInterventionPoint] - output: Optional[RaiAcsInterventionPoint] - post_tool_call: Optional[RaiAcsToolInterventionPoint] - pre_tool_call: Optional[RaiAcsToolInterventionPoint] - - @overload - def __init__( - self, - *, - input: Optional[RaiAcsInterventionPoint] = ..., - output: Optional[RaiAcsInterventionPoint] = ..., - post_tool_call: Optional[RaiAcsToolInterventionPoint] = ..., - pre_tool_call: Optional[RaiAcsToolInterventionPoint] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiAcsManifest(_Model): - agent_control_specification_version: str - annotators: Optional[RaiAcsEmptyObject] - intervention_points: RaiAcsInterventionPoints - metadata: Optional[dict[str, Any]] - policies: dict[str, RaiAcsRegoPolicyDefinition] - tools: Optional[dict[str, RaiAcsToolDefinition]] - - @overload - def __init__( - self, - *, - agent_control_specification_version: str, - annotators: Optional[RaiAcsEmptyObject] = ..., - intervention_points: RaiAcsInterventionPoints, - metadata: Optional[dict[str, Any]] = ..., - policies: dict[str, RaiAcsRegoPolicyDefinition], - tools: Optional[dict[str, RaiAcsToolDefinition]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiAcsModerationBindingExtension(_Model): - harm_configs: list[RaiAcsHarmConfiguration] - subject_format: Union[str, RaiAcsModerationSubjectFormat] - - @overload - def __init__( - self, - *, - harm_configs: list[RaiAcsHarmConfiguration], - subject_format: Union[str, RaiAcsModerationSubjectFormat] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiAcsModerationSubjectFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANONICAL_JSON = "canonical_json" - TEXT = "text" - - - class azure.mgmt.cognitiveservices.models.RaiAcsPolicyBinding(_Model): - aacs_moderation: Optional[RaiAcsModerationBindingExtension] - id: str - query: Optional[str] - - @overload - def __init__( - self, - *, - aacs_moderation: Optional[RaiAcsModerationBindingExtension] = ..., - id: str, - query: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiAcsPolicyDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - REGO = "rego" - - - class azure.mgmt.cognitiveservices.models.RaiAcsPolicyTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INPUT = "$snap.input" - OUTPUT = "$snap.output" - TOOL_ARGUMENTS = "$snap.tool_call.args" - TOOL_RESULT = "$snap.tool_result.value" - - - class azure.mgmt.cognitiveservices.models.RaiAcsPolicyTargetKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ASSISTANT_OUTPUT = "assistant_output" - TOOL_ARGUMENTS = "tool_args" - TOOL_RESULT = "tool_result" - USER_INPUT = "user_input" - - - class azure.mgmt.cognitiveservices.models.RaiAcsRegoPolicyDefinition(_Model): - query: str - type: Union[str, RaiAcsPolicyDefinitionType] - - @overload - def __init__( - self, - *, - query: str, - type: Union[str, RaiAcsPolicyDefinitionType] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiAcsToolDefinition(_Model): - clearance: Optional[str] - description: Optional[str] - id: Optional[str] - security_labels: Optional[list[str]] - type: Optional[str] - - @overload - def __init__( - self, - *, - clearance: Optional[str] = ..., - description: Optional[str] = ..., - id: Optional[str] = ..., - security_labels: Optional[list[str]] = ..., - type: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiAcsToolInterventionPoint(_Model): - annotations: Optional[RaiAcsEmptyObject] - policy: RaiAcsPolicyBinding - policy_target: Union[str, RaiAcsPolicyTarget] - policy_target_kind: Union[str, RaiAcsPolicyTargetKind] - tool_name_from: Optional[Union[str, RaiAcsToolNameSelector]] - - @overload - def __init__( - self, - *, - annotations: Optional[RaiAcsEmptyObject] = ..., - policy: RaiAcsPolicyBinding, - policy_target: Union[str, RaiAcsPolicyTarget], - policy_target_kind: Union[str, RaiAcsPolicyTargetKind], - tool_name_from: Optional[Union[str, RaiAcsToolNameSelector]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiAcsToolNameSelector(str, Enum, metaclass=CaseInsensitiveEnumMeta): - TOOL_CALL_NAME = "$snap.tool_call.name" - TOOL_CALL_NAME_ALIAS = "$.tool_call.name" - - - class azure.mgmt.cognitiveservices.models.RaiActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ANNOTATING = "ANNOTATING" - BLOCKING = "BLOCKING" - HITL = "HITL" - NONE = "None" - RETRY = "RETRY" - - - class azure.mgmt.cognitiveservices.models.RaiBinding(ProxyResource): - etag: Optional[str] - id: str - name: str - properties: Optional[RaiBindingProperties] - system_data: SystemData - tags: Optional[dict[str, str]] - type: str - - @overload - def __init__( - self, - *, - properties: Optional[RaiBindingProperties] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiBindingProperties(_Model): - bound_resource_id: str - target_policy_name: str - - @overload - def __init__( - self, - *, - bound_resource_id: str, - target_policy_name: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiBlocklist(ProxyResource): - etag: Optional[str] - id: str - name: str - properties: Optional[RaiBlocklistProperties] - system_data: SystemData - tags: Optional[dict[str, str]] - type: str - - @overload - def __init__( - self, - *, - properties: Optional[RaiBlocklistProperties] = ..., - tags: Optional[dict[str, str]] = ... + properties: Optional[RaiBlocklistProperties] = ..., + tags: Optional[dict[str, str]] = ... ) -> None: ... @overload @@ -9022,31 +6727,6 @@ namespace azure.mgmt.cognitiveservices.models PROMPT = "Prompt" - class azure.mgmt.cognitiveservices.models.RaiPolicyCustomExternalSafetyProviderReference(_Model): - blocking: Optional[bool] - external_safety_provider_name: str - managed_identity_resource_id: Optional[str] - source: Union[str, RaiPolicyContentSource] - - @overload - def __init__( - self, - *, - blocking: Optional[bool] = ..., - external_safety_provider_name: str, - managed_identity_resource_id: Optional[str] = ..., - source: Union[str, RaiPolicyContentSource] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiPolicyFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACS = "ACS" - CONTENT_FILTERS = "ContentFilters" - - class azure.mgmt.cognitiveservices.models.RaiPolicyMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): ASYNCHRONOUS_FILTER = "Asynchronous_filter" BLOCKING = "Blocking" @@ -9055,14 +6735,10 @@ namespace azure.mgmt.cognitiveservices.models class azure.mgmt.cognitiveservices.models.RaiPolicyProperties(_Model): - acs: Optional[RaiAcsManifest] - acs_regos: Optional[list[RaiRegoReference]] base_policy_name: Optional[str] content_filters: Optional[list[RaiPolicyContentFilter]] custom_blocklists: Optional[list[CustomBlocklistConfig]] - custom_external_safety_providers: Optional[list[RaiPolicyCustomExternalSafetyProviderReference]] egress_policy: Optional[RaiEgressPolicyConfig] - format: Optional[Union[str, RaiPolicyFormat]] mode: Optional[Union[str, RaiPolicyMode]] safety_providers: Optional[list[SafetyProviderConfig]] type: Optional[Union[str, RaiPolicyType]] @@ -9071,14 +6747,10 @@ namespace azure.mgmt.cognitiveservices.models def __init__( self, *, - acs: Optional[RaiAcsManifest] = ..., - acs_regos: Optional[list[RaiRegoReference]] = ..., base_policy_name: Optional[str] = ..., content_filters: Optional[list[RaiPolicyContentFilter]] = ..., custom_blocklists: Optional[list[CustomBlocklistConfig]] = ..., - custom_external_safety_providers: Optional[list[RaiPolicyCustomExternalSafetyProviderReference]] = ..., egress_policy: Optional[RaiEgressPolicyConfig] = ..., - format: Optional[Union[str, RaiPolicyFormat]] = ..., mode: Optional[Union[str, RaiPolicyMode]] = ..., safety_providers: Optional[list[SafetyProviderConfig]] = ... ) -> None: ... @@ -9092,62 +6764,6 @@ namespace azure.mgmt.cognitiveservices.models USER_MANAGED = "UserManaged" - class azure.mgmt.cognitiveservices.models.RaiRego(ProxyResource): - etag: Optional[str] - id: str - name: str - properties: Optional[RaiRegoProperties] - system_data: SystemData - tags: Optional[dict[str, str]] - type: str - - @overload - def __init__( - self, - *, - properties: Optional[RaiRegoProperties] = ..., - tags: Optional[dict[str, str]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiRegoEncoding(str, Enum, metaclass=CaseInsensitiveEnumMeta): - BASE64 = "Base64" - NONE = "None" - - - class azure.mgmt.cognitiveservices.models.RaiRegoProperties(_Model): - encoding: Optional[Union[str, RaiRegoEncoding]] - rego: str - - @overload - def __init__( - self, - *, - encoding: Optional[Union[str, RaiRegoEncoding]] = ..., - rego: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.RaiRegoReference(_Model): - rego_name: str - - @overload - def __init__( - self, - *, - rego_name: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.RaiSafetyProviderConfig(_Model): blocking: Optional[bool] safety_provider_name: Optional[str] @@ -9763,22 +7379,6 @@ namespace azure.mgmt.cognitiveservices.models STANDARD = "Standard" - class azure.mgmt.cognitiveservices.models.SshSettings(_Model): - admin_enabled: Optional[bool] - ssh_public_key: Optional[str] - - @overload - def __init__( - self, - *, - admin_enabled: Optional[bool] = ..., - ssh_public_key: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - class azure.mgmt.cognitiveservices.models.SystemData(_Model): created_at: Optional[datetime] created_by: Optional[str] @@ -9856,6 +7456,28 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... + class azure.mgmt.cognitiveservices.models.TrustedCertificateSource(_Model): + certificate_bundle_references: list[CertificateBundleReference] + resource_id: str + type: Union[str, TrustedCertificateSourceType] + + @overload + def __init__( + self, + *, + certificate_bundle_references: list[CertificateBundleReference], + resource_id: str, + type: Union[str, TrustedCertificateSourceType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.cognitiveservices.models.TrustedCertificateSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_KEY_VAULT = "AzureKeyVault" + + class azure.mgmt.cognitiveservices.models.UnitType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BYTES = "Bytes" BYTES_PER_SECOND = "BytesPerSecond" @@ -10029,123 +7651,9 @@ namespace azure.mgmt.cognitiveservices.models def __init__(self, mapping: Mapping[str, Any]) -> None: ... - class azure.mgmt.cognitiveservices.models.VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - REGULAR = "Regular" - SPOT = "Spot" - +namespace azure.mgmt.cognitiveservices.operations - class azure.mgmt.cognitiveservices.models.Workbench(ProxyResource): - etag: Optional[str] - id: str - identity: Optional[Identity] - name: str - properties: WorkbenchProperties - system_data: SystemData - type: str - - @overload - def __init__( - self, - *, - identity: Optional[Identity] = ..., - properties: WorkbenchProperties - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.WorkbenchProperties(_Model): - connectivity_endpoints: Optional[ConnectivityEndpoints] - creation_time: Optional[datetime] - dataset_id: Optional[str] - errors: Optional[list[ErrorDetail]] - gpu_count: Optional[int] - idle_time_before_shutdown: Optional[str] - image_link: str - instance_type: Optional[str] - provisioning_state: Optional[Union[str, WorkbenchProvisioningState]] - ssh_settings: Optional[SshSettings] - status: Optional[Union[str, WorkbenchStatus]] - target_cluster_id: str - web_endpoint: Optional[str] - - @overload - def __init__( - self, - *, - dataset_id: Optional[str] = ..., - gpu_count: Optional[int] = ..., - idle_time_before_shutdown: Optional[str] = ..., - image_link: str, - instance_type: Optional[str] = ..., - ssh_settings: Optional[SshSettings] = ..., - target_cluster_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.WorkbenchProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELED = "Canceled" - CREATING = "Creating" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - - - class azure.mgmt.cognitiveservices.models.WorkbenchStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CREATING = "Creating" - DELETING = "Deleting" - FAILED = "Failed" - RESTARTING = "Restarting" - RUNNING = "Running" - STARTING = "Starting" - STOPPED = "Stopped" - STOPPING = "Stopping" - UNKNOWN = "Unknown" - UPDATING = "Updating" - - - class azure.mgmt.cognitiveservices.models.WorkbenchUpdate(_Model): - identity: Optional[Identity] - properties: Optional[WorkbenchUpdateProperties] - - @overload - def __init__( - self, - *, - identity: Optional[Identity] = ..., - properties: Optional[WorkbenchUpdateProperties] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.mgmt.cognitiveservices.models.WorkbenchUpdateProperties(_Model): - gpu_count: Optional[int] - idle_time_before_shutdown: Optional[str] - instance_type: Optional[str] - target_cluster_id: Optional[str] - - @overload - def __init__( - self, - *, - gpu_count: Optional[int] = ..., - idle_time_before_shutdown: Optional[str] = ..., - instance_type: Optional[str] = ..., - target_cluster_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - -namespace azure.mgmt.cognitiveservices.operations - - class azure.mgmt.cognitiveservices.operations.AccountCapabilityHostsOperations: + class azure.mgmt.cognitiveservices.operations.AccountCapabilityHostsOperations: def __init__( self, @@ -10409,39 +7917,6 @@ namespace azure.mgmt.cognitiveservices.operations **kwargs: Any ) -> LROPoller[Account]: ... - @overload - def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: EvaluateDeploymentPoliciesRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluateDeploymentPoliciesResponse: ... - - @overload - def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: EvaluateDeploymentPoliciesRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluateDeploymentPoliciesResponse: ... - - @overload - def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> EvaluateDeploymentPoliciesResponse: ... - @distributed_trace def get( self, @@ -10528,89 +8003,6 @@ namespace azure.mgmt.cognitiveservices.operations ) -> ApiKeys: ... - class azure.mgmt.cognitiveservices.operations.AdapterDeploymentsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: AdapterDeployment, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> LROPoller[AdapterDeployment]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: AdapterDeployment, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> LROPoller[AdapterDeployment]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> LROPoller[AdapterDeployment]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'adapter_deployment_name', 'etag', 'match_condition']}, api_versions_list=['2026-09-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'adapter_deployment_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - **kwargs: Any - ) -> AdapterDeployment: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[AdapterDeployment]: ... - - class azure.mgmt.cognitiveservices.operations.AgentApplicationsOperations: def __init__( @@ -10837,116 +8229,6 @@ namespace azure.mgmt.cognitiveservices.operations ) -> None: ... - class azure.mgmt.cognitiveservices.operations.ArcDeploymentsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: ArcDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ArcDeployment]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: ArcDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ArcDeployment]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ArcDeployment]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-07-15-preview', params_added_on={'2026-07-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'deployment_name']}, api_versions_list=['2026-07-15-preview', '2026-09-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: ArcDeploymentUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ArcDeployment]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: ArcDeploymentUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ArcDeployment]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ArcDeployment]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-07-15-preview', params_added_on={'2026-07-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'deployment_name', 'accept']}, api_versions_list=['2026-07-15-preview', '2026-09-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - **kwargs: Any - ) -> ArcDeployment: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-07-15-preview', params_added_on={'2026-07-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2026-07-15-preview', '2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[ArcDeployment]: ... - - class azure.mgmt.cognitiveservices.operations.CommitmentPlansOperations: def __init__( @@ -11100,339 +8382,92 @@ namespace azure.mgmt.cognitiveservices.operations self, resource_group_name: str, account_name: str, - commitment_plan_name: str, - commitment_plan: CommitmentPlan, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CommitmentPlan: ... - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - commitment_plan_name: str, - commitment_plan: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> CommitmentPlan: ... - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - commitment_plan_name: str, - **kwargs: Any - ) -> CommitmentPlan: ... - - @distributed_trace - def get_association( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan_association_name: str, - **kwargs: Any - ) -> CommitmentPlanAccountAssociation: ... - - @distributed_trace - def get_plan( - self, - resource_group_name: str, - commitment_plan_name: str, - **kwargs: Any - ) -> CommitmentPlan: ... - - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[CommitmentPlan]: ... - - @distributed_trace - def list_associations( - self, - resource_group_name: str, - commitment_plan_name: str, - **kwargs: Any - ) -> ItemPaged[CommitmentPlanAccountAssociation]: ... - - @distributed_trace - def list_plans_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> ItemPaged[CommitmentPlan]: ... - - @distributed_trace - def list_plans_by_subscription(self, **kwargs: Any) -> ItemPaged[CommitmentPlan]: ... - - - class azure.mgmt.cognitiveservices.operations.CommitmentTiersOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> ItemPaged[CommitmentTier]: ... - - - class azure.mgmt.cognitiveservices.operations.ComputeOperationsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-01-15-preview', params_added_on={'2026-01-15-preview': ['api_version', 'subscription_id', 'location', 'operation_id', 'accept']}, api_versions_list=['2026-01-15-preview', '2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def get( - self, - location: str, - operation_id: str, - **kwargs: Any - ) -> ComputeOperationStatus: ... - - - class azure.mgmt.cognitiveservices.operations.ComputesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: Compute, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Compute]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: Compute, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Compute]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Compute]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'compute_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'compute_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def begin_restart( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'compute_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def begin_start( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'compute_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def begin_stop( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'compute_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - **kwargs: Any - ) -> Compute: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[Compute]: ... - - - class azure.mgmt.cognitiveservices.operations.CostControlsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: CostControl, + commitment_plan_name: str, + commitment_plan: CommitmentPlan, *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> CostControl: ... + ) -> CommitmentPlan: ... @overload def create_or_update( self, resource_group_name: str, account_name: str, - cost_control_name: str, - resource: CostControl, + commitment_plan_name: str, + commitment_plan: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> CostControl: ... + ) -> CommitmentPlan: ... - @overload - def create_or_update( + @distributed_trace + def get( self, resource_group_name: str, account_name: str, - cost_control_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + commitment_plan_name: str, **kwargs: Any - ) -> CostControl: ... + ) -> CommitmentPlan: ... @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'cost_control_name', 'etag', 'match_condition']}, api_versions_list=['2026-09-15-preview']) - def delete( + def get_association( self, resource_group_name: str, - account_name: str, - cost_control_name: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + commitment_plan_name: str, + commitment_plan_association_name: str, **kwargs: Any - ) -> None: ... + ) -> CommitmentPlanAccountAssociation: ... @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'cost_control_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - def get( + def get_plan( self, resource_group_name: str, - account_name: str, - cost_control_name: str, + commitment_plan_name: str, **kwargs: Any - ) -> CostControl: ... + ) -> CommitmentPlan: ... @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2026-09-15-preview']) def list( self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged[CostControl]: ... + ) -> ItemPaged[CommitmentPlan]: ... - @overload - def update( + @distributed_trace + def list_associations( self, resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: CostControlPatch, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + commitment_plan_name: str, **kwargs: Any - ) -> CostControl: ... + ) -> ItemPaged[CommitmentPlanAccountAssociation]: ... - @overload - def update( + @distributed_trace + def list_plans_by_resource_group( self, resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: CostControlPatch, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> CostControl: ... + ) -> ItemPaged[CommitmentPlan]: ... - @overload - def update( + @distributed_trace + def list_plans_by_subscription(self, **kwargs: Any) -> ItemPaged[CommitmentPlan]: ... + + + class azure.mgmt.cognitiveservices.operations.CommitmentTiersOperations: + + def __init__( self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list( + self, + location: str, **kwargs: Any - ) -> CostControl: ... + ) -> ItemPaged[CommitmentTier]: ... class azure.mgmt.cognitiveservices.operations.DefenderForAISettingsOperations: @@ -11797,144 +8832,18 @@ namespace azure.mgmt.cognitiveservices.operations ) -> None: ... @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'offer', 'accelerator_type', 'deployment_id', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) + @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'offer', 'accelerator_type', 'deployment_id', 'accept'], '2026-11-01': ['location']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview', '2026-11-01']) def list( self, *, accelerator_type: Optional[str] = ..., deployment_id: Optional[str] = ..., + location: Optional[str] = ..., offer: str, **kwargs: Any ) -> ItemPaged[ManagedComputeCapacity]: ... - class azure.mgmt.cognitiveservices.operations.ManagedComputeDeploymentsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: ManagedComputeDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ManagedComputeDeployment]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: ManagedComputeDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ManagedComputeDeployment]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ManagedComputeDeployment]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'deployment_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: PatchResourceSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ManagedComputeDeployment]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: PatchResourceSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ManagedComputeDeployment]: ... - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[ManagedComputeDeployment]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'deployment_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - **kwargs: Any - ) -> ManagedComputeDeployment: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - **kwargs: Any - ) -> ItemPaged[ManagedComputeDeployment]: ... - - - class azure.mgmt.cognitiveservices.operations.ManagedComputeUsagesOperationGroupOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'location', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def list( - self, - location: str, - **kwargs: Any - ) -> ItemPaged[ManagedComputeUsage]: ... - - class azure.mgmt.cognitiveservices.operations.ManagedNetworkProvisionsOperations: def __init__( @@ -11989,7 +8898,7 @@ namespace azure.mgmt.cognitiveservices.operations ) -> None: ... @distributed_trace - @api_version_validation(method_added_on='2026-01-15-preview', params_added_on={'2026-01-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'managed_network_name']}, api_versions_list=['2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-05-01', '2026-05-15-preview', '2026-07-01', '2026-07-15-preview', '2026-09-01', '2026-09-15-preview']) + @api_version_validation(method_added_on='2026-01-15-preview', params_added_on={'2026-01-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'managed_network_name']}, api_versions_list=['2026-01-15-preview', '2026-03-01', '2026-03-15-preview', '2026-05-01', '2026-05-15-preview', '2026-07-01', '2026-07-15-preview', '2026-09-01', '2026-09-15-preview', '2026-11-01']) def begin_delete( self, resource_group_name: str, @@ -12695,157 +9604,72 @@ namespace azure.mgmt.cognitiveservices.operations @overload def create_or_update( self, - default: str, - tier: QuotaTier, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> QuotaTier: ... - - @overload - def create_or_update( - self, - default: str, - tier: QuotaTier, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> QuotaTier: ... - - @overload - def create_or_update( - self, - default: str, - tier: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> QuotaTier: ... - - @distributed_trace - def get( - self, - default: str, - **kwargs: Any - ) -> QuotaTier: ... - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> ItemPaged[QuotaTier]: ... - - @overload - def update( - self, - default: str, - tier: QuotaTier, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> QuotaTier: ... - - @overload - def update( - self, - default: str, - tier: QuotaTier, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> QuotaTier: ... - - @overload - def update( - self, - default: str, - tier: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> QuotaTier: ... - - - class azure.mgmt.cognitiveservices.operations.RaiBindingsOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: RaiBinding, + default: str, + tier: QuotaTier, *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> RaiBinding: ... + ) -> QuotaTier: ... @overload def create_or_update( self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: RaiBinding, + default: str, + tier: QuotaTier, *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> RaiBinding: ... + ) -> QuotaTier: ... @overload def create_or_update( self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: IO[bytes], + default: str, + tier: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> RaiBinding: ... + ) -> QuotaTier: ... @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_binding_name', 'etag', 'match_condition']}, api_versions_list=['2026-09-15-preview']) - def delete( + def get( self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + default: str, **kwargs: Any - ) -> None: ... + ) -> QuotaTier: ... @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_binding_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - def get( + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[QuotaTier]: ... + + @overload + def update( self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, + default: str, + tier: QuotaTier, + *, + content_type: str = "application/json", **kwargs: Any - ) -> RaiBinding: ... + ) -> QuotaTier: ... - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'top', 'accept']}, api_versions_list=['2026-09-15-preview']) - def list( + @overload + def update( self, - resource_group_name: str, - account_name: str, + default: str, + tier: QuotaTier, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> QuotaTier: ... + + @overload + def update( + self, + default: str, + tier: IO[bytes], *, - top: Optional[int] = ..., + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged[RaiBinding]: ... + ) -> QuotaTier: ... class azure.mgmt.cognitiveservices.operations.RaiBlocklistItemsOperations: @@ -13154,15 +9978,12 @@ namespace azure.mgmt.cognitiveservices.operations ) -> None: ... @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_policy_name', 'etag', 'match_condition']}, api_versions_list=['2026-09-15-preview']) + @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_policy_name']}, api_versions_list=['2026-09-15-preview', '2026-11-01']) def begin_delete( self, resource_group_name: str, account_name: str, rai_policy_name: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any ) -> LROPoller[None]: ... @@ -13175,8 +9996,6 @@ namespace azure.mgmt.cognitiveservices.operations rai_policy: RaiPolicy, *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any ) -> RaiPolicy: ... @@ -13189,8 +10008,6 @@ namespace azure.mgmt.cognitiveservices.operations rai_policy: RaiPolicy, *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any ) -> RaiPolicy: ... @@ -13203,13 +10020,11 @@ namespace azure.mgmt.cognitiveservices.operations rai_policy: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., **kwargs: Any ) -> RaiPolicy: ... @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_policy_name', 'accept']}, api_versions_list=['2026-09-15-preview']) + @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_policy_name', 'accept']}, api_versions_list=['2026-09-15-preview', '2026-11-01']) def get( self, resource_group_name: str, @@ -13227,91 +10042,6 @@ namespace azure.mgmt.cognitiveservices.operations ) -> ItemPaged[RaiPolicy]: ... - class azure.mgmt.cognitiveservices.operations.RaiRegosOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - rai_rego: RaiRego, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> RaiRego: ... - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - rai_rego: RaiRego, - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> RaiRego: ... - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - rai_rego: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> RaiRego: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_rego_name', 'etag', 'match_condition']}, api_versions_list=['2026-09-15-preview']) - def delete( - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> None: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'rai_rego_name', 'accept']}, api_versions_list=['2026-09-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - **kwargs: Any - ) -> RaiRego: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-09-15-preview', params_added_on={'2026-09-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'top', 'accept']}, api_versions_list=['2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - *, - top: Optional[int] = ..., - **kwargs: Any - ) -> ItemPaged[RaiRego]: ... - - class azure.mgmt.cognitiveservices.operations.RaiToolLabelsOperations: def __init__( @@ -13582,158 +10312,6 @@ namespace azure.mgmt.cognitiveservices.operations ) -> ItemPaged[Usage]: ... - class azure.mgmt.cognitiveservices.operations.WorkbenchesOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: Workbench, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Workbench]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: Workbench, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Workbench]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[Workbench]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'workbench_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def begin_delete( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'workbench_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def begin_restart( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'workbench_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def begin_start( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'workbench_name']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def begin_stop( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - **kwargs: Any - ) -> LROPoller[None]: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'workbench_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def get( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - **kwargs: Any - ) -> Workbench: ... - - @distributed_trace - @api_version_validation(method_added_on='2026-03-15-preview', params_added_on={'2026-03-15-preview': ['api_version', 'subscription_id', 'resource_group_name', 'account_name', 'project_name', 'accept']}, api_versions_list=['2026-03-15-preview', '2026-05-15-preview', '2026-07-15-preview', '2026-09-15-preview']) - def list( - self, - resource_group_name: str, - account_name: str, - project_name: str, - **kwargs: Any - ) -> ItemPaged[Workbench]: ... - - @overload - def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: WorkbenchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Workbench: ... - - @overload - def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: WorkbenchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Workbench: ... - - @overload - def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Workbench: ... - - namespace azure.mgmt.cognitiveservices.types class azure.mgmt.cognitiveservices.types.AADAuthTypeConnectionProperties(TypedDict, total=False): @@ -13861,8 +10439,6 @@ namespace azure.mgmt.cognitiveservices.types key "amlWorkspace": ForwardRef('UserOwnedAmlWorkspace', module='types') key "apiProperties": ForwardRef('ApiProperties', module='types') key "callRateLimit": ForwardRef('CallRateLimit', module='types') - key "capabilitySettings": ForwardRef('CapabilitySettings', module='types') - key "costControlConnections": Optional[CostControlConnections] key "customSubDomainName": str key "dateCreated": str key "defaultProject": str @@ -13871,7 +10447,6 @@ namespace azure.mgmt.cognitiveservices.types key "dynamicThrottlingEnabled": bool key "encryption": ForwardRef('Encryption', module='types') key "endpoint": str - key "foundryAutoUpgrade": ForwardRef('FoundryAutoUpgrade', module='types') key "internalId": str key "isMigrated": bool key "locations": ForwardRef('MultiRegionSettings', module='types') @@ -13886,9 +10461,9 @@ namespace azure.mgmt.cognitiveservices.types key "scheduledPurgeDate": str key "skuChangeInfo": ForwardRef('SkuChangeInfo', module='types') key "storedCompletionsDisabled": bool + key "trustedCertificateSources": Optional[list[TrustedCertificateSource]] a365LoggingEnabled: bool abusePenalty: AbusePenalty - agentHostingConfigurations: list[AgentHostingConfiguration] allowProjectManagement: bool allowedFqdnList: list[str] amlWorkspace: UserOwnedAmlWorkspace @@ -13896,10 +10471,7 @@ namespace azure.mgmt.cognitiveservices.types associatedProjects: list[str] callRateLimit: CallRateLimit capabilities: list[SkuCapability] - capabilitySettings: CapabilitySettings commitmentPlanAssociations: list[CommitmentPlanAssociation] - costControlConnections: CostControlConnections - costControlIds: list[str] customSubDomainName: str dateCreated: str defaultProject: str @@ -13909,7 +10481,6 @@ namespace azure.mgmt.cognitiveservices.types encryption: Encryption endpoint: str endpoints: dict[str, str] - foundryAutoUpgrade: FoundryAutoUpgrade internalId: str isMigrated: bool locations: MultiRegionSettings @@ -13926,50 +10497,10 @@ namespace azure.mgmt.cognitiveservices.types scheduledPurgeDate: str skuChangeInfo: SkuChangeInfo storedCompletionsDisabled: bool + trustedCertificateSources: list[TrustedCertificateSource] userOwnedStorage: list[UserOwnedStorage] - class azure.mgmt.cognitiveservices.types.AdapterDeployment(ProxyResource): - key "etag": str - key "id": str - key "name": str - key "properties": ForwardRef('AdapterDeploymentProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - name: str - properties: AdapterDeploymentProperties - systemData: SystemData - type: str - - - class azure.mgmt.cognitiveservices.types.AdapterDeploymentLastOperation(TypedDict, total=False): - key "completedAt": str - key "requestedTargetDeploymentName": str - key "startedAt": Required[str] - key "status": Required[Union[str, AdapterDeploymentOperationState]] - key "type": Required[Union[str, AdapterDeploymentOperationType]] - completedAt: str - requestedTargetDeploymentName: str - startedAt: str - status: Union[str, AdapterDeploymentOperationState] - type: Union[str, AdapterDeploymentOperationType] - - - class azure.mgmt.cognitiveservices.types.AdapterDeploymentProperties(TypedDict, total=False): - key "activeTargetDeploymentName": str - key "lastOperation": ForwardRef('AdapterDeploymentLastOperation', module='types') - key "provisioningState": Union[str, ProvisioningState] - key "sourceModelId": Required[str] - key "targetDeploymentName": Required[str] - activeTargetDeploymentName: str - lastOperation: AdapterDeploymentLastOperation - provisioningState: Union[str, ProvisioningState] - sourceModelId: str - targetDeploymentName: str - - class azure.mgmt.cognitiveservices.types.AgentApplication(ProxyResource): key "id": str key "name": str @@ -13999,26 +10530,7 @@ namespace azure.mgmt.cognitiveservices.types class azure.mgmt.cognitiveservices.types.AgentDeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CUSTOM = "Custom" HOSTED = "Hosted" - MANAGED = "Managed" - - - class azure.mgmt.cognitiveservices.types.AgentHostingConfiguration(TypedDict, total=False): - key "clusterResourceId": Required[str] - key "hostingManagementIdentityResourceId": Required[str] - key "hostingType": Required[Literal[AgentHostingType.MANAGED_CLUSTER]] - key "name": Required[str] - key "storageAccountResourceId": Required[str] - key "workloadIdentityResourceId": Required[str] - clusterResourceId: str - hostingManagementIdentityResourceId: str - hostingType: Literal[AgentHostingType.MANAGED_CLUSTER] - name: str - storageAccountResourceId: str - workloadIdentityResourceId: str - - - class azure.mgmt.cognitiveservices.types.AgentHostingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - MANAGED_CLUSTER = "ManagedCluster" + MANAGED = "Managed" class azure.mgmt.cognitiveservices.types.AgentProtocolVersion(TypedDict, total=False): @@ -14119,134 +10631,6 @@ namespace azure.mgmt.cognitiveservices.types rules: list[TrafficRoutingRule] - class azure.mgmt.cognitiveservices.types.ArcDeployment(ProxyResource): - key "etag": str - key "id": str - key "name": str - key "properties": Required[ArcDeploymentProperties] - key "sku": Required[ArcDeploymentSku] - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - name: str - properties: ArcDeploymentProperties - sku: ArcDeploymentSku - systemData: SystemData - type: str - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentCpuMemoryResourceRequirements(TypedDict, total=False): - key "cpu": Required[str] - key "memory": Required[str] - cpu: str - memory: str - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentKubernetesResources(TypedDict, total=False): - key "limits": ForwardRef('ArcDeploymentResourceRequirements', module='types') - key "requests": ForwardRef('ArcDeploymentCpuMemoryResourceRequirements', module='types') - limits: ArcDeploymentResourceRequirements - requests: ArcDeploymentCpuMemoryResourceRequirements - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentModel(TypedDict, total=False): - key "format": Required[str] - key "name": Required[str] - format: str - name: str - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentPatchCpuMemoryResourceRequirements(TypedDict, total=False): - key "cpu": str - key "memory": str - cpu: str - memory: str - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentPatchKubernetesResources(TypedDict, total=False): - key "limits": ForwardRef('ArcDeploymentResourceRequirements', module='types') - key "requests": ForwardRef('ArcDeploymentPatchCpuMemoryResourceRequirements', module='types') - limits: ArcDeploymentResourceRequirements - requests: ArcDeploymentPatchCpuMemoryResourceRequirements - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentProperties(TypedDict, total=False): - key "compute": Required[Union[str, ArcDeploymentComputeType]] - key "deploymentState": Union[str, DeploymentState] - key "deploymentTemplate": str - key "extensionId": Required[str] - key "inferenceEndpoint": str - key "model": Required[ArcDeploymentModel] - key "provisioningDetails": ForwardRef('ArcDeploymentProvisioningDetails', module='types') - key "provisioningState": Union[str, ProvisioningState] - key "raiPolicyName": str - key "replicas": Required[int] - key "resources": Required[ArcDeploymentKubernetesResources] - key "runtime": Required[Union[str, ArcDeploymentRuntime]] - key "vllmParameters": ForwardRef('ArcDeploymentVllmParameters', module='types') - capabilities: dict[str, str] - compute: Union[str, ArcDeploymentComputeType] - deploymentState: Union[str, DeploymentState] - deploymentTemplate: str - extensionId: str - inferenceEndpoint: str - model: ArcDeploymentModel - nodeSelector: dict[str, str] - provisioningDetails: ArcDeploymentProvisioningDetails - provisioningState: Union[str, ProvisioningState] - raiPolicyName: str - replicas: int - resources: ArcDeploymentKubernetesResources - runtime: Union[str, ArcDeploymentRuntime] - vllmParameters: ArcDeploymentVllmParameters - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentProvisioningDetails(TypedDict, total=False): - key "lastOperationTimestamp": str - key "message": str - lastOperationTimestamp: str - message: str - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentResourceRequirements(TypedDict, total=False): - key "cpu": str - key "gpu": int - key "memory": str - cpu: str - gpu: int - memory: str - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentSku(TypedDict, total=False): - key "name": Required[Union[str, ArcDeploymentSkuName]] - name: Union[str, ArcDeploymentSkuName] - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentUpdate(TypedDict, total=False): - key "properties": ForwardRef('ArcDeploymentUpdateProperties', module='types') - properties: ArcDeploymentUpdateProperties - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentUpdateProperties(TypedDict, total=False): - key "replicas": int - key "resources": ForwardRef('ArcDeploymentPatchKubernetesResources', module='types') - nodeSelector: dict[str, str] - replicas: int - resources: ArcDeploymentPatchKubernetesResources - - - class azure.mgmt.cognitiveservices.types.ArcDeploymentVllmParameters(TypedDict, total=False): - key "enforceEager": bool - key "gpuMemoryUtilization": float - key "maxModelLen": int - key "tensorParallelSize": int - enforceEager: bool - gpuMemoryUtilization: float - maxModelLen: int - tensorParallelSize: int - - class azure.mgmt.cognitiveservices.types.AssignedIdentity(TypedDict, total=False): key "clientId": Required[str] key "kind": Required[Union[str, IdentityKind]] @@ -14323,13 +10707,11 @@ namespace azure.mgmt.cognitiveservices.types vectorStoreConnections: list[str] - class azure.mgmt.cognitiveservices.types.CapabilitySettings(TypedDict, total=False): - key "blobStore": str - key "documentStore": str - key "vectorStore": str - blobStore: str - documentStore: str - vectorStore: str + class azure.mgmt.cognitiveservices.types.CertificateBundleReference(TypedDict, total=False): + key "secretName": Required[str] + key "secretVersion": Required[str] + secretName: str + secretVersion: str class azure.mgmt.cognitiveservices.types.ChannelsBuiltInAuthorizationPolicy(TypedDict, total=False): @@ -14355,22 +10737,6 @@ namespace azure.mgmt.cognitiveservices.types type: str - class azure.mgmt.cognitiveservices.types.ClusterComputeProperties(TypedDict, total=False): - key "computeType": Required[Literal[ComputeType.CLUSTER]] - key "creationTime": str - key "location": Required[str] - key "pools": Required[list[Pool]] - key "provisioningState": Union[str, ComputeProvisioningState] - key "subnetArmId": str - computeType: Literal[ComputeType.CLUSTER] - creationTime: str - errors: list[ErrorDetail] - location: str - pools: list[Pool] - provisioningState: Union[str, ComputeProvisioningState] - subnetArmId: str - - class azure.mgmt.cognitiveservices.types.CommitmentPeriod(TypedDict, total=False): key "count": int key "endDate": str @@ -14461,30 +10827,6 @@ namespace azure.mgmt.cognitiveservices.types unit: str - class azure.mgmt.cognitiveservices.types.Compute(ProxyResource): - key "etag": str - key "id": str - key "identity": ForwardRef('Identity', module='types') - key "kind": str - key "name": str - key "properties": Required[ComputeProperties] - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - identity: Identity - kind: str - name: str - properties: ComputeProperties - systemData: SystemData - type: str - - - class azure.mgmt.cognitiveservices.types.ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CLUSTER = "Cluster" - CONTAINER_INSTANCE = "ContainerInstance" - - class azure.mgmt.cognitiveservices.types.ConnectionAccessKey(TypedDict, total=False): key "accessKeyId": str key "secretAccessKey": str @@ -14596,117 +10938,6 @@ namespace azure.mgmt.cognitiveservices.types username: str - class azure.mgmt.cognitiveservices.types.ConnectivityEndpoints(TypedDict, total=False): - key "publicIpAddress": str - key "sshPort": int - publicIpAddress: str - sshPort: int - - - class azure.mgmt.cognitiveservices.types.ContainerInstanceComputeProperties(TypedDict, total=False): - key "computeType": Required[Literal[ComputeType.CONTAINER_INSTANCE]] - key "connectivityEndpoints": ForwardRef('ConnectivityEndpoints', module='types') - key "creationTime": str - key "idleTimeBeforeShutdown": str - key "imageLink": Required[str] - key "location": Required[str] - key "provisioningState": Union[str, ComputeProvisioningState] - key "sshSettings": ForwardRef('SshSettings', module='types') - key "targetClusterId": Required[str] - computeType: Literal[ComputeType.CONTAINER_INSTANCE] - connectivityEndpoints: ConnectivityEndpoints - creationTime: str - errors: list[ErrorDetail] - idleTimeBeforeShutdown: str - imageLink: str - location: str - provisioningState: Union[str, ComputeProvisioningState] - sshSettings: SshSettings - targetClusterId: str - - - class azure.mgmt.cognitiveservices.types.CostControl(ProxyResource): - key "etag": str - key "id": str - key "name": str - key "properties": ForwardRef('CostControlProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - name: str - properties: CostControlProperties - systemData: SystemData - type: str - - - class azure.mgmt.cognitiveservices.types.CostControlConnections(TypedDict, total=False): - key "appInsightsConnectionId": Optional[str] - key "eventGridConnectionId": Optional[str] - appInsightsConnectionId: str - eventGridConnectionId: str - - - class azure.mgmt.cognitiveservices.types.CostControlDimension(TypedDict, total=False): - key "attribute": str - key "type": Required[Union[str, CostControlDimensionType]] - attribute: str - type: Union[str, CostControlDimensionType] - - - class azure.mgmt.cognitiveservices.types.CostControlMatch(TypedDict, total=False): - agentResourceIds: list[str] - identityObjectIds: list[str] - projectIds: list[str] - sessionIds: list[str] - - - class azure.mgmt.cognitiveservices.types.CostControlPatch(TypedDict, total=False): - key "properties": ForwardRef('CostControlPatchProperties', module='types') - properties: CostControlPatchProperties - - - class azure.mgmt.cognitiveservices.types.CostControlPatchProperties(TypedDict, total=False): - key "displayName": Optional[str] - displayName: str - rules: list[CostControlRule] - - - class azure.mgmt.cognitiveservices.types.CostControlProperties(TypedDict, total=False): - key "displayName": str - key "rules": Required[list[CostControlRule]] - displayName: str - rules: list[CostControlRule] - - - class azure.mgmt.cognitiveservices.types.CostControlRule(TypedDict, total=False): - key "amount": Required[float] - key "counterKey": Required[CostControlDimension] - key "match": ForwardRef('CostControlMatch', module='types') - key "name": Required[str] - key "period": Union[str, CostControlPeriod] - key "recurring": bool - key "thresholds": Optional[list[CostControlThreshold]] - key "unit": Required[Union[str, CostControlUnit]] - amount: float - counterKey: CostControlDimension - match: CostControlMatch - name: str - period: Union[str, CostControlPeriod] - recurring: bool - thresholds: list[CostControlThreshold] - unit: Union[str, CostControlUnit] - - - class azure.mgmt.cognitiveservices.types.CostControlThreshold(TypedDict, total=False): - key "action": Required[Union[str, CostControlThresholdAction]] - key "type": Required[Union[str, CostControlThresholdType]] - key "value": Required[float] - action: Union[str, CostControlThresholdAction] - type: Union[str, CostControlThresholdType] - value: float - - class azure.mgmt.cognitiveservices.types.CustomBlocklistConfig(RaiBlocklistConfig): key "blocking": bool key "blocklistName": str @@ -14826,14 +11057,12 @@ namespace azure.mgmt.cognitiveservices.types key "routing": ForwardRef('DeploymentRouting', module='types') key "scaleSettings": ForwardRef('DeploymentScaleSettings', module='types') key "serviceTier": Optional[Union[str, ServiceTier]] - key "speculativeDecoding": ForwardRef('DeploymentSpeculativeDecoding', module='types') key "spilloverDeploymentName": str key "versionUpgradeOption": Union[str, DeploymentModelVersionUpgradeOption] callRateLimit: CallRateLimit capabilities: dict[str, str] capacitySettings: DeploymentCapacitySettings contextCacheContainerId: str - costControlIds: list[str] currentCapacity: int deploymentState: Union[str, DeploymentState] dynamicThrottlingEnabled: bool @@ -14845,7 +11074,6 @@ namespace azure.mgmt.cognitiveservices.types routing: DeploymentRouting scaleSettings: DeploymentScaleSettings serviceTier: Union[str, ServiceTier] - speculativeDecoding: DeploymentSpeculativeDecoding spilloverDeploymentName: str versionUpgradeOption: Union[str, DeploymentModelVersionUpgradeOption] @@ -14865,13 +11093,6 @@ namespace azure.mgmt.cognitiveservices.types scaleType: Union[str, DeploymentScaleType] - class azure.mgmt.cognitiveservices.types.DeploymentSpeculativeDecoding(TypedDict, total=False): - key "draftModel": Required[DeploymentModel] - key "draftTokenCount": int - draftModel: DeploymentModel - draftTokenCount: int - - class azure.mgmt.cognitiveservices.types.Encryption(TypedDict, total=False): key "keySource": Union[str, KeySource] key "keyVaultProperties": ForwardRef('KeyVaultProperties', module='types') @@ -14906,54 +11127,6 @@ namespace azure.mgmt.cognitiveservices.types state: Union[str, EncryptionScopeState] - class azure.mgmt.cognitiveservices.types.ErrorAdditionalInfo(TypedDict, total=False): - key "info": Any - key "type": str - info: Any - type: str - - - class azure.mgmt.cognitiveservices.types.ErrorDetail(TypedDict, total=False): - key "code": str - key "message": str - key "target": str - additionalInfo: list[ErrorAdditionalInfo] - code: str - details: list[ErrorDetail] - message: str - target: str - - - class azure.mgmt.cognitiveservices.types.EvaluateDeploymentPoliciesDeployment(TypedDict, total=False): - key "name": Required[str] - key "properties": Required[EvaluateDeploymentPoliciesDeploymentProperties] - name: str - properties: EvaluateDeploymentPoliciesDeploymentProperties - - - class azure.mgmt.cognitiveservices.types.EvaluateDeploymentPoliciesDeploymentProperties(TypedDict, total=False): - key "model": Required[DeploymentModel] - key "raiPolicyName": str - model: DeploymentModel - raiPolicyName: str - - - class azure.mgmt.cognitiveservices.types.EvaluateDeploymentPoliciesRequest(TypedDict, total=False): - key "deployments": Required[list[EvaluateDeploymentPoliciesDeployment]] - deployments: list[EvaluateDeploymentPoliciesDeployment] - - - class azure.mgmt.cognitiveservices.types.FoundryAutoUpgrade(TypedDict, total=False): - key "mode": Union[str, FoundryAutoUpgradeMode] - key "plannedByMicrosoft": bool - key "scheduledAt": str - key "statusReason": str - mode: Union[str, FoundryAutoUpgradeMode] - plannedByMicrosoft: bool - scheduledAt: str - statusReason: str - - class azure.mgmt.cognitiveservices.types.FqdnOutboundRule(TypedDict, total=False): key "category": Union[str, RuleCategory] key "destination": str @@ -14968,11 +11141,6 @@ namespace azure.mgmt.cognitiveservices.types type: Literal[RuleType.FQDN] - class azure.mgmt.cognitiveservices.types.GatedModelAccessProperties(TypedDict, total=False): - key "connectionId": Required[str] - connectionId: str - - class azure.mgmt.cognitiveservices.types.HostedAgentDeployment(TypedDict, total=False): key "agents": Optional[list[VersionedAgentReference]] key "deploymentId": Optional[str] @@ -15045,82 +11213,6 @@ namespace azure.mgmt.cognitiveservices.types tags: dict[str, str] - class azure.mgmt.cognitiveservices.types.ManagedClusterAgentHostingConfiguration(TypedDict, total=False): - key "clusterResourceId": Required[str] - key "hostingManagementIdentityResourceId": Required[str] - key "hostingType": Required[Literal[AgentHostingType.MANAGED_CLUSTER]] - key "name": Required[str] - key "storageAccountResourceId": Required[str] - key "workloadIdentityResourceId": Required[str] - clusterResourceId: str - hostingManagementIdentityResourceId: str - hostingType: Literal[AgentHostingType.MANAGED_CLUSTER] - name: str - storageAccountResourceId: str - workloadIdentityResourceId: str - - - class azure.mgmt.cognitiveservices.types.ManagedComputeDeployment(ProxyResource): - key "etag": str - key "id": str - key "name": str - key "properties": ForwardRef('ManagedComputeDeploymentProperties', module='types') - key "sku": ForwardRef('Sku', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - name: str - properties: ManagedComputeDeploymentProperties - sku: Sku - systemData: SystemData - type: str - - - class azure.mgmt.cognitiveservices.types.ManagedComputeDeploymentProperties(TypedDict, total=False): - key "acceleratorType": str - key "acceleratorsPerInstance": int - key "computeId": str - key "deploymentTemplate": str - key "gatedModelAccess": ForwardRef('GatedModelAccessProperties', module='types') - key "model": Required[str] - key "priority": str - key "provisioningDetails": ForwardRef('ManagedComputeDeploymentProvisioningDetails', module='types') - key "provisioningState": Union[str, ProvisioningState] - key "routes": ForwardRef('ManagedComputeDeploymentRoutes', module='types') - key "totalAccelerators": int - key "versionUpgradeOption": Union[str, DeploymentModelVersionUpgradeOption] - acceleratorType: str - acceleratorsPerInstance: int - capabilities: dict[str, str] - computeId: str - deploymentTemplate: str - gatedModelAccess: GatedModelAccessProperties - model: str - priority: str - provisioningDetails: ManagedComputeDeploymentProvisioningDetails - provisioningState: Union[str, ProvisioningState] - routes: ManagedComputeDeploymentRoutes - totalAccelerators: int - versionUpgradeOption: Union[str, DeploymentModelVersionUpgradeOption] - - - class azure.mgmt.cognitiveservices.types.ManagedComputeDeploymentProvisioningDetails(TypedDict, total=False): - key "lastOperationTimestamp": str - key "message": str - lastOperationTimestamp: str - message: str - - - class azure.mgmt.cognitiveservices.types.ManagedComputeDeploymentRoutes(TypedDict, total=False): - key "chatCompletionsScoringPath": str - key "messagesApiScoringPath": str - key "swagger": str - chatCompletionsScoringPath: str - messagesApiScoringPath: str - swagger: str - - class azure.mgmt.cognitiveservices.types.ManagedIdentityAuthTypeConnectionProperties(TypedDict, total=False): key "authType": Required[Literal[ConnectionAuthType.MANAGED_IDENTITY]] key "category": Union[str, ConnectionCategory] @@ -15371,11 +11463,6 @@ namespace azure.mgmt.cognitiveservices.types useWorkspaceManagedIdentity: bool - class azure.mgmt.cognitiveservices.types.PatchResourceSku(TypedDict, total=False): - key "sku": ForwardRef('Sku', module='types') - sku: Sku - - class azure.mgmt.cognitiveservices.types.PatchResourceTags(TypedDict, total=False): tags: dict[str, str] @@ -15386,17 +11473,6 @@ namespace azure.mgmt.cognitiveservices.types tags: dict[str, str] - class azure.mgmt.cognitiveservices.types.Pool(TypedDict, total=False): - key "instanceType": Required[str] - key "name": Required[str] - key "nodeCount": Required[int] - key "vmPriority": Union[str, VmPriority] - instanceType: str - name: str - nodeCount: int - vmPriority: Union[str, VmPriority] - - class azure.mgmt.cognitiveservices.types.PrivateEndpoint(TypedDict, total=False): key "id": str id: str @@ -15507,12 +11583,10 @@ namespace azure.mgmt.cognitiveservices.types class azure.mgmt.cognitiveservices.types.ProjectProperties(TypedDict, total=False): - key "capabilitySettings": ForwardRef('CapabilitySettings', module='types') key "description": str key "displayName": str key "isDefault": bool key "provisioningState": Union[str, ProvisioningState] - capabilitySettings: CapabilitySettings description: str displayName: str endpoints: dict[str, str] @@ -15574,122 +11648,6 @@ namespace azure.mgmt.cognitiveservices.types upgradeUnavailabilityReason: str - class azure.mgmt.cognitiveservices.types.RaiAcsEmptyObject(TypedDict, total=False): - - - class azure.mgmt.cognitiveservices.types.RaiAcsHarmConfiguration(TypedDict, total=False): - key "category": Required[Union[str, RaiAcsHarmCategory]] - key "harm_config_id": str - category: Union[str, RaiAcsHarmCategory] - harm_config_id: str - - - class azure.mgmt.cognitiveservices.types.RaiAcsInterventionPoint(TypedDict, total=False): - key "annotations": ForwardRef('RaiAcsEmptyObject', module='types') - key "policy": Required[RaiAcsPolicyBinding] - key "policy_target": Required[Union[str, RaiAcsPolicyTarget]] - key "policy_target_kind": Required[Union[str, RaiAcsPolicyTargetKind]] - annotations: RaiAcsEmptyObject - policy: RaiAcsPolicyBinding - policy_target: Union[str, RaiAcsPolicyTarget] - policy_target_kind: Union[str, RaiAcsPolicyTargetKind] - - - class azure.mgmt.cognitiveservices.types.RaiAcsInterventionPoints(TypedDict, total=False): - key "input": ForwardRef('RaiAcsInterventionPoint', module='types') - key "output": ForwardRef('RaiAcsInterventionPoint', module='types') - key "post_tool_call": ForwardRef('RaiAcsToolInterventionPoint', module='types') - key "pre_tool_call": ForwardRef('RaiAcsToolInterventionPoint', module='types') - input: RaiAcsInterventionPoint - output: RaiAcsInterventionPoint - post_tool_call: RaiAcsToolInterventionPoint - pre_tool_call: RaiAcsToolInterventionPoint - - - class azure.mgmt.cognitiveservices.types.RaiAcsManifest(TypedDict, total=False): - key "agent_control_specification_version": Required[str] - key "annotators": ForwardRef('RaiAcsEmptyObject', module='types') - key "intervention_points": Required[RaiAcsInterventionPoints] - key "policies": Required[dict[str, RaiAcsRegoPolicyDefinition]] - agent_control_specification_version: str - annotators: RaiAcsEmptyObject - intervention_points: RaiAcsInterventionPoints - metadata: dict[str, Any] - policies: dict[str, RaiAcsRegoPolicyDefinition] - tools: dict[str, RaiAcsToolDefinition] - - - class azure.mgmt.cognitiveservices.types.RaiAcsModerationBindingExtension(TypedDict, total=False): - key "harm_configs": Required[list[RaiAcsHarmConfiguration]] - key "subject_format": Required[Union[str, RaiAcsModerationSubjectFormat]] - harm_configs: list[RaiAcsHarmConfiguration] - subject_format: Union[str, RaiAcsModerationSubjectFormat] - - - class azure.mgmt.cognitiveservices.types.RaiAcsPolicyBinding(TypedDict, total=False): - key "aacs_moderation": ForwardRef('RaiAcsModerationBindingExtension', module='types') - key "id": Required[str] - key "query": str - aacs_moderation: RaiAcsModerationBindingExtension - id: str - query: str - - - class azure.mgmt.cognitiveservices.types.RaiAcsRegoPolicyDefinition(TypedDict, total=False): - key "query": Required[str] - key "type": Required[Union[str, RaiAcsPolicyDefinitionType]] - query: str - type: Union[str, RaiAcsPolicyDefinitionType] - - - class azure.mgmt.cognitiveservices.types.RaiAcsToolDefinition(TypedDict, total=False): - key "clearance": str - key "description": str - key "id": str - key "type": str - clearance: str - description: str - id: str - security_labels: list[str] - type: str - - - class azure.mgmt.cognitiveservices.types.RaiAcsToolInterventionPoint(TypedDict, total=False): - key "annotations": ForwardRef('RaiAcsEmptyObject', module='types') - key "policy": Required[RaiAcsPolicyBinding] - key "policy_target": Required[Union[str, RaiAcsPolicyTarget]] - key "policy_target_kind": Required[Union[str, RaiAcsPolicyTargetKind]] - key "tool_name_from": Union[str, RaiAcsToolNameSelector] - annotations: RaiAcsEmptyObject - policy: RaiAcsPolicyBinding - policy_target: Union[str, RaiAcsPolicyTarget] - policy_target_kind: Union[str, RaiAcsPolicyTargetKind] - tool_name_from: Union[str, RaiAcsToolNameSelector] - - - class azure.mgmt.cognitiveservices.types.RaiBinding(ProxyResource): - key "etag": str - key "id": str - key "name": str - key "properties": ForwardRef('RaiBindingProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - name: str - properties: RaiBindingProperties - systemData: SystemData - tags: dict[str, str] - type: str - - - class azure.mgmt.cognitiveservices.types.RaiBindingProperties(TypedDict, total=False): - key "boundResourceId": Required[str] - key "targetPolicyName": Required[str] - boundResourceId: str - targetPolicyName: str - - class azure.mgmt.cognitiveservices.types.RaiBlocklist(ProxyResource): key "etag": str key "id": str @@ -15904,65 +11862,20 @@ namespace azure.mgmt.cognitiveservices.types source: Union[str, RaiPolicyContentSource] - class azure.mgmt.cognitiveservices.types.RaiPolicyCustomExternalSafetyProviderReference(TypedDict, total=False): - key "blocking": bool - key "externalSafetyProviderName": Required[str] - key "managedIdentityResourceId": str - key "source": Required[Union[str, RaiPolicyContentSource]] - blocking: bool - externalSafetyProviderName: str - managedIdentityResourceId: str - source: Union[str, RaiPolicyContentSource] - - class azure.mgmt.cognitiveservices.types.RaiPolicyProperties(TypedDict, total=False): - key "acs": ForwardRef('RaiAcsManifest', module='types') key "basePolicyName": str key "egressPolicy": ForwardRef('RaiEgressPolicyConfig', module='types') - key "format": Union[str, RaiPolicyFormat] key "mode": Union[str, RaiPolicyMode] key "type": Union[str, RaiPolicyType] - acs: RaiAcsManifest - acsRegos: list[RaiRegoReference] basePolicyName: str contentFilters: list[RaiPolicyContentFilter] customBlocklists: list[CustomBlocklistConfig] - customExternalSafetyProviders: list[RaiPolicyCustomExternalSafetyProviderReference] egressPolicy: RaiEgressPolicyConfig - format: Union[str, RaiPolicyFormat] mode: Union[str, RaiPolicyMode] safetyProviders: list[SafetyProviderConfig] type: Union[str, RaiPolicyType] - class azure.mgmt.cognitiveservices.types.RaiRego(ProxyResource): - key "etag": str - key "id": str - key "name": str - key "properties": ForwardRef('RaiRegoProperties', module='types') - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - name: str - properties: RaiRegoProperties - systemData: SystemData - tags: dict[str, str] - type: str - - - class azure.mgmt.cognitiveservices.types.RaiRegoProperties(TypedDict, total=False): - key "encoding": Union[str, RaiRegoEncoding] - key "rego": Required[str] - encoding: Union[str, RaiRegoEncoding] - rego: str - - - class azure.mgmt.cognitiveservices.types.RaiRegoReference(TypedDict, total=False): - key "regoName": Required[str] - regoName: str - - class azure.mgmt.cognitiveservices.types.RaiSafetyProviderConfig(TypedDict, total=False): key "blocking": bool key "safetyProviderName": str @@ -16212,13 +12125,6 @@ namespace azure.mgmt.cognitiveservices.types lastChangeDate: str - class azure.mgmt.cognitiveservices.types.SshSettings(TypedDict, total=False): - key "adminEnabled": bool - key "sshPublicKey": str - adminEnabled: bool - sshPublicKey: str - - class azure.mgmt.cognitiveservices.types.SystemData(TypedDict, total=False): key "createdAt": str key "createdBy": str @@ -16259,6 +12165,15 @@ namespace azure.mgmt.cognitiveservices.types trafficPercentage: int + class azure.mgmt.cognitiveservices.types.TrustedCertificateSource(TypedDict, total=False): + key "certificateBundleReferences": Required[list[CertificateBundleReference]] + key "resourceId": Required[str] + key "type": Required[Union[str, TrustedCertificateSourceType]] + certificateBundleReferences: list[CertificateBundleReference] + resourceId: str + type: Union[str, TrustedCertificateSourceType] + + class azure.mgmt.cognitiveservices.types.UserAssignedIdentity(TypedDict, total=False): key "clientId": str key "principalId": str @@ -16327,67 +12242,4 @@ namespace azure.mgmt.cognitiveservices.types state: str - class azure.mgmt.cognitiveservices.types.Workbench(ProxyResource): - key "etag": str - key "id": str - key "identity": ForwardRef('Identity', module='types') - key "name": str - key "properties": Required[WorkbenchProperties] - key "systemData": ForwardRef('SystemData', module='types') - key "type": str - etag: str - id: str - identity: Identity - name: str - properties: WorkbenchProperties - systemData: SystemData - type: str - - - class azure.mgmt.cognitiveservices.types.WorkbenchProperties(TypedDict, total=False): - key "connectivityEndpoints": ForwardRef('ConnectivityEndpoints', module='types') - key "creationTime": str - key "datasetId": str - key "gpuCount": int - key "idleTimeBeforeShutdown": str - key "imageLink": Required[str] - key "instanceType": str - key "provisioningState": Union[str, WorkbenchProvisioningState] - key "sshSettings": ForwardRef('SshSettings', module='types') - key "status": Union[str, WorkbenchStatus] - key "targetClusterId": Required[str] - key "webEndpoint": str - connectivityEndpoints: ConnectivityEndpoints - creationTime: str - datasetId: str - errors: list[ErrorDetail] - gpuCount: int - idleTimeBeforeShutdown: str - imageLink: str - instanceType: str - provisioningState: Union[str, WorkbenchProvisioningState] - sshSettings: SshSettings - status: Union[str, WorkbenchStatus] - targetClusterId: str - webEndpoint: str - - - class azure.mgmt.cognitiveservices.types.WorkbenchUpdate(TypedDict, total=False): - key "identity": ForwardRef('Identity', module='types') - key "properties": ForwardRef('WorkbenchUpdateProperties', module='types') - identity: Identity - properties: WorkbenchUpdateProperties - - - class azure.mgmt.cognitiveservices.types.WorkbenchUpdateProperties(TypedDict, total=False): - key "gpuCount": Optional[int] - key "idleTimeBeforeShutdown": str - key "instanceType": Optional[str] - key "targetClusterId": str - gpuCount: int - idleTimeBeforeShutdown: str - instanceType: str - targetClusterId: str - - ``` \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/api.metadata.yml b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/api.metadata.yml index 946f3cd67545..62a0b10c5be7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/api.metadata.yml +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/api.metadata.yml @@ -1,4 +1,4 @@ -apiMdSha256: 0355fc5b7f321b64ef97fcbc9cd0165a7fae9170e58cc36800813b5b00c5c585 -packageVersion: 15.0.0b6 +apiHash: ba5931de0cf7233d00d4e838b206e7c5ea2945a8325a8ca327300470985ba71e +packageVersion: 15.0.0 parserVersion: 0.3.31 -pythonVersion: 3.13.15 +pythonVersion: 3.13.18 diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/apiview-properties.json b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/apiview-properties.json index 73fbdf826166..322cd4686244 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/apiview-properties.json +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/apiview-properties.json @@ -14,14 +14,10 @@ "azure.mgmt.cognitiveservices.models.AccountProperties": "Microsoft.CognitiveServices.AccountProperties", "azure.mgmt.cognitiveservices.models.AccountSku": "Microsoft.CognitiveServices.AccountSku", "azure.mgmt.cognitiveservices.models.AccountSkuListResult": "Microsoft.CognitiveServices.AccountSkuListResult", - "azure.mgmt.cognitiveservices.models.AdapterDeployment": "Microsoft.CognitiveServices.AdapterDeployment", - "azure.mgmt.cognitiveservices.models.AdapterDeploymentLastOperation": "Microsoft.CognitiveServices.AdapterDeploymentLastOperation", - "azure.mgmt.cognitiveservices.models.AdapterDeploymentProperties": "Microsoft.CognitiveServices.AdapterDeploymentProperties", "azure.mgmt.cognitiveservices.models.AgentApplication": "Microsoft.CognitiveServices.AgentApplication", "azure.mgmt.cognitiveservices.models.AgentDeployment": "Microsoft.CognitiveServices.AgentDeployment", "azure.mgmt.cognitiveservices.models.ResourceBase": "Microsoft.CognitiveServices.ResourceBase", "azure.mgmt.cognitiveservices.models.AgentDeploymentProperties": "Microsoft.CognitiveServices.AgentDeploymentProperties", - "azure.mgmt.cognitiveservices.models.AgentHostingConfiguration": "Microsoft.CognitiveServices.AgentHostingConfiguration", "azure.mgmt.cognitiveservices.models.AgenticApplicationProperties": "Microsoft.CognitiveServices.AgenticApplicationProperties", "azure.mgmt.cognitiveservices.models.AgentProtocolVersion": "Microsoft.CognitiveServices.AgentProtocolVersion", "azure.mgmt.cognitiveservices.models.AgentReference": "Microsoft.CognitiveServices.AgentReference", @@ -32,19 +28,6 @@ "azure.mgmt.cognitiveservices.models.ApiProperties": "Microsoft.CognitiveServices.ApiProperties", "azure.mgmt.cognitiveservices.models.ApplicationAuthorizationPolicy": "Microsoft.CognitiveServices.ApplicationAuthorizationPolicy", "azure.mgmt.cognitiveservices.models.ApplicationTrafficRoutingPolicy": "Microsoft.CognitiveServices.ApplicationTrafficRoutingPolicy", - "azure.mgmt.cognitiveservices.models.ArcDeployment": "Microsoft.CognitiveServices.ArcDeployment", - "azure.mgmt.cognitiveservices.models.ArcDeploymentCpuMemoryResourceRequirements": "Microsoft.CognitiveServices.ArcDeploymentCpuMemoryResourceRequirements", - "azure.mgmt.cognitiveservices.models.ArcDeploymentKubernetesResources": "Microsoft.CognitiveServices.ArcDeploymentKubernetesResources", - "azure.mgmt.cognitiveservices.models.ArcDeploymentModel": "Microsoft.CognitiveServices.ArcDeploymentModel", - "azure.mgmt.cognitiveservices.models.ArcDeploymentPatchCpuMemoryResourceRequirements": "Microsoft.CognitiveServices.ArcDeploymentPatchCpuMemoryResourceRequirements", - "azure.mgmt.cognitiveservices.models.ArcDeploymentPatchKubernetesResources": "Microsoft.CognitiveServices.ArcDeploymentPatchKubernetesResources", - "azure.mgmt.cognitiveservices.models.ArcDeploymentProperties": "Microsoft.CognitiveServices.ArcDeploymentProperties", - "azure.mgmt.cognitiveservices.models.ArcDeploymentProvisioningDetails": "Microsoft.CognitiveServices.ArcDeploymentProvisioningDetails", - "azure.mgmt.cognitiveservices.models.ArcDeploymentResourceRequirements": "Microsoft.CognitiveServices.ArcDeploymentResourceRequirements", - "azure.mgmt.cognitiveservices.models.ArcDeploymentSku": "Microsoft.CognitiveServices.ArcDeploymentSku", - "azure.mgmt.cognitiveservices.models.ArcDeploymentUpdate": "Microsoft.CognitiveServices.ArcDeploymentUpdate", - "azure.mgmt.cognitiveservices.models.ArcDeploymentUpdateProperties": "Microsoft.CognitiveServices.ArcDeploymentUpdateProperties", - "azure.mgmt.cognitiveservices.models.ArcDeploymentVllmParameters": "Microsoft.CognitiveServices.ArcDeploymentVllmParameters", "azure.mgmt.cognitiveservices.models.AssignedIdentity": "Microsoft.CognitiveServices.AssignedIdentity", "azure.mgmt.cognitiveservices.models.BillingMeterInfo": "Microsoft.CognitiveServices.BillingMeterInfo", "azure.mgmt.cognitiveservices.models.CalculateModelCapacityParameter": "Microsoft.CognitiveServices.CalculateModelCapacityParameter", @@ -53,13 +36,11 @@ "azure.mgmt.cognitiveservices.models.CallRateLimit": "Microsoft.CognitiveServices.CallRateLimit", "azure.mgmt.cognitiveservices.models.CapabilityHost": "Microsoft.CognitiveServices.CapabilityHost", "azure.mgmt.cognitiveservices.models.CapabilityHostProperties": "Microsoft.CognitiveServices.CapabilityHostProperties", - "azure.mgmt.cognitiveservices.models.CapabilitySettings": "Microsoft.CognitiveServices.CapabilitySettings", "azure.mgmt.cognitiveservices.models.CapacityConfig": "Microsoft.CognitiveServices.CapacityConfig", + "azure.mgmt.cognitiveservices.models.CertificateBundleReference": "Microsoft.CognitiveServices.CertificateBundleReference", "azure.mgmt.cognitiveservices.models.ChannelsBuiltInAuthorizationPolicy": "Microsoft.CognitiveServices.ChannelsBuiltInAuthorizationPolicy", "azure.mgmt.cognitiveservices.models.CheckDomainAvailabilityParameter": "Microsoft.CognitiveServices.CheckDomainAvailabilityParameter", "azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityParameter": "Microsoft.CognitiveServices.CheckSkuAvailabilityParameter", - "azure.mgmt.cognitiveservices.models.ComputeProperties": "Microsoft.CognitiveServices.ComputeProperties", - "azure.mgmt.cognitiveservices.models.ClusterComputeProperties": "Microsoft.CognitiveServices.ClusterComputeProperties", "azure.mgmt.cognitiveservices.models.CommitmentCost": "Microsoft.CognitiveServices.CommitmentCost", "azure.mgmt.cognitiveservices.models.CommitmentPeriod": "Microsoft.CognitiveServices.CommitmentPeriod", "azure.mgmt.cognitiveservices.models.CommitmentPlan": "Microsoft.CognitiveServices.CommitmentPlan", @@ -69,9 +50,6 @@ "azure.mgmt.cognitiveservices.models.CommitmentPlanProperties": "Microsoft.CognitiveServices.CommitmentPlanProperties", "azure.mgmt.cognitiveservices.models.CommitmentQuota": "Microsoft.CognitiveServices.CommitmentQuota", "azure.mgmt.cognitiveservices.models.CommitmentTier": "Microsoft.CognitiveServices.CommitmentTier", - "azure.mgmt.cognitiveservices.models.Compute": "Microsoft.CognitiveServices.Compute", - "azure.mgmt.cognitiveservices.models.ComputeOperationStatus": "Microsoft.CognitiveServices.ComputeOperationStatus", - "azure.mgmt.cognitiveservices.models.ComputeOperationStatusProperties": "Microsoft.CognitiveServices.ComputeOperationStatusProperties", "azure.mgmt.cognitiveservices.models.ConnectionAccessKey": "Microsoft.CognitiveServices.ConnectionAccessKey", "azure.mgmt.cognitiveservices.models.ConnectionAccountKey": "Microsoft.CognitiveServices.ConnectionAccountKey", "azure.mgmt.cognitiveservices.models.ConnectionApiKey": "Microsoft.CognitiveServices.ConnectionApiKey", @@ -83,17 +61,6 @@ "azure.mgmt.cognitiveservices.models.ConnectionSharedAccessSignature": "Microsoft.CognitiveServices.ConnectionSharedAccessSignature", "azure.mgmt.cognitiveservices.models.ConnectionUpdateContent": "Microsoft.CognitiveServices.ConnectionUpdateContent", "azure.mgmt.cognitiveservices.models.ConnectionUsernamePassword": "Microsoft.CognitiveServices.ConnectionUsernamePassword", - "azure.mgmt.cognitiveservices.models.ConnectivityEndpoints": "Microsoft.CognitiveServices.ConnectivityEndpoints", - "azure.mgmt.cognitiveservices.models.ContainerInstanceComputeProperties": "Microsoft.CognitiveServices.ContainerInstanceComputeProperties", - "azure.mgmt.cognitiveservices.models.CostControl": "Microsoft.CognitiveServices.CostControl", - "azure.mgmt.cognitiveservices.models.CostControlConnections": "Microsoft.CognitiveServices.CostControlConnections", - "azure.mgmt.cognitiveservices.models.CostControlDimension": "Microsoft.CognitiveServices.CostControlDimension", - "azure.mgmt.cognitiveservices.models.CostControlMatch": "Microsoft.CognitiveServices.CostControlMatch", - "azure.mgmt.cognitiveservices.models.CostControlPatch": "Microsoft.CognitiveServices.CostControlPatch", - "azure.mgmt.cognitiveservices.models.CostControlPatchProperties": "Microsoft.CognitiveServices.CostControlPatchProperties", - "azure.mgmt.cognitiveservices.models.CostControlProperties": "Microsoft.CognitiveServices.CostControlProperties", - "azure.mgmt.cognitiveservices.models.CostControlRule": "Microsoft.CognitiveServices.CostControlRule", - "azure.mgmt.cognitiveservices.models.CostControlThreshold": "Microsoft.CognitiveServices.CostControlThreshold", "azure.mgmt.cognitiveservices.models.RaiBlocklistConfig": "Microsoft.CognitiveServices.RaiBlocklistConfig", "azure.mgmt.cognitiveservices.models.CustomBlocklistConfig": "Microsoft.CognitiveServices.CustomBlocklistConfig", "azure.mgmt.cognitiveservices.models.CustomKeys": "Microsoft.CognitiveServices.CustomKeys", @@ -102,12 +69,10 @@ "azure.mgmt.cognitiveservices.models.DefenderForAISettingProperties": "Microsoft.CognitiveServices.DefenderForAISettingProperties", "azure.mgmt.cognitiveservices.models.Deployment": "Microsoft.CognitiveServices.Deployment", "azure.mgmt.cognitiveservices.models.DeploymentCapacitySettings": "Microsoft.CognitiveServices.DeploymentCapacitySettings", - "azure.mgmt.cognitiveservices.models.DeploymentPolicyEvaluationResult": "Microsoft.CognitiveServices.DeploymentPolicyEvaluationResult", "azure.mgmt.cognitiveservices.models.DeploymentProperties": "Microsoft.CognitiveServices.DeploymentProperties", "azure.mgmt.cognitiveservices.models.DeploymentRouting": "Microsoft.CognitiveServices.DeploymentRouting", "azure.mgmt.cognitiveservices.models.DeploymentScaleSettings": "Microsoft.CognitiveServices.DeploymentScaleSettings", "azure.mgmt.cognitiveservices.models.DeploymentSizeCapacity": "Microsoft.CognitiveServices.DeploymentSizeCapacity", - "azure.mgmt.cognitiveservices.models.DeploymentSpeculativeDecoding": "Microsoft.CognitiveServices.DeploymentSpeculativeDecoding", "azure.mgmt.cognitiveservices.models.DomainAvailability": "Microsoft.CognitiveServices.DomainAvailability", "azure.mgmt.cognitiveservices.models.Encryption": "Microsoft.CognitiveServices.Encryption", "azure.mgmt.cognitiveservices.models.EncryptionScope": "Microsoft.CognitiveServices.EncryptionScope", @@ -115,28 +80,15 @@ "azure.mgmt.cognitiveservices.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.cognitiveservices.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.cognitiveservices.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", - "azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesDeployment": "Microsoft.CognitiveServices.EvaluateDeploymentPoliciesDeployment", - "azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesDeploymentProperties": "Microsoft.CognitiveServices.EvaluateDeploymentPoliciesDeploymentProperties", - "azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesRequest": "Microsoft.CognitiveServices.EvaluateDeploymentPoliciesRequest", - "azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesResponse": "Microsoft.CognitiveServices.EvaluateDeploymentPoliciesResponse", - "azure.mgmt.cognitiveservices.models.FoundryAutoUpgrade": "Microsoft.CognitiveServices.FoundryAutoUpgrade", "azure.mgmt.cognitiveservices.models.OutboundRule": "Microsoft.CognitiveServices.OutboundRule", "azure.mgmt.cognitiveservices.models.FqdnOutboundRule": "Microsoft.CognitiveServices.FqdnOutboundRule", - "azure.mgmt.cognitiveservices.models.GatedModelAccessProperties": "Microsoft.CognitiveServices.GatedModelAccessProperties", "azure.mgmt.cognitiveservices.models.HostedAgentDeployment": "Microsoft.CognitiveServices.HostedAgentDeployment", "azure.mgmt.cognitiveservices.models.Identity": "Microsoft.CognitiveServices.Identity", "azure.mgmt.cognitiveservices.models.IpRule": "Microsoft.CognitiveServices.IpRule", "azure.mgmt.cognitiveservices.models.KeyVaultProperties": "Microsoft.CognitiveServices.KeyVaultProperties", "azure.mgmt.cognitiveservices.models.ManagedAgentDeployment": "Microsoft.CognitiveServices.ManagedAgentDeployment", - "azure.mgmt.cognitiveservices.models.ManagedClusterAgentHostingConfiguration": "Microsoft.CognitiveServices.ManagedClusterAgentHostingConfiguration", "azure.mgmt.cognitiveservices.models.ManagedComputeCapacity": "Microsoft.CognitiveServices.ManagedComputeCapacity", "azure.mgmt.cognitiveservices.models.ManagedComputeCapacityProperties": "Microsoft.CognitiveServices.ManagedComputeCapacityProperties", - "azure.mgmt.cognitiveservices.models.ManagedComputeDeployment": "Microsoft.CognitiveServices.ManagedComputeDeployment", - "azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentInfo": "Microsoft.CognitiveServices.ManagedComputeDeploymentInfo", - "azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentProperties": "Microsoft.CognitiveServices.ManagedComputeDeploymentProperties", - "azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentProvisioningDetails": "Microsoft.CognitiveServices.ManagedComputeDeploymentProvisioningDetails", - "azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentRoutes": "Microsoft.CognitiveServices.ManagedComputeDeploymentRoutes", - "azure.mgmt.cognitiveservices.models.ManagedComputeUsage": "Microsoft.CognitiveServices.ManagedComputeUsage", "azure.mgmt.cognitiveservices.models.ManagedIdentityAuthTypeConnectionProperties": "Microsoft.CognitiveServices.ManagedIdentityAuthTypeConnectionProperties", "azure.mgmt.cognitiveservices.models.ManagedNetworkProvisionOptions": "Microsoft.CognitiveServices.ManagedNetworkProvisionOptions", "azure.mgmt.cognitiveservices.models.ManagedNetworkProvisionStatus": "Microsoft.CognitiveServices.ManagedNetworkProvisionStatus", @@ -171,12 +123,8 @@ "azure.mgmt.cognitiveservices.models.OrganizationSharedBuiltInAuthorizationPolicy": "Microsoft.CognitiveServices.OrganizationSharedBuiltInAuthorizationPolicy", "azure.mgmt.cognitiveservices.models.OutboundRuleBasicResource": "Microsoft.CognitiveServices.OutboundRuleBasicResource", "azure.mgmt.cognitiveservices.models.PATAuthTypeConnectionProperties": "Microsoft.CognitiveServices.PATAuthTypeConnectionProperties", - "azure.mgmt.cognitiveservices.models.PatchResourceSku": "Microsoft.CognitiveServices.PatchResourceSku", "azure.mgmt.cognitiveservices.models.PatchResourceTags": "Microsoft.CognitiveServices.PatchResourceTags", "azure.mgmt.cognitiveservices.models.PatchResourceTagsAndSku": "Microsoft.CognitiveServices.PatchResourceTagsAndSku", - "azure.mgmt.cognitiveservices.models.PolicyAssignmentEvaluationDetails": "Microsoft.CognitiveServices.PolicyAssignmentEvaluationDetails", - "azure.mgmt.cognitiveservices.models.PolicyExpressionEvaluationDetails": "Microsoft.CognitiveServices.PolicyExpressionEvaluationDetails", - "azure.mgmt.cognitiveservices.models.Pool": "Microsoft.CognitiveServices.Pool", "azure.mgmt.cognitiveservices.models.PrivateEndpoint": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", "azure.mgmt.cognitiveservices.models.PrivateEndpointConnection": "Microsoft.CognitiveServices.PrivateEndpointConnection", "azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionListResult": "Microsoft.CognitiveServices.PrivateEndpointConnectionListResult", @@ -197,18 +145,6 @@ "azure.mgmt.cognitiveservices.models.QuotaTier": "Microsoft.CognitiveServices.QuotaTier", "azure.mgmt.cognitiveservices.models.QuotaTierProperties": "Microsoft.CognitiveServices.QuotaTierProperties", "azure.mgmt.cognitiveservices.models.QuotaTierUpgradeEligibilityInfo": "Microsoft.CognitiveServices.QuotaTierUpgradeEligibilityInfo", - "azure.mgmt.cognitiveservices.models.RaiAcsEmptyObject": "Microsoft.CognitiveServices.RaiAcsEmptyObject", - "azure.mgmt.cognitiveservices.models.RaiAcsHarmConfiguration": "Microsoft.CognitiveServices.RaiAcsHarmConfiguration", - "azure.mgmt.cognitiveservices.models.RaiAcsInterventionPoint": "Microsoft.CognitiveServices.RaiAcsInterventionPoint", - "azure.mgmt.cognitiveservices.models.RaiAcsInterventionPoints": "Microsoft.CognitiveServices.RaiAcsInterventionPoints", - "azure.mgmt.cognitiveservices.models.RaiAcsManifest": "Microsoft.CognitiveServices.RaiAcsManifest", - "azure.mgmt.cognitiveservices.models.RaiAcsModerationBindingExtension": "Microsoft.CognitiveServices.RaiAcsModerationBindingExtension", - "azure.mgmt.cognitiveservices.models.RaiAcsPolicyBinding": "Microsoft.CognitiveServices.RaiAcsPolicyBinding", - "azure.mgmt.cognitiveservices.models.RaiAcsRegoPolicyDefinition": "Microsoft.CognitiveServices.RaiAcsRegoPolicyDefinition", - "azure.mgmt.cognitiveservices.models.RaiAcsToolDefinition": "Microsoft.CognitiveServices.RaiAcsToolDefinition", - "azure.mgmt.cognitiveservices.models.RaiAcsToolInterventionPoint": "Microsoft.CognitiveServices.RaiAcsToolInterventionPoint", - "azure.mgmt.cognitiveservices.models.RaiBinding": "Microsoft.CognitiveServices.RaiBinding", - "azure.mgmt.cognitiveservices.models.RaiBindingProperties": "Microsoft.CognitiveServices.RaiBindingProperties", "azure.mgmt.cognitiveservices.models.RaiBlocklist": "Microsoft.CognitiveServices.RaiBlocklist", "azure.mgmt.cognitiveservices.models.RaiBlocklistItem": "Microsoft.CognitiveServices.RaiBlocklistItem", "azure.mgmt.cognitiveservices.models.RaiBlocklistItemBulkRequest": "Microsoft.CognitiveServices.RaiBlocklistItemBulkRequest", @@ -230,11 +166,7 @@ "azure.mgmt.cognitiveservices.models.RaiMonitorConfig": "Microsoft.CognitiveServices.RaiMonitorConfig", "azure.mgmt.cognitiveservices.models.RaiPolicy": "Microsoft.CognitiveServices.RaiPolicy", "azure.mgmt.cognitiveservices.models.RaiPolicyContentFilter": "Microsoft.CognitiveServices.RaiPolicyContentFilter", - "azure.mgmt.cognitiveservices.models.RaiPolicyCustomExternalSafetyProviderReference": "Microsoft.CognitiveServices.RaiPolicyCustomExternalSafetyProviderReference", "azure.mgmt.cognitiveservices.models.RaiPolicyProperties": "Microsoft.CognitiveServices.RaiPolicyProperties", - "azure.mgmt.cognitiveservices.models.RaiRego": "Microsoft.CognitiveServices.RaiRego", - "azure.mgmt.cognitiveservices.models.RaiRegoProperties": "Microsoft.CognitiveServices.RaiRegoProperties", - "azure.mgmt.cognitiveservices.models.RaiRegoReference": "Microsoft.CognitiveServices.RaiRegoReference", "azure.mgmt.cognitiveservices.models.RaiSafetyProviderConfig": "Microsoft.CognitiveServices.RaiSafetyProviderConfig", "azure.mgmt.cognitiveservices.models.RaiToolLabel": "Microsoft.CognitiveServices.RaiToolLabel", "azure.mgmt.cognitiveservices.models.RaiToolLabelProperties": "Microsoft.CognitiveServices.RaiToolLabelProperties", @@ -261,10 +193,10 @@ "azure.mgmt.cognitiveservices.models.SkuCapability": "Microsoft.CognitiveServices.SkuCapability", "azure.mgmt.cognitiveservices.models.SkuChangeInfo": "Microsoft.CognitiveServices.SkuChangeInfo", "azure.mgmt.cognitiveservices.models.SkuResource": "Microsoft.CognitiveServices.SkuResource", - "azure.mgmt.cognitiveservices.models.SshSettings": "Microsoft.CognitiveServices.SshSettings", "azure.mgmt.cognitiveservices.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", "azure.mgmt.cognitiveservices.models.ThrottlingRule": "Microsoft.CognitiveServices.ThrottlingRule", "azure.mgmt.cognitiveservices.models.TrafficRoutingRule": "Microsoft.CognitiveServices.TrafficRoutingRule", + "azure.mgmt.cognitiveservices.models.TrustedCertificateSource": "Microsoft.CognitiveServices.TrustedCertificateSource", "azure.mgmt.cognitiveservices.models.Usage": "Microsoft.CognitiveServices.Usage", "azure.mgmt.cognitiveservices.models.UsageListResult": "Microsoft.CognitiveServices.UsageListResult", "azure.mgmt.cognitiveservices.models.UserAssignedIdentity": "Microsoft.CognitiveServices.UserAssignedIdentity", @@ -273,10 +205,6 @@ "azure.mgmt.cognitiveservices.models.UserOwnedStorage": "Microsoft.CognitiveServices.UserOwnedStorage", "azure.mgmt.cognitiveservices.models.VersionedAgentReference": "Microsoft.CognitiveServices.VersionedAgentReference", "azure.mgmt.cognitiveservices.models.VirtualNetworkRule": "Microsoft.CognitiveServices.VirtualNetworkRule", - "azure.mgmt.cognitiveservices.models.Workbench": "Microsoft.CognitiveServices.Workbench", - "azure.mgmt.cognitiveservices.models.WorkbenchProperties": "Microsoft.CognitiveServices.WorkbenchProperties", - "azure.mgmt.cognitiveservices.models.WorkbenchUpdate": "Microsoft.CognitiveServices.WorkbenchUpdate", - "azure.mgmt.cognitiveservices.models.WorkbenchUpdateProperties": "Microsoft.CognitiveServices.WorkbenchUpdateProperties", "azure.mgmt.cognitiveservices.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", "azure.mgmt.cognitiveservices.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", "azure.mgmt.cognitiveservices.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", @@ -290,8 +218,7 @@ "azure.mgmt.cognitiveservices.models.RoutingMethods": "Microsoft.CognitiveServices.RoutingMethods", "azure.mgmt.cognitiveservices.models.AbusePenaltyAction": "Microsoft.CognitiveServices.AbusePenaltyAction", "azure.mgmt.cognitiveservices.models.ScenarioType": "Microsoft.CognitiveServices.ScenarioType", - "azure.mgmt.cognitiveservices.models.FoundryAutoUpgradeMode": "Microsoft.CognitiveServices.FoundryAutoUpgradeMode", - "azure.mgmt.cognitiveservices.models.AgentHostingType": "Microsoft.CognitiveServices.AgentHostingType", + "azure.mgmt.cognitiveservices.models.TrustedCertificateSourceType": "Microsoft.CognitiveServices.TrustedCertificateSourceType", "azure.mgmt.cognitiveservices.models.SkuTier": "Microsoft.CognitiveServices.SkuTier", "azure.mgmt.cognitiveservices.models.ResourceIdentityType": "Microsoft.CognitiveServices.ResourceIdentityType", "azure.mgmt.cognitiveservices.models.KeyName": "Microsoft.CognitiveServices.KeyName", @@ -300,7 +227,6 @@ "azure.mgmt.cognitiveservices.models.QuotaScopeType": "Microsoft.CognitiveServices.QuotaScopeType", "azure.mgmt.cognitiveservices.models.DeprecationStatus": "Microsoft.CognitiveServices.DeprecationStatus", "azure.mgmt.cognitiveservices.models.ModelLifecycleStatus": "Microsoft.CognitiveServices.ModelLifecycleStatus", - "azure.mgmt.cognitiveservices.models.PolicyEvaluationOutcome": "Microsoft.CognitiveServices.PolicyEvaluationOutcome", "azure.mgmt.cognitiveservices.models.DeploymentProvisioningState": "Microsoft.CognitiveServices.DeploymentProvisioningState", "azure.mgmt.cognitiveservices.models.DeploymentScaleType": "Microsoft.CognitiveServices.DeploymentScaleType", "azure.mgmt.cognitiveservices.models.DeploymentModelVersionUpgradeOption": "Microsoft.CognitiveServices.DeploymentModelVersionUpgradeOption", @@ -311,13 +237,6 @@ "azure.mgmt.cognitiveservices.models.HostingModel": "Microsoft.CognitiveServices.HostingModel", "azure.mgmt.cognitiveservices.models.EncryptionScopeProvisioningState": "Microsoft.CognitiveServices.EncryptionScopeProvisioningState", "azure.mgmt.cognitiveservices.models.EncryptionScopeState": "Microsoft.CognitiveServices.EncryptionScopeState", - "azure.mgmt.cognitiveservices.models.RaiPolicyFormat": "Microsoft.CognitiveServices.RaiPolicyFormat", - "azure.mgmt.cognitiveservices.models.RaiAcsPolicyDefinitionType": "Microsoft.CognitiveServices.RaiAcsPolicyDefinitionType", - "azure.mgmt.cognitiveservices.models.RaiAcsPolicyTarget": "Microsoft.CognitiveServices.RaiAcsPolicyTarget", - "azure.mgmt.cognitiveservices.models.RaiAcsPolicyTargetKind": "Microsoft.CognitiveServices.RaiAcsPolicyTargetKind", - "azure.mgmt.cognitiveservices.models.RaiAcsModerationSubjectFormat": "Microsoft.CognitiveServices.RaiAcsModerationSubjectFormat", - "azure.mgmt.cognitiveservices.models.RaiAcsHarmCategory": "Microsoft.CognitiveServices.RaiAcsHarmCategory", - "azure.mgmt.cognitiveservices.models.RaiAcsToolNameSelector": "Microsoft.CognitiveServices.RaiAcsToolNameSelector", "azure.mgmt.cognitiveservices.models.RaiPolicyType": "Microsoft.CognitiveServices.RaiPolicyType", "azure.mgmt.cognitiveservices.models.RaiPolicyMode": "Microsoft.CognitiveServices.RaiPolicyMode", "azure.mgmt.cognitiveservices.models.ContentLevel": "Microsoft.CognitiveServices.ContentLevel", @@ -329,7 +248,6 @@ "azure.mgmt.cognitiveservices.models.RaiEgressRuleActionType": "Microsoft.CognitiveServices.RaiEgressRuleActionType", "azure.mgmt.cognitiveservices.models.RaiEgressHeaderOperation": "Microsoft.CognitiveServices.RaiEgressHeaderOperation", "azure.mgmt.cognitiveservices.models.RaiEgressScheme": "Microsoft.CognitiveServices.RaiEgressScheme", - "azure.mgmt.cognitiveservices.models.RaiRegoEncoding": "Microsoft.CognitiveServices.RaiRegoEncoding", "azure.mgmt.cognitiveservices.models.NspAccessRuleDirection": "Microsoft.CognitiveServices.NspAccessRuleDirection", "azure.mgmt.cognitiveservices.models.DefenderForAISettingState": "Microsoft.CognitiveServices.DefenderForAISettingState", "azure.mgmt.cognitiveservices.models.ConnectionAuthType": "Microsoft.CognitiveServices.ConnectionAuthType", @@ -340,28 +258,12 @@ "azure.mgmt.cognitiveservices.models.CapabilityHostProvisioningState": "Microsoft.CognitiveServices.CapabilityHostProvisioningState", "azure.mgmt.cognitiveservices.models.TierUpgradePolicy": "Microsoft.CognitiveServices.TierUpgradePolicy", "azure.mgmt.cognitiveservices.models.UpgradeAvailabilityStatus": "Microsoft.CognitiveServices.UpgradeAvailabilityStatus", - "azure.mgmt.cognitiveservices.models.ArcDeploymentRuntime": "Microsoft.CognitiveServices.ArcDeploymentRuntime", - "azure.mgmt.cognitiveservices.models.ArcDeploymentComputeType": "Microsoft.CognitiveServices.ArcDeploymentComputeType", - "azure.mgmt.cognitiveservices.models.ArcDeploymentSkuName": "Microsoft.CognitiveServices.ArcDeploymentSkuName", "azure.mgmt.cognitiveservices.models.IdentityKind": "Microsoft.CognitiveServices.IdentityKind", "azure.mgmt.cognitiveservices.models.IdentityManagementType": "Microsoft.CognitiveServices.IdentityManagementType", "azure.mgmt.cognitiveservices.models.IdentityProvisioningState": "Microsoft.CognitiveServices.IdentityProvisioningState", "azure.mgmt.cognitiveservices.models.BuiltInAuthorizationScheme": "Microsoft.CognitiveServices.BuiltInAuthorizationScheme", "azure.mgmt.cognitiveservices.models.TrafficRoutingProtocol": "Microsoft.CognitiveServices.TrafficRoutingProtocol", "azure.mgmt.cognitiveservices.models.AgenticApplicationProvisioningState": "Microsoft.CognitiveServices.AgenticApplicationProvisioningState", - "azure.mgmt.cognitiveservices.models.AdapterDeploymentOperationType": "Microsoft.CognitiveServices.AdapterDeploymentOperationType", - "azure.mgmt.cognitiveservices.models.AdapterDeploymentOperationState": "Microsoft.CognitiveServices.AdapterDeploymentOperationState", - "azure.mgmt.cognitiveservices.models.ComputeOperationStatusType": "Microsoft.CognitiveServices.ComputeOperationStatusType", - "azure.mgmt.cognitiveservices.models.ComputeType": "Microsoft.CognitiveServices.ComputeType", - "azure.mgmt.cognitiveservices.models.ComputeProvisioningState": "Microsoft.CognitiveServices.ComputeProvisioningState", - "azure.mgmt.cognitiveservices.models.VmPriority": "Microsoft.CognitiveServices.VmPriority", - "azure.mgmt.cognitiveservices.models.WorkbenchProvisioningState": "Microsoft.CognitiveServices.WorkbenchProvisioningState", - "azure.mgmt.cognitiveservices.models.WorkbenchStatus": "Microsoft.CognitiveServices.WorkbenchStatus", - "azure.mgmt.cognitiveservices.models.CostControlDimensionType": "Microsoft.CognitiveServices.CostControlDimensionType", - "azure.mgmt.cognitiveservices.models.CostControlUnit": "Microsoft.CognitiveServices.CostControlUnit", - "azure.mgmt.cognitiveservices.models.CostControlPeriod": "Microsoft.CognitiveServices.CostControlPeriod", - "azure.mgmt.cognitiveservices.models.CostControlThresholdType": "Microsoft.CognitiveServices.CostControlThresholdType", - "azure.mgmt.cognitiveservices.models.CostControlThresholdAction": "Microsoft.CognitiveServices.CostControlThresholdAction", "azure.mgmt.cognitiveservices.models.CapabilityHostKind": "Microsoft.CognitiveServices.CapabilityHostKind", "azure.mgmt.cognitiveservices.models.RuleCategory": "Microsoft.CognitiveServices.RuleCategory", "azure.mgmt.cognitiveservices.models.RuleStatus": "Microsoft.CognitiveServices.RuleStatus", @@ -402,8 +304,6 @@ "azure.mgmt.cognitiveservices.aio.operations.AccountsOperations.list_usages": "Microsoft.CognitiveServices.Accounts.listUsages", "azure.mgmt.cognitiveservices.operations.AccountsOperations.list_models": "Microsoft.CognitiveServices.Accounts.listModels", "azure.mgmt.cognitiveservices.aio.operations.AccountsOperations.list_models": "Microsoft.CognitiveServices.Accounts.listModels", - "azure.mgmt.cognitiveservices.operations.AccountsOperations.evaluate_deployment_policies": "Microsoft.CognitiveServices.Accounts.evaluateDeploymentPolicies", - "azure.mgmt.cognitiveservices.aio.operations.AccountsOperations.evaluate_deployment_policies": "Microsoft.CognitiveServices.Accounts.evaluateDeploymentPolicies", "azure.mgmt.cognitiveservices.operations.DeletedAccountsOperations.list": "Microsoft.CognitiveServices.DeletedAccounts.list", "azure.mgmt.cognitiveservices.aio.operations.DeletedAccountsOperations.list": "Microsoft.CognitiveServices.DeletedAccounts.list", "azure.mgmt.cognitiveservices.operations.DeletedAccountsOperations.get": "Microsoft.CognitiveServices.DeletedAccounts.get", @@ -484,22 +384,6 @@ "azure.mgmt.cognitiveservices.aio.operations.SubscriptionRaiPolicyOperations.create_or_update": "Microsoft.CognitiveServices.SubscriptionRaiPolicy.createOrUpdate", "azure.mgmt.cognitiveservices.operations.SubscriptionRaiPolicyOperations.begin_delete": "Microsoft.CognitiveServices.SubscriptionRaiPolicy.delete", "azure.mgmt.cognitiveservices.aio.operations.SubscriptionRaiPolicyOperations.begin_delete": "Microsoft.CognitiveServices.SubscriptionRaiPolicy.delete", - "azure.mgmt.cognitiveservices.operations.RaiRegosOperations.get": "Microsoft.CognitiveServices.RaiRegos.get", - "azure.mgmt.cognitiveservices.aio.operations.RaiRegosOperations.get": "Microsoft.CognitiveServices.RaiRegos.get", - "azure.mgmt.cognitiveservices.operations.RaiRegosOperations.create_or_update": "Microsoft.CognitiveServices.RaiRegos.createOrUpdate", - "azure.mgmt.cognitiveservices.aio.operations.RaiRegosOperations.create_or_update": "Microsoft.CognitiveServices.RaiRegos.createOrUpdate", - "azure.mgmt.cognitiveservices.operations.RaiRegosOperations.delete": "Microsoft.CognitiveServices.RaiRegos.delete", - "azure.mgmt.cognitiveservices.aio.operations.RaiRegosOperations.delete": "Microsoft.CognitiveServices.RaiRegos.delete", - "azure.mgmt.cognitiveservices.operations.RaiRegosOperations.list": "Microsoft.CognitiveServices.RaiRegos.list", - "azure.mgmt.cognitiveservices.aio.operations.RaiRegosOperations.list": "Microsoft.CognitiveServices.RaiRegos.list", - "azure.mgmt.cognitiveservices.operations.RaiBindingsOperations.get": "Microsoft.CognitiveServices.RaiBindings.get", - "azure.mgmt.cognitiveservices.aio.operations.RaiBindingsOperations.get": "Microsoft.CognitiveServices.RaiBindings.get", - "azure.mgmt.cognitiveservices.operations.RaiBindingsOperations.create_or_update": "Microsoft.CognitiveServices.RaiBindings.createOrUpdate", - "azure.mgmt.cognitiveservices.aio.operations.RaiBindingsOperations.create_or_update": "Microsoft.CognitiveServices.RaiBindings.createOrUpdate", - "azure.mgmt.cognitiveservices.operations.RaiBindingsOperations.delete": "Microsoft.CognitiveServices.RaiBindings.delete", - "azure.mgmt.cognitiveservices.aio.operations.RaiBindingsOperations.delete": "Microsoft.CognitiveServices.RaiBindings.delete", - "azure.mgmt.cognitiveservices.operations.RaiBindingsOperations.list": "Microsoft.CognitiveServices.RaiBindings.list", - "azure.mgmt.cognitiveservices.aio.operations.RaiBindingsOperations.list": "Microsoft.CognitiveServices.RaiBindings.list", "azure.mgmt.cognitiveservices.operations.RaiBlocklistItemsOperations.get": "Microsoft.CognitiveServices.RaiBlocklistItems.get", "azure.mgmt.cognitiveservices.aio.operations.RaiBlocklistItemsOperations.get": "Microsoft.CognitiveServices.RaiBlocklistItems.get", "azure.mgmt.cognitiveservices.operations.RaiBlocklistItemsOperations.create_or_update": "Microsoft.CognitiveServices.RaiBlocklistItems.createOrUpdate", @@ -590,16 +474,6 @@ "azure.mgmt.cognitiveservices.aio.operations.QuotaTiersOperations.update": "Microsoft.CognitiveServices.QuotaTiers.update", "azure.mgmt.cognitiveservices.operations.QuotaTiersOperations.list_by_subscription": "Microsoft.CognitiveServices.QuotaTiers.listBySubscription", "azure.mgmt.cognitiveservices.aio.operations.QuotaTiersOperations.list_by_subscription": "Microsoft.CognitiveServices.QuotaTiers.listBySubscription", - "azure.mgmt.cognitiveservices.operations.ArcDeploymentsOperations.get": "Microsoft.CognitiveServices.ArcDeployments.get", - "azure.mgmt.cognitiveservices.aio.operations.ArcDeploymentsOperations.get": "Microsoft.CognitiveServices.ArcDeployments.get", - "azure.mgmt.cognitiveservices.operations.ArcDeploymentsOperations.begin_create_or_update": "Microsoft.CognitiveServices.ArcDeployments.createOrUpdate", - "azure.mgmt.cognitiveservices.aio.operations.ArcDeploymentsOperations.begin_create_or_update": "Microsoft.CognitiveServices.ArcDeployments.createOrUpdate", - "azure.mgmt.cognitiveservices.operations.ArcDeploymentsOperations.begin_update": "Microsoft.CognitiveServices.ArcDeployments.update", - "azure.mgmt.cognitiveservices.aio.operations.ArcDeploymentsOperations.begin_update": "Microsoft.CognitiveServices.ArcDeployments.update", - "azure.mgmt.cognitiveservices.operations.ArcDeploymentsOperations.begin_delete": "Microsoft.CognitiveServices.ArcDeployments.delete", - "azure.mgmt.cognitiveservices.aio.operations.ArcDeploymentsOperations.begin_delete": "Microsoft.CognitiveServices.ArcDeployments.delete", - "azure.mgmt.cognitiveservices.operations.ArcDeploymentsOperations.list": "Microsoft.CognitiveServices.ArcDeployments.list", - "azure.mgmt.cognitiveservices.aio.operations.ArcDeploymentsOperations.list": "Microsoft.CognitiveServices.ArcDeployments.list", "azure.mgmt.cognitiveservices.operations.AgentApplicationsOperations.get": "Microsoft.CognitiveServices.AgentApplications.get", "azure.mgmt.cognitiveservices.aio.operations.AgentApplicationsOperations.get": "Microsoft.CognitiveServices.AgentApplications.get", "azure.mgmt.cognitiveservices.operations.AgentApplicationsOperations.begin_create_or_update": "Microsoft.CognitiveServices.AgentApplications.createOrUpdate", @@ -614,70 +488,8 @@ "azure.mgmt.cognitiveservices.aio.operations.AgentApplicationsOperations.enable": "Microsoft.CognitiveServices.AgentApplications.enable", "azure.mgmt.cognitiveservices.operations.AgentApplicationsOperations.disable": "Microsoft.CognitiveServices.AgentApplications.disable", "azure.mgmt.cognitiveservices.aio.operations.AgentApplicationsOperations.disable": "Microsoft.CognitiveServices.AgentApplications.disable", - "azure.mgmt.cognitiveservices.operations.ManagedComputeDeploymentsOperations.get": "Microsoft.CognitiveServices.ManagedComputeDeployments.get", - "azure.mgmt.cognitiveservices.aio.operations.ManagedComputeDeploymentsOperations.get": "Microsoft.CognitiveServices.ManagedComputeDeployments.get", - "azure.mgmt.cognitiveservices.operations.ManagedComputeDeploymentsOperations.begin_create_or_update": "Microsoft.CognitiveServices.ManagedComputeDeployments.createOrUpdate", - "azure.mgmt.cognitiveservices.aio.operations.ManagedComputeDeploymentsOperations.begin_create_or_update": "Microsoft.CognitiveServices.ManagedComputeDeployments.createOrUpdate", - "azure.mgmt.cognitiveservices.operations.ManagedComputeDeploymentsOperations.begin_update": "Microsoft.CognitiveServices.ManagedComputeDeployments.update", - "azure.mgmt.cognitiveservices.aio.operations.ManagedComputeDeploymentsOperations.begin_update": "Microsoft.CognitiveServices.ManagedComputeDeployments.update", - "azure.mgmt.cognitiveservices.operations.ManagedComputeDeploymentsOperations.begin_delete": "Microsoft.CognitiveServices.ManagedComputeDeployments.delete", - "azure.mgmt.cognitiveservices.aio.operations.ManagedComputeDeploymentsOperations.begin_delete": "Microsoft.CognitiveServices.ManagedComputeDeployments.delete", - "azure.mgmt.cognitiveservices.operations.ManagedComputeDeploymentsOperations.list": "Microsoft.CognitiveServices.ManagedComputeDeployments.list", - "azure.mgmt.cognitiveservices.aio.operations.ManagedComputeDeploymentsOperations.list": "Microsoft.CognitiveServices.ManagedComputeDeployments.list", - "azure.mgmt.cognitiveservices.operations.AdapterDeploymentsOperations.get": "Microsoft.CognitiveServices.AdapterDeployments.get", - "azure.mgmt.cognitiveservices.aio.operations.AdapterDeploymentsOperations.get": "Microsoft.CognitiveServices.AdapterDeployments.get", - "azure.mgmt.cognitiveservices.operations.AdapterDeploymentsOperations.begin_create_or_update": "Microsoft.CognitiveServices.AdapterDeployments.createOrUpdate", - "azure.mgmt.cognitiveservices.aio.operations.AdapterDeploymentsOperations.begin_create_or_update": "Microsoft.CognitiveServices.AdapterDeployments.createOrUpdate", - "azure.mgmt.cognitiveservices.operations.AdapterDeploymentsOperations.list": "Microsoft.CognitiveServices.AdapterDeployments.list", - "azure.mgmt.cognitiveservices.aio.operations.AdapterDeploymentsOperations.list": "Microsoft.CognitiveServices.AdapterDeployments.list", - "azure.mgmt.cognitiveservices.operations.AdapterDeploymentsOperations.begin_delete": "Microsoft.CognitiveServices.AdapterDeployments.delete", - "azure.mgmt.cognitiveservices.aio.operations.AdapterDeploymentsOperations.begin_delete": "Microsoft.CognitiveServices.AdapterDeployments.delete", - "azure.mgmt.cognitiveservices.operations.ComputeOperationsOperations.get": "Microsoft.CognitiveServices.ComputeOperations.get", - "azure.mgmt.cognitiveservices.aio.operations.ComputeOperationsOperations.get": "Microsoft.CognitiveServices.ComputeOperations.get", - "azure.mgmt.cognitiveservices.operations.ManagedComputeUsagesOperationGroupOperations.list": "Microsoft.CognitiveServices.ManagedComputeUsagesOperationGroup.list", - "azure.mgmt.cognitiveservices.aio.operations.ManagedComputeUsagesOperationGroupOperations.list": "Microsoft.CognitiveServices.ManagedComputeUsagesOperationGroup.list", - "azure.mgmt.cognitiveservices.operations.ComputesOperations.get": "Microsoft.CognitiveServices.Computes.get", - "azure.mgmt.cognitiveservices.aio.operations.ComputesOperations.get": "Microsoft.CognitiveServices.Computes.get", - "azure.mgmt.cognitiveservices.operations.ComputesOperations.begin_create_or_update": "Microsoft.CognitiveServices.Computes.createOrUpdate", - "azure.mgmt.cognitiveservices.aio.operations.ComputesOperations.begin_create_or_update": "Microsoft.CognitiveServices.Computes.createOrUpdate", - "azure.mgmt.cognitiveservices.operations.ComputesOperations.begin_delete": "Microsoft.CognitiveServices.Computes.delete", - "azure.mgmt.cognitiveservices.aio.operations.ComputesOperations.begin_delete": "Microsoft.CognitiveServices.Computes.delete", - "azure.mgmt.cognitiveservices.operations.ComputesOperations.list": "Microsoft.CognitiveServices.Computes.list", - "azure.mgmt.cognitiveservices.aio.operations.ComputesOperations.list": "Microsoft.CognitiveServices.Computes.list", - "azure.mgmt.cognitiveservices.operations.ComputesOperations.begin_start": "Microsoft.CognitiveServices.Computes.start", - "azure.mgmt.cognitiveservices.aio.operations.ComputesOperations.begin_start": "Microsoft.CognitiveServices.Computes.start", - "azure.mgmt.cognitiveservices.operations.ComputesOperations.begin_stop": "Microsoft.CognitiveServices.Computes.stop", - "azure.mgmt.cognitiveservices.aio.operations.ComputesOperations.begin_stop": "Microsoft.CognitiveServices.Computes.stop", - "azure.mgmt.cognitiveservices.operations.ComputesOperations.begin_restart": "Microsoft.CognitiveServices.Computes.restart", - "azure.mgmt.cognitiveservices.aio.operations.ComputesOperations.begin_restart": "Microsoft.CognitiveServices.Computes.restart", - "azure.mgmt.cognitiveservices.operations.WorkbenchesOperations.get": "Microsoft.CognitiveServices.Workbenches.get", - "azure.mgmt.cognitiveservices.aio.operations.WorkbenchesOperations.get": "Microsoft.CognitiveServices.Workbenches.get", - "azure.mgmt.cognitiveservices.operations.WorkbenchesOperations.begin_create_or_update": "Microsoft.CognitiveServices.Workbenches.createOrUpdate", - "azure.mgmt.cognitiveservices.aio.operations.WorkbenchesOperations.begin_create_or_update": "Microsoft.CognitiveServices.Workbenches.createOrUpdate", - "azure.mgmt.cognitiveservices.operations.WorkbenchesOperations.update": "Microsoft.CognitiveServices.Workbenches.update", - "azure.mgmt.cognitiveservices.aio.operations.WorkbenchesOperations.update": "Microsoft.CognitiveServices.Workbenches.update", - "azure.mgmt.cognitiveservices.operations.WorkbenchesOperations.begin_delete": "Microsoft.CognitiveServices.Workbenches.delete", - "azure.mgmt.cognitiveservices.aio.operations.WorkbenchesOperations.begin_delete": "Microsoft.CognitiveServices.Workbenches.delete", - "azure.mgmt.cognitiveservices.operations.WorkbenchesOperations.list": "Microsoft.CognitiveServices.Workbenches.list", - "azure.mgmt.cognitiveservices.aio.operations.WorkbenchesOperations.list": "Microsoft.CognitiveServices.Workbenches.list", - "azure.mgmt.cognitiveservices.operations.WorkbenchesOperations.begin_start": "Microsoft.CognitiveServices.Workbenches.start", - "azure.mgmt.cognitiveservices.aio.operations.WorkbenchesOperations.begin_start": "Microsoft.CognitiveServices.Workbenches.start", - "azure.mgmt.cognitiveservices.operations.WorkbenchesOperations.begin_stop": "Microsoft.CognitiveServices.Workbenches.stop", - "azure.mgmt.cognitiveservices.aio.operations.WorkbenchesOperations.begin_stop": "Microsoft.CognitiveServices.Workbenches.stop", - "azure.mgmt.cognitiveservices.operations.WorkbenchesOperations.begin_restart": "Microsoft.CognitiveServices.Workbenches.restart", - "azure.mgmt.cognitiveservices.aio.operations.WorkbenchesOperations.begin_restart": "Microsoft.CognitiveServices.Workbenches.restart", "azure.mgmt.cognitiveservices.operations.ManagedComputeCapacitiesOperations.list": "Microsoft.CognitiveServices.ManagedComputeCapacities.list", "azure.mgmt.cognitiveservices.aio.operations.ManagedComputeCapacitiesOperations.list": "Microsoft.CognitiveServices.ManagedComputeCapacities.list", - "azure.mgmt.cognitiveservices.operations.CostControlsOperations.get": "Microsoft.CognitiveServices.CostControls.get", - "azure.mgmt.cognitiveservices.aio.operations.CostControlsOperations.get": "Microsoft.CognitiveServices.CostControls.get", - "azure.mgmt.cognitiveservices.operations.CostControlsOperations.create_or_update": "Microsoft.CognitiveServices.CostControls.createOrUpdate", - "azure.mgmt.cognitiveservices.aio.operations.CostControlsOperations.create_or_update": "Microsoft.CognitiveServices.CostControls.createOrUpdate", - "azure.mgmt.cognitiveservices.operations.CostControlsOperations.update": "Microsoft.CognitiveServices.CostControls.update", - "azure.mgmt.cognitiveservices.aio.operations.CostControlsOperations.update": "Microsoft.CognitiveServices.CostControls.update", - "azure.mgmt.cognitiveservices.operations.CostControlsOperations.delete": "Microsoft.CognitiveServices.CostControls.delete", - "azure.mgmt.cognitiveservices.aio.operations.CostControlsOperations.delete": "Microsoft.CognitiveServices.CostControls.delete", - "azure.mgmt.cognitiveservices.operations.CostControlsOperations.list": "Microsoft.CognitiveServices.CostControls.list", - "azure.mgmt.cognitiveservices.aio.operations.CostControlsOperations.list": "Microsoft.CognitiveServices.CostControls.list", "azure.mgmt.cognitiveservices.operations.PrivateLinkResourcesOperations.list": "Microsoft.CognitiveServices.Accounts.privateLinkResourcesList", "azure.mgmt.cognitiveservices.aio.operations.PrivateLinkResourcesOperations.list": "Microsoft.CognitiveServices.Accounts.privateLinkResourcesList", "azure.mgmt.cognitiveservices.operations.TestRaiExternalSafetyProviderOperations.create_or_update": "Microsoft.CognitiveServices.Accounts.createOrUpdate", @@ -761,5 +573,5 @@ "azure.mgmt.cognitiveservices.CognitiveServicesManagementClient.calculate_model_capacity": "Microsoft.CognitiveServices.calculateModelCapacity", "azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient.calculate_model_capacity": "Microsoft.CognitiveServices.calculateModelCapacity" }, - "CrossLanguageVersion": "2d5b65e6b610" + "CrossLanguageVersion": "ee2b7c93a519" } \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_client.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_client.py index 0b11b18a456c..30d9b42d2962 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_client.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_client.py @@ -23,23 +23,16 @@ AccountCapabilityHostsOperations, AccountConnectionsOperations, AccountsOperations, - AdapterDeploymentsOperations, AgentApplicationsOperations, AgentDeploymentsOperations, - ArcDeploymentsOperations, CommitmentPlansOperations, CommitmentTiersOperations, - ComputeOperationsOperations, - ComputesOperations, - CostControlsOperations, DefenderForAISettingsOperations, DeletedAccountsOperations, DeploymentsOperations, EncryptionScopesOperations, LocationBasedModelCapacitiesOperations, ManagedComputeCapacitiesOperations, - ManagedComputeDeploymentsOperations, - ManagedComputeUsagesOperationGroupOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsOperations, ModelCapacitiesOperations, @@ -54,21 +47,18 @@ ProjectConnectionsOperations, ProjectsOperations, QuotaTiersOperations, - RaiBindingsOperations, RaiBlocklistItemsOperations, RaiBlocklistsOperations, RaiContentFiltersOperations, RaiExternalSafetyProviderOperations, RaiExternalSafetyProvidersOperations, RaiPoliciesOperations, - RaiRegosOperations, RaiToolLabelsOperations, RaiTopicsOperations, ResourceSkusOperations, SubscriptionRaiPolicyOperations, TestRaiExternalSafetyProviderOperations, UsagesOperations, - WorkbenchesOperations, _CognitiveServicesManagementClientOperationsMixin, ) @@ -107,10 +97,6 @@ class CognitiveServicesManagementClient( :ivar subscription_rai_policy: SubscriptionRaiPolicyOperations operations :vartype subscription_rai_policy: azure.mgmt.cognitiveservices.operations.SubscriptionRaiPolicyOperations - :ivar rai_regos: RaiRegosOperations operations - :vartype rai_regos: azure.mgmt.cognitiveservices.operations.RaiRegosOperations - :ivar rai_bindings: RaiBindingsOperations operations - :vartype rai_bindings: azure.mgmt.cognitiveservices.operations.RaiBindingsOperations :ivar rai_blocklist_items: RaiBlocklistItemsOperations operations :vartype rai_blocklist_items: azure.mgmt.cognitiveservices.operations.RaiBlocklistItemsOperations @@ -140,33 +126,12 @@ class CognitiveServicesManagementClient( azure.mgmt.cognitiveservices.operations.ProjectCapabilityHostsOperations :ivar quota_tiers: QuotaTiersOperations operations :vartype quota_tiers: azure.mgmt.cognitiveservices.operations.QuotaTiersOperations - :ivar arc_deployments: ArcDeploymentsOperations operations - :vartype arc_deployments: azure.mgmt.cognitiveservices.operations.ArcDeploymentsOperations :ivar agent_applications: AgentApplicationsOperations operations :vartype agent_applications: azure.mgmt.cognitiveservices.operations.AgentApplicationsOperations - :ivar managed_compute_deployments: ManagedComputeDeploymentsOperations operations - :vartype managed_compute_deployments: - azure.mgmt.cognitiveservices.operations.ManagedComputeDeploymentsOperations - :ivar adapter_deployments: AdapterDeploymentsOperations operations - :vartype adapter_deployments: - azure.mgmt.cognitiveservices.operations.AdapterDeploymentsOperations - :ivar compute_operations: ComputeOperationsOperations operations - :vartype compute_operations: - azure.mgmt.cognitiveservices.operations.ComputeOperationsOperations - :ivar managed_compute_usages_operation_group: ManagedComputeUsagesOperationGroupOperations - operations - :vartype managed_compute_usages_operation_group: - azure.mgmt.cognitiveservices.operations.ManagedComputeUsagesOperationGroupOperations - :ivar computes: ComputesOperations operations - :vartype computes: azure.mgmt.cognitiveservices.operations.ComputesOperations - :ivar workbenches: WorkbenchesOperations operations - :vartype workbenches: azure.mgmt.cognitiveservices.operations.WorkbenchesOperations :ivar managed_compute_capacities: ManagedComputeCapacitiesOperations operations :vartype managed_compute_capacities: azure.mgmt.cognitiveservices.operations.ManagedComputeCapacitiesOperations - :ivar cost_controls: CostControlsOperations operations - :vartype cost_controls: azure.mgmt.cognitiveservices.operations.CostControlsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.cognitiveservices.operations.PrivateLinkResourcesOperations @@ -219,10 +184,9 @@ class CognitiveServicesManagementClient( :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-09-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -294,8 +258,6 @@ def __init__( self.subscription_rai_policy = SubscriptionRaiPolicyOperations( self._client, self._config, self._serialize, self._deserialize ) - self.rai_regos = RaiRegosOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_bindings = RaiBindingsOperations(self._client, self._config, self._serialize, self._deserialize) self.rai_blocklist_items = RaiBlocklistItemsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -319,28 +281,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.quota_tiers = QuotaTiersOperations(self._client, self._config, self._serialize, self._deserialize) - self.arc_deployments = ArcDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) self.agent_applications = AgentApplicationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_compute_deployments = ManagedComputeDeploymentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.adapter_deployments = AdapterDeploymentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.compute_operations = ComputeOperationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.managed_compute_usages_operation_group = ManagedComputeUsagesOperationGroupOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.computes = ComputesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workbenches = WorkbenchesOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_compute_capacities = ManagedComputeCapacitiesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.cost_controls = CostControlsOperations(self._client, self._config, self._serialize, self._deserialize) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_configuration.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_configuration.py index 73828dc3583a..38339fe8c016 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_configuration.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_configuration.py @@ -34,10 +34,9 @@ class CognitiveServicesManagementClientConfiguration: # pylint: disable=too-man :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-09-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -49,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-09-15-preview") + api_version: str = kwargs.pop("api_version", "2026-11-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_utils/utils.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_utils/utils.py index 927adb7c8ae2..35c9c836f85f 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_utils/utils.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_utils/utils.py @@ -6,9 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import Generic, Optional, TYPE_CHECKING, TypeVar - -from azure.core import MatchConditions +from typing import Generic, TYPE_CHECKING, TypeVar if TYPE_CHECKING: from .serialization import Deserializer, Serializer @@ -25,33 +23,3 @@ class ClientMixinABC(ABC, Generic[TClient, TConfig]): _config: TConfig _serialize: "Serializer" _deserialize: "Deserializer" - - -def quote_etag(etag: Optional[str]) -> Optional[str]: - if not etag or etag == "*": - return etag - if etag.startswith("W/"): - return etag - if etag.startswith('"') and etag.endswith('"'): - return etag - if etag.startswith("'") and etag.endswith("'"): - return etag - return '"' + etag + '"' - - -def prep_if_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: - if match_condition == MatchConditions.IfNotModified: - if_match = quote_etag(etag) if etag else None - return if_match - if match_condition == MatchConditions.IfPresent: - return "*" - return None - - -def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: - if match_condition == MatchConditions.IfModified: - if_none_match = quote_etag(etag) if etag else None - return if_none_match - if match_condition == MatchConditions.IfMissing: - return "*" - return None diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_version.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_version.py index 32183a8bdbcd..256979095a07 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_version.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "15.0.0b6" +VERSION = "15.0.0" diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/_client.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/_client.py index 681afc521d4e..22a9df2eea16 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/_client.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/_client.py @@ -23,23 +23,16 @@ AccountCapabilityHostsOperations, AccountConnectionsOperations, AccountsOperations, - AdapterDeploymentsOperations, AgentApplicationsOperations, AgentDeploymentsOperations, - ArcDeploymentsOperations, CommitmentPlansOperations, CommitmentTiersOperations, - ComputeOperationsOperations, - ComputesOperations, - CostControlsOperations, DefenderForAISettingsOperations, DeletedAccountsOperations, DeploymentsOperations, EncryptionScopesOperations, LocationBasedModelCapacitiesOperations, ManagedComputeCapacitiesOperations, - ManagedComputeDeploymentsOperations, - ManagedComputeUsagesOperationGroupOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsOperations, ModelCapacitiesOperations, @@ -54,21 +47,18 @@ ProjectConnectionsOperations, ProjectsOperations, QuotaTiersOperations, - RaiBindingsOperations, RaiBlocklistItemsOperations, RaiBlocklistsOperations, RaiContentFiltersOperations, RaiExternalSafetyProviderOperations, RaiExternalSafetyProvidersOperations, RaiPoliciesOperations, - RaiRegosOperations, RaiToolLabelsOperations, RaiTopicsOperations, ResourceSkusOperations, SubscriptionRaiPolicyOperations, TestRaiExternalSafetyProviderOperations, UsagesOperations, - WorkbenchesOperations, _CognitiveServicesManagementClientOperationsMixin, ) @@ -110,10 +100,6 @@ class CognitiveServicesManagementClient( :ivar subscription_rai_policy: SubscriptionRaiPolicyOperations operations :vartype subscription_rai_policy: azure.mgmt.cognitiveservices.aio.operations.SubscriptionRaiPolicyOperations - :ivar rai_regos: RaiRegosOperations operations - :vartype rai_regos: azure.mgmt.cognitiveservices.aio.operations.RaiRegosOperations - :ivar rai_bindings: RaiBindingsOperations operations - :vartype rai_bindings: azure.mgmt.cognitiveservices.aio.operations.RaiBindingsOperations :ivar rai_blocklist_items: RaiBlocklistItemsOperations operations :vartype rai_blocklist_items: azure.mgmt.cognitiveservices.aio.operations.RaiBlocklistItemsOperations @@ -143,33 +129,12 @@ class CognitiveServicesManagementClient( azure.mgmt.cognitiveservices.aio.operations.ProjectCapabilityHostsOperations :ivar quota_tiers: QuotaTiersOperations operations :vartype quota_tiers: azure.mgmt.cognitiveservices.aio.operations.QuotaTiersOperations - :ivar arc_deployments: ArcDeploymentsOperations operations - :vartype arc_deployments: azure.mgmt.cognitiveservices.aio.operations.ArcDeploymentsOperations :ivar agent_applications: AgentApplicationsOperations operations :vartype agent_applications: azure.mgmt.cognitiveservices.aio.operations.AgentApplicationsOperations - :ivar managed_compute_deployments: ManagedComputeDeploymentsOperations operations - :vartype managed_compute_deployments: - azure.mgmt.cognitiveservices.aio.operations.ManagedComputeDeploymentsOperations - :ivar adapter_deployments: AdapterDeploymentsOperations operations - :vartype adapter_deployments: - azure.mgmt.cognitiveservices.aio.operations.AdapterDeploymentsOperations - :ivar compute_operations: ComputeOperationsOperations operations - :vartype compute_operations: - azure.mgmt.cognitiveservices.aio.operations.ComputeOperationsOperations - :ivar managed_compute_usages_operation_group: ManagedComputeUsagesOperationGroupOperations - operations - :vartype managed_compute_usages_operation_group: - azure.mgmt.cognitiveservices.aio.operations.ManagedComputeUsagesOperationGroupOperations - :ivar computes: ComputesOperations operations - :vartype computes: azure.mgmt.cognitiveservices.aio.operations.ComputesOperations - :ivar workbenches: WorkbenchesOperations operations - :vartype workbenches: azure.mgmt.cognitiveservices.aio.operations.WorkbenchesOperations :ivar managed_compute_capacities: ManagedComputeCapacitiesOperations operations :vartype managed_compute_capacities: azure.mgmt.cognitiveservices.aio.operations.ManagedComputeCapacitiesOperations - :ivar cost_controls: CostControlsOperations operations - :vartype cost_controls: azure.mgmt.cognitiveservices.aio.operations.CostControlsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.cognitiveservices.aio.operations.PrivateLinkResourcesOperations @@ -225,10 +190,9 @@ class CognitiveServicesManagementClient( :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-09-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -302,8 +266,6 @@ def __init__( self.subscription_rai_policy = SubscriptionRaiPolicyOperations( self._client, self._config, self._serialize, self._deserialize ) - self.rai_regos = RaiRegosOperations(self._client, self._config, self._serialize, self._deserialize) - self.rai_bindings = RaiBindingsOperations(self._client, self._config, self._serialize, self._deserialize) self.rai_blocklist_items = RaiBlocklistItemsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -327,28 +289,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.quota_tiers = QuotaTiersOperations(self._client, self._config, self._serialize, self._deserialize) - self.arc_deployments = ArcDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) self.agent_applications = AgentApplicationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_compute_deployments = ManagedComputeDeploymentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.adapter_deployments = AdapterDeploymentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.compute_operations = ComputeOperationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.managed_compute_usages_operation_group = ManagedComputeUsagesOperationGroupOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.computes = ComputesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workbenches = WorkbenchesOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_compute_capacities = ManagedComputeCapacitiesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.cost_controls = CostControlsOperations(self._client, self._config, self._serialize, self._deserialize) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/_configuration.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/_configuration.py index 4bda7cbf16a1..b06fb092b45b 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/_configuration.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/_configuration.py @@ -34,10 +34,9 @@ class CognitiveServicesManagementClientConfiguration: # pylint: disable=too-man :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-09-15-preview" and None. Default value is None. If not set, the operation's default API - version will be used. Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -49,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-09-15-preview") + api_version: str = kwargs.pop("api_version", "2026-11-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/__init__.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/__init__.py index c2f726879a1b..5dd41a3598b2 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/__init__.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/__init__.py @@ -22,8 +22,6 @@ from ._operations import EncryptionScopesOperations # type: ignore from ._operations import RaiPoliciesOperations # type: ignore from ._operations import SubscriptionRaiPolicyOperations # type: ignore -from ._operations import RaiRegosOperations # type: ignore -from ._operations import RaiBindingsOperations # type: ignore from ._operations import RaiBlocklistItemsOperations # type: ignore from ._operations import RaiBlocklistsOperations # type: ignore from ._operations import RaiTopicsOperations # type: ignore @@ -35,16 +33,8 @@ from ._operations import ProjectConnectionsOperations # type: ignore from ._operations import ProjectCapabilityHostsOperations # type: ignore from ._operations import QuotaTiersOperations # type: ignore -from ._operations import ArcDeploymentsOperations # type: ignore from ._operations import AgentApplicationsOperations # type: ignore -from ._operations import ManagedComputeDeploymentsOperations # type: ignore -from ._operations import AdapterDeploymentsOperations # type: ignore -from ._operations import ComputeOperationsOperations # type: ignore -from ._operations import ManagedComputeUsagesOperationGroupOperations # type: ignore -from ._operations import ComputesOperations # type: ignore -from ._operations import WorkbenchesOperations # type: ignore from ._operations import ManagedComputeCapacitiesOperations # type: ignore -from ._operations import CostControlsOperations # type: ignore from ._operations import PrivateLinkResourcesOperations # type: ignore from ._operations import TestRaiExternalSafetyProviderOperations # type: ignore from ._operations import RaiExternalSafetyProviderOperations # type: ignore @@ -78,8 +68,6 @@ "EncryptionScopesOperations", "RaiPoliciesOperations", "SubscriptionRaiPolicyOperations", - "RaiRegosOperations", - "RaiBindingsOperations", "RaiBlocklistItemsOperations", "RaiBlocklistsOperations", "RaiTopicsOperations", @@ -91,16 +79,8 @@ "ProjectConnectionsOperations", "ProjectCapabilityHostsOperations", "QuotaTiersOperations", - "ArcDeploymentsOperations", "AgentApplicationsOperations", - "ManagedComputeDeploymentsOperations", - "AdapterDeploymentsOperations", - "ComputeOperationsOperations", - "ManagedComputeUsagesOperationGroupOperations", - "ComputesOperations", - "WorkbenchesOperations", "ManagedComputeCapacitiesOperations", - "CostControlsOperations", "PrivateLinkResourcesOperations", "TestRaiExternalSafetyProviderOperations", "RaiExternalSafetyProviderOperations", diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_operations.py index 48b49bad5786..45f315900525 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_operations.py @@ -12,13 +12,12 @@ from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse -from azure.core import AsyncPipelineClient, MatchConditions +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, - ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, @@ -51,7 +50,6 @@ build_account_connections_update_request, build_accounts_create_request, build_accounts_delete_request, - build_accounts_evaluate_deployment_policies_request, build_accounts_get_request, build_accounts_list_by_resource_group_request, build_accounts_list_keys_request, @@ -61,10 +59,6 @@ build_accounts_list_usages_request, build_accounts_regenerate_key_request, build_accounts_update_request, - build_adapter_deployments_create_or_update_request, - build_adapter_deployments_delete_request, - build_adapter_deployments_get_request, - build_adapter_deployments_list_request, build_agent_applications_create_or_update_request, build_agent_applications_delete_request, build_agent_applications_disable_request, @@ -78,11 +72,6 @@ build_agent_deployments_list_request, build_agent_deployments_start_request, build_agent_deployments_stop_request, - build_arc_deployments_create_or_update_request, - build_arc_deployments_delete_request, - build_arc_deployments_get_request, - build_arc_deployments_list_request, - build_arc_deployments_update_request, build_cognitive_services_management_calculate_model_capacity_request, build_cognitive_services_management_check_domain_availability_request, build_cognitive_services_management_check_sku_availability_request, @@ -101,19 +90,6 @@ build_commitment_plans_list_request, build_commitment_plans_update_plan_request, build_commitment_tiers_list_request, - build_compute_operations_get_request, - build_computes_create_or_update_request, - build_computes_delete_request, - build_computes_get_request, - build_computes_list_request, - build_computes_restart_request, - build_computes_start_request, - build_computes_stop_request, - build_cost_controls_create_or_update_request, - build_cost_controls_delete_request, - build_cost_controls_get_request, - build_cost_controls_list_request, - build_cost_controls_update_request, build_defender_for_ai_settings_create_or_update_request, build_defender_for_ai_settings_get_request, build_defender_for_ai_settings_list_request, @@ -135,12 +111,6 @@ build_encryption_scopes_list_request, build_location_based_model_capacities_list_request, build_managed_compute_capacities_list_request, - build_managed_compute_deployments_create_or_update_request, - build_managed_compute_deployments_delete_request, - build_managed_compute_deployments_get_request, - build_managed_compute_deployments_list_request, - build_managed_compute_deployments_update_request, - build_managed_compute_usages_operation_group_list_request, build_managed_network_provisions_provision_managed_network_request, build_managed_network_settings_delete_request, build_managed_network_settings_get_request, @@ -181,10 +151,6 @@ build_quota_tiers_get_request, build_quota_tiers_list_by_subscription_request, build_quota_tiers_update_request, - build_rai_bindings_create_or_update_request, - build_rai_bindings_delete_request, - build_rai_bindings_get_request, - build_rai_bindings_list_request, build_rai_blocklist_items_batch_add_request, build_rai_blocklist_items_batch_delete_request, build_rai_blocklist_items_create_or_update_request, @@ -205,10 +171,6 @@ build_rai_policies_delete_request, build_rai_policies_get_request, build_rai_policies_list_request, - build_rai_regos_create_or_update_request, - build_rai_regos_delete_request, - build_rai_regos_get_request, - build_rai_regos_list_request, build_rai_tool_labels_create_or_update_request, build_rai_tool_labels_delete_request, build_rai_tool_labels_get_request, @@ -223,14 +185,6 @@ build_subscription_rai_policy_get_request, build_test_rai_external_safety_provider_create_or_update_request, build_usages_list_request, - build_workbenches_create_or_update_request, - build_workbenches_delete_request, - build_workbenches_get_request, - build_workbenches_list_request, - build_workbenches_restart_request, - build_workbenches_start_request, - build_workbenches_stop_request, - build_workbenches_update_request, ) from .._configuration import CognitiveServicesManagementClientConfiguration @@ -1716,195 +1670,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - @overload - async def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: _models.EvaluateDeploymentPoliciesRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EvaluateDeploymentPoliciesResponse: - """Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EvaluateDeploymentPoliciesResponse. The EvaluateDeploymentPoliciesResponse is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: _types.EvaluateDeploymentPoliciesRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EvaluateDeploymentPoliciesResponse: - """Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.cognitiveservices.types.EvaluateDeploymentPoliciesRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EvaluateDeploymentPoliciesResponse. The EvaluateDeploymentPoliciesResponse is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EvaluateDeploymentPoliciesResponse: - """Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param body: The content of the action request. 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: EvaluateDeploymentPoliciesResponse. The EvaluateDeploymentPoliciesResponse is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: Union[_models.EvaluateDeploymentPoliciesRequest, _types.EvaluateDeploymentPoliciesRequest, IO[bytes]], - **kwargs: Any - ) -> _models.EvaluateDeploymentPoliciesResponse: - """Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param body: The content of the action request. Is either a EvaluateDeploymentPoliciesRequest - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesRequest or - ~azure.mgmt.cognitiveservices.types.EvaluateDeploymentPoliciesRequest or IO[bytes] - :return: EvaluateDeploymentPoliciesResponse. The EvaluateDeploymentPoliciesResponse is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesResponse - :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.EvaluateDeploymentPoliciesResponse] = 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_accounts_evaluate_deployment_policies_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EvaluateDeploymentPoliciesResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - class DeletedAccountsOperations: # pylint: disable=docstring-missing-param """ @@ -6374,7 +6139,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, - api_versions_list=["2026-09-15-preview"], + api_versions_list=["2026-09-15-preview", "2026-11-01"], ) async def get( self, resource_group_name: str, account_name: str, rai_policy_name: str, **kwargs: Any @@ -6441,16 +6206,13 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.RaiPolicy, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @@ -6463,8 +6225,6 @@ async def create_or_update( rai_policy: _models.RaiPolicy, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> _models.RaiPolicy: """Update the state of specified Content Filters associated with the Azure OpenAI account. @@ -6482,11 +6242,6 @@ async def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: @@ -6501,8 +6256,6 @@ async def create_or_update( rai_policy: _types.RaiPolicy, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> _models.RaiPolicy: """Update the state of specified Content Filters associated with the Azure OpenAI account. @@ -6520,11 +6273,6 @@ async def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: @@ -6539,8 +6287,6 @@ async def create_or_update( rai_policy: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> _models.RaiPolicy: """Update the state of specified Content Filters associated with the Azure OpenAI account. @@ -6558,11 +6304,6 @@ async def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: @@ -6580,11 +6321,9 @@ async def create_or_update( "rai_policy_name", "content_type", "accept", - "etag", - "match_condition", ] }, - api_versions_list=["2026-09-15-preview"], + api_versions_list=["2026-09-15-preview", "2026-11-01"], ) async def create_or_update( self, @@ -6592,9 +6331,6 @@ async def create_or_update( account_name: str, rai_policy_name: str, rai_policy: Union[_models.RaiPolicy, _types.RaiPolicy, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any ) -> _models.RaiPolicy: """Update the state of specified Content Filters associated with the Azure OpenAI account. @@ -6611,11 +6347,6 @@ async def create_or_update( IO[bytes] type. Required. :type rai_policy: ~azure.mgmt.cognitiveservices.models.RaiPolicy or ~azure.mgmt.cognitiveservices.types.RaiPolicy or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: @@ -6626,12 +6357,6 @@ async def create_or_update( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6652,8 +6377,6 @@ async def create_or_update( account_name=account_name, rai_policy_name=rai_policy_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -6686,16 +6409,13 @@ async def create_or_update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.RaiPolicy, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @@ -6708,21 +6428,12 @@ async def create_or_update( "resource_group_name", "account_name", "rai_policy_name", - "etag", - "match_condition", ] }, - api_versions_list=["2026-09-15-preview"], + api_versions_list=["2026-09-15-preview", "2026-11-01"], ) async def _delete_initial( - self, - resource_group_name: str, - account_name: str, - rai_policy_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + self, resource_group_name: str, account_name: str, rai_policy_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6730,12 +6441,6 @@ async def _delete_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -6748,8 +6453,6 @@ async def _delete_initial( account_name=account_name, rai_policy_name=rai_policy_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, api_version=self._config.api_version, headers=_headers, params=_params, @@ -6801,21 +6504,12 @@ async def _delete_initial( "resource_group_name", "account_name", "rai_policy_name", - "etag", - "match_condition", ] }, - api_versions_list=["2026-09-15-preview"], + api_versions_list=["2026-09-15-preview", "2026-11-01"], ) async def begin_delete( - self, - resource_group_name: str, - account_name: str, - rai_policy_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + self, resource_group_name: str, account_name: str, rai_policy_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes the specified Content Filters associated with the Azure OpenAI account. @@ -6827,11 +6521,6 @@ async def begin_delete( :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services Account. Required. :type rai_policy_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -6848,8 +6537,6 @@ async def begin_delete( resource_group_name=resource_group_name, account_name=account_name, rai_policy_name=rai_policy_name, - etag=etag, - match_condition=match_condition, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -7329,14 +7016,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class RaiRegosOperations: # pylint: disable=docstring-missing-param +class RaiBlocklistItemsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`rai_regos` attribute. + :attr:`rai_blocklist_items` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -7349,34 +7036,29 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_rego_name", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) async def get( - self, resource_group_name: str, account_name: str, rai_rego_name: str, **kwargs: Any - ) -> _models.RaiRego: - """Gets one reusable Rego artifact. + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_item_name: str, + **kwargs: Any + ) -> _models.RaiBlocklistItem: + """Gets the specified custom blocklist Item associated with the custom blocklist. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :return: RaiRego. The RaiRego is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiRego + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7390,12 +7072,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiRego] = kwargs.pop("cls", None) + cls: ClsType[_models.RaiBlocklistItem] = kwargs.pop("cls", None) - _request = build_rai_regos_get_request( + _request = build_rai_blocklist_items_get_request( resource_group_name=resource_group_name, account_name=account_name, - rai_rego_name=rai_rego_name, + rai_blocklist_name=rai_blocklist_name, + rai_blocklist_item_name=rai_blocklist_item_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -7427,16 +7110,13 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiRego, response.json()) + deserialized = _deserialize(_models.RaiBlocklistItem, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @@ -7445,35 +7125,33 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - rai_rego_name: str, - rai_rego: _models.RaiRego, + rai_blocklist_name: str, + rai_blocklist_item_name: str, + rai_blocklist_item: _models.RaiBlocklistItem, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.RaiRego: - """Creates or replaces one reusable Rego artifact. + ) -> _models.RaiBlocklistItem: + """Update the state of specified blocklist item associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :param rai_rego: The reusable Rego artifact. Required. - :type rai_rego: ~azure.mgmt.cognitiveservices.models.RaiRego + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :param rai_blocklist_item: Properties describing the custom blocklist. Required. + :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiRego. The RaiRego is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiRego + :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7482,35 +7160,33 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - rai_rego_name: str, - rai_rego: _types.RaiRego, + rai_blocklist_name: str, + rai_blocklist_item_name: str, + rai_blocklist_item: _types.RaiBlocklistItem, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.RaiRego: - """Creates or replaces one reusable Rego artifact. + ) -> _models.RaiBlocklistItem: + """Update the state of specified blocklist item associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :param rai_rego: The reusable Rego artifact. Required. - :type rai_rego: ~azure.mgmt.cognitiveservices.types.RaiRego + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :param rai_blocklist_item: Properties describing the custom blocklist. Required. + :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.types.RaiBlocklistItem :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiRego. The RaiRego is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiRego + :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7519,87 +7195,65 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - rai_rego_name: str, - rai_rego: IO[bytes], + rai_blocklist_name: str, + rai_blocklist_item_name: str, + rai_blocklist_item: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.RaiRego: - """Creates or replaces one reusable Rego artifact. + ) -> _models.RaiBlocklistItem: + """Update the state of specified blocklist item associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :param rai_rego: The reusable Rego artifact. Required. - :type rai_rego: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiRego. The RaiRego is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiRego - :raises ~azure.core.exceptions.HttpResponseError: - """ + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :param rai_blocklist_item: Properties describing the custom blocklist. Required. + :type rai_blocklist_item: 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: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_rego_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) async def create_or_update( self, resource_group_name: str, account_name: str, - rai_rego_name: str, - rai_rego: Union[_models.RaiRego, _types.RaiRego, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + rai_blocklist_name: str, + rai_blocklist_item_name: str, + rai_blocklist_item: Union[_models.RaiBlocklistItem, _types.RaiBlocklistItem, IO[bytes]], **kwargs: Any - ) -> _models.RaiRego: - """Creates or replaces one reusable Rego artifact. + ) -> _models.RaiBlocklistItem: + """Update the state of specified blocklist item associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :param rai_rego: The reusable Rego artifact. Is either a RaiRego type or a IO[bytes] type. - Required. - :type rai_rego: ~azure.mgmt.cognitiveservices.models.RaiRego or - ~azure.mgmt.cognitiveservices.types.RaiRego or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiRego. The RaiRego is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiRego + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :param rai_blocklist_item: Properties describing the custom blocklist. Is either a + RaiBlocklistItem type or a IO[bytes] type. Required. + :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem or + ~azure.mgmt.cognitiveservices.types.RaiBlocklistItem or IO[bytes] + :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7608,34 +7262,27 @@ async def create_or_update( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError 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.RaiRego] = kwargs.pop("cls", None) + cls: ClsType[_models.RaiBlocklistItem] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(rai_rego, (IOBase, bytes)): - _content = rai_rego + if isinstance(rai_blocklist_item, (IOBase, bytes)): + _content = rai_blocklist_item else: - _content = json.dumps(rai_rego, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(rai_blocklist_item, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_rai_regos_create_or_update_request( + _request = build_rai_blocklist_items_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - rai_rego_name=rai_rego_name, + rai_blocklist_name=rai_blocklist_name, + rai_blocklist_item_name=rai_blocklist_item_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -7668,89 +7315,43 @@ async def create_or_update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiRego, response.json()) + deserialized = _deserialize(_models.RaiBlocklistItem, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_rego_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def delete( + async def _delete_initial( self, resource_group_name: str, account_name: str, - rai_rego_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + rai_blocklist_name: str, + rai_blocklist_item_name: str, **kwargs: Any - ) -> None: - """Deletes one reusable Rego artifact. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_rai_regos_delete_request( + _request = build_rai_blocklist_items_delete_request( resource_group_name=resource_group_name, account_name=account_name, - rai_rego_name=rai_rego_name, + rai_blocklist_name=rai_blocklist_name, + rai_blocklist_item_name=rai_blocklist_item_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7760,14 +7361,19 @@ async def delete( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [200, 204]: + if response.status_code not in [202, 204]: + 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.ErrorResponse, @@ -7775,45 +7381,113 @@ async def delete( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_item_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified blocklist Item associated with the custom blocklist. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = 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._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + rai_blocklist_name=rai_blocklist_name, + rai_blocklist_item_name=rai_blocklist_item_name, + 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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "top", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) def list( - self, resource_group_name: str, account_name: str, *, top: Optional[int] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.RaiRego"]: - """Lists reusable Rego artifacts on an account. + self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.RaiBlocklistItem"]: + """Gets the blocklist items associated with the custom blocklist. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :keyword top: The maximum number of reusable Rego artifacts to return. Defaults to 10. Default - value is None. - :paramtype top: int - :return: An iterator like instance of RaiRego - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiRego] + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :return: An iterator like instance of RaiBlocklistItem + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiBlocklistItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RaiRego]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RaiBlocklistItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7826,11 +7500,11 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_rai_regos_list_request( + _request = build_rai_blocklist_items_list_request( resource_group_name=resource_group_name, account_name=account_name, + rai_blocklist_name=rai_blocklist_name, subscription_id=self._config.subscription_id, - top=top, api_version=self._config.api_version, headers=_headers, params=_params, @@ -7870,7 +7544,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RaiRego], + List[_models.RaiBlocklistItem], deserialized.get("value", []), ) if cls: @@ -7898,277 +7572,129 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - -class RaiBindingsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`rai_bindings` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_binding_name", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def get( - self, resource_group_name: str, account_name: str, rai_binding_name: str, **kwargs: Any - ) -> _models.RaiBinding: - """Gets one RAI binding. + @overload + async def batch_add( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_items: List[_models.RaiBlocklistItemBulkRequest], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RaiBlocklist: + """Batch operation to add blocklist items. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :return: RaiBinding. The RaiBinding is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBinding - :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.RaiBinding] = kwargs.pop("cls", None) - - _request = build_rai_bindings_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_binding_name=rai_binding_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiBinding, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: _models.RaiBinding, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.RaiBinding: - """Creates or replaces one RAI binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :param rai_binding: The RAI binding. Required. - :type rai_binding: ~azure.mgmt.cognitiveservices.models.RaiBinding + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items: Properties describing the custom blocklist items. Required. + :type rai_blocklist_items: + list[~azure.mgmt.cognitiveservices.models.RaiBlocklistItemBulkRequest] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiBinding. The RaiBinding is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBinding + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( + async def batch_add( self, resource_group_name: str, account_name: str, - rai_binding_name: str, - rai_binding: _types.RaiBinding, + rai_blocklist_name: str, + rai_blocklist_items: List[_types.RaiBlocklistItemBulkRequest], *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.RaiBinding: - """Creates or replaces one RAI binding. + ) -> _models.RaiBlocklist: + """Batch operation to add blocklist items. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :param rai_binding: The RAI binding. Required. - :type rai_binding: ~azure.mgmt.cognitiveservices.types.RaiBinding + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items: Properties describing the custom blocklist items. Required. + :type rai_blocklist_items: + list[~azure.mgmt.cognitiveservices.types.RaiBlocklistItemBulkRequest] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiBinding. The RaiBinding is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBinding + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( + async def batch_add( self, resource_group_name: str, account_name: str, - rai_binding_name: str, - rai_binding: IO[bytes], + rai_blocklist_name: str, + rai_blocklist_items: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.RaiBinding: - """Creates or replaces one RAI binding. + ) -> _models.RaiBlocklist: + """Batch operation to add blocklist items. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :param rai_binding: The RAI binding. Required. - :type rai_binding: IO[bytes] + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items: Properties describing the custom blocklist items. Required. + :type rai_blocklist_items: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiBinding. The RaiBinding is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBinding + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_binding_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def create_or_update( + async def batch_add( self, resource_group_name: str, account_name: str, - rai_binding_name: str, - rai_binding: Union[_models.RaiBinding, _types.RaiBinding, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + rai_blocklist_name: str, + rai_blocklist_items: Union[ + List[_models.RaiBlocklistItemBulkRequest], List[_types.RaiBlocklistItemBulkRequest], IO[bytes] + ], **kwargs: Any - ) -> _models.RaiBinding: - """Creates or replaces one RAI binding. + ) -> _models.RaiBlocklist: + """Batch operation to add blocklist items. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :param rai_binding: The RAI binding. Is either a RaiBinding type or a IO[bytes] type. Required. - :type rai_binding: ~azure.mgmt.cognitiveservices.models.RaiBinding or - ~azure.mgmt.cognitiveservices.types.RaiBinding or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiBinding. The RaiBinding is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBinding + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items: Properties describing the custom blocklist items. Is either a + [RaiBlocklistItemBulkRequest] type or a IO[bytes] type. Required. + :type rai_blocklist_items: + list[~azure.mgmt.cognitiveservices.models.RaiBlocklistItemBulkRequest] or + list[~azure.mgmt.cognitiveservices.types.RaiBlocklistItemBulkRequest] or IO[bytes] + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8177,34 +7703,26 @@ async def create_or_update( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError 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.RaiBinding] = kwargs.pop("cls", None) + cls: ClsType[_models.RaiBlocklist] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(rai_binding, (IOBase, bytes)): - _content = rai_binding + if isinstance(rai_blocklist_items, (IOBase, bytes)): + _content = rai_blocklist_items else: - _content = json.dumps(rai_binding, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(rai_blocklist_items, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_rai_bindings_create_or_update_request( + _request = build_rai_blocklist_items_batch_add_request( resource_group_name=resource_group_name, account_name=account_name, - rai_binding_name=rai_binding_name, + rai_blocklist_name=rai_blocklist_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -8224,7 +7742,7 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -8237,59 +7755,100 @@ async def create_or_update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiBinding, response.json()) + deserialized = _deserialize(_models.RaiBlocklist, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_binding_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def delete( + @overload + async def batch_delete( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_items_names: List[str], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Batch operation to delete blocklist items. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Required. + :type rai_blocklist_items_names: list[str] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def batch_delete( self, resource_group_name: str, account_name: str, - rai_binding_name: str, + rai_blocklist_name: str, + rai_blocklist_items_names: IO[bytes], *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Batch operation to delete blocklist items. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Required. + :type rai_blocklist_items_names: 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def batch_delete( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_items_names: Union[List[str], IO[bytes]], **kwargs: Any ) -> None: - """Deletes one RAI binding. + """Batch operation to delete blocklist items. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Is either a [str] type or + a IO[bytes] type. Required. + :type rai_blocklist_items_names: list[str] or IO[bytes] :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -8300,27 +7859,29 @@ async def delete( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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[None] = kwargs.pop("cls", None) - _request = build_rai_bindings_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(rai_blocklist_items_names, (IOBase, bytes)): + _content = rai_blocklist_items_names + else: + _content = json.dumps(rai_blocklist_items_names, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_rai_blocklist_items_batch_delete_request( resource_group_name=resource_group_name, account_name=account_name, - rai_binding_name=rai_binding_name, + rai_blocklist_name=rai_blocklist_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -8336,7 +7897,7 @@ async def delete( response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -8347,136 +7908,15 @@ async def delete( if cls: return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "top", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def list( - self, resource_group_name: str, account_name: str, *, top: Optional[int] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.RaiBinding"]: - """Lists RAI bindings on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :keyword top: The maximum number of RAI bindings to return. Defaults to 50. Default value is - None. - :paramtype top: int - :return: An iterator like instance of RaiBinding - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiBinding]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_rai_bindings_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - top=top, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiBinding], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - return AsyncItemPaged(get_next, extract_data) - - -class RaiBlocklistItemsOperations: # pylint: disable=docstring-missing-param +class RaiBlocklistsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`rai_blocklist_items` attribute. + :attr:`rai_blocklists` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -8490,14 +7930,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> _models.RaiBlocklistItem: - """Gets the specified custom blocklist Item associated with the custom blocklist. + self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any + ) -> _models.RaiBlocklist: + """Gets the specified custom blocklist associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -8507,11 +7942,8 @@ async def get( :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services Account. Required. :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str - :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8525,13 +7957,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiBlocklistItem] = kwargs.pop("cls", None) + cls: ClsType[_models.RaiBlocklist] = kwargs.pop("cls", None) - _request = build_rai_blocklist_items_get_request( + _request = build_rai_blocklists_get_request( resource_group_name=resource_group_name, account_name=account_name, rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8566,7 +7997,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiBlocklistItem, response.json()) + deserialized = _deserialize(_models.RaiBlocklist, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8579,13 +8010,12 @@ async def create_or_update( resource_group_name: str, account_name: str, rai_blocklist_name: str, - rai_blocklist_item_name: str, - rai_blocklist_item: _models.RaiBlocklistItem, + rai_blocklist: _models.RaiBlocklist, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklistItem: - """Update the state of specified blocklist item associated with the Azure OpenAI account. + ) -> _models.RaiBlocklist: + """Update the state of specified blocklist associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -8595,16 +8025,13 @@ async def create_or_update( :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services Account. Required. :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str - :param rai_blocklist_item: Properties describing the custom blocklist. Required. - :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :param rai_blocklist: Properties describing the custom blocklist. Required. + :type rai_blocklist: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8614,13 +8041,12 @@ async def create_or_update( resource_group_name: str, account_name: str, rai_blocklist_name: str, - rai_blocklist_item_name: str, - rai_blocklist_item: _types.RaiBlocklistItem, + rai_blocklist: _types.RaiBlocklist, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklistItem: - """Update the state of specified blocklist item associated with the Azure OpenAI account. + ) -> _models.RaiBlocklist: + """Update the state of specified blocklist associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -8630,16 +8056,13 @@ async def create_or_update( :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services Account. Required. :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str - :param rai_blocklist_item: Properties describing the custom blocklist. Required. - :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.types.RaiBlocklistItem + :param rai_blocklist: Properties describing the custom blocklist. Required. + :type rai_blocklist: ~azure.mgmt.cognitiveservices.types.RaiBlocklist :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8649,13 +8072,12 @@ async def create_or_update( resource_group_name: str, account_name: str, rai_blocklist_name: str, - rai_blocklist_item_name: str, - rai_blocklist_item: IO[bytes], + rai_blocklist: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklistItem: - """Update the state of specified blocklist item associated with the Azure OpenAI account. + ) -> _models.RaiBlocklist: + """Update the state of specified blocklist associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -8665,16 +8087,13 @@ async def create_or_update( :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services Account. Required. :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str - :param rai_blocklist_item: Properties describing the custom blocklist. Required. - :type rai_blocklist_item: IO[bytes] + :param rai_blocklist: Properties describing the custom blocklist. Required. + :type rai_blocklist: 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: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8684,11 +8103,10 @@ async def create_or_update( resource_group_name: str, account_name: str, rai_blocklist_name: str, - rai_blocklist_item_name: str, - rai_blocklist_item: Union[_models.RaiBlocklistItem, _types.RaiBlocklistItem, IO[bytes]], + rai_blocklist: Union[_models.RaiBlocklist, _types.RaiBlocklist, IO[bytes]], **kwargs: Any - ) -> _models.RaiBlocklistItem: - """Update the state of specified blocklist item associated with the Azure OpenAI account. + ) -> _models.RaiBlocklist: + """Update the state of specified blocklist associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -8698,15 +8116,12 @@ async def create_or_update( :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services Account. Required. :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str - :param rai_blocklist_item: Properties describing the custom blocklist. Is either a - RaiBlocklistItem type or a IO[bytes] type. Required. - :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem or - ~azure.mgmt.cognitiveservices.types.RaiBlocklistItem or IO[bytes] - :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :param rai_blocklist: Properties describing the custom blocklist. Is either a RaiBlocklist type + or a IO[bytes] type. Required. + :type rai_blocklist: ~azure.mgmt.cognitiveservices.models.RaiBlocklist or + ~azure.mgmt.cognitiveservices.types.RaiBlocklist or IO[bytes] + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8721,20 +8136,19 @@ async def create_or_update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiBlocklistItem] = kwargs.pop("cls", None) + cls: ClsType[_models.RaiBlocklist] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(rai_blocklist_item, (IOBase, bytes)): - _content = rai_blocklist_item + if isinstance(rai_blocklist, (IOBase, bytes)): + _content = rai_blocklist else: - _content = json.dumps(rai_blocklist_item, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(rai_blocklist, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_rai_blocklist_items_create_or_update_request( + _request = build_rai_blocklists_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -8771,7 +8185,7 @@ async def create_or_update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiBlocklistItem, response.json()) + deserialized = _deserialize(_models.RaiBlocklist, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8779,12 +8193,7 @@ async def create_or_update( return deserialized # type: ignore async def _delete_initial( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any + self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8799,11 +8208,10 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_rai_blocklist_items_delete_request( + _request = build_rai_blocklists_delete_request( resource_group_name=resource_group_name, account_name=account_name, rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8848,14 +8256,9 @@ async def _delete_initial( @distributed_trace_async async def begin_delete( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any + self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes the specified blocklist Item associated with the custom blocklist. + """Deletes the specified custom blocklist associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -8865,9 +8268,6 @@ async def begin_delete( :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services Account. Required. :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -8884,7 +8284,6 @@ async def begin_delete( resource_group_name=resource_group_name, account_name=account_name, rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -8920,27 +8319,24 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list( - self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.RaiBlocklistItem"]: - """Gets the blocklist items associated with the custom blocklist. + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.RaiBlocklist"]: + """Gets the custom blocklists associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :return: An iterator like instance of RaiBlocklistItem + :return: An iterator like instance of RaiBlocklist :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiBlocklistItem] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiBlocklist] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RaiBlocklistItem]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RaiBlocklist]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8953,10 +8349,9 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_rai_blocklist_items_list_request( + _request = build_rai_blocklists_list_request( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8997,7 +8392,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RaiBlocklistItem], + List[_models.RaiBlocklist], deserialized.get("value", []), ) if cls: @@ -9025,129 +8420,220 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) + +class RaiTopicsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s + :attr:`rai_topics` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any + ) -> _models.RaiTopic: + """Gets the specified custom topic associated with the Azure OpenAI account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services + Account. Required. + :type rai_topic_name: str + :return: RaiTopic. The RaiTopic is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic + :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.RaiTopic] = kwargs.pop("cls", None) + + _request = build_rai_topics_get_request( + resource_group_name=resource_group_name, + account_name=account_name, + rai_topic_name=rai_topic_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RaiTopic, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload - async def batch_add( + async def create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_items: List[_models.RaiBlocklistItemBulkRequest], + rai_topic_name: str, + rai_topic: _models.RaiTopic, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklist: - """Batch operation to add blocklist items. + ) -> _models.RaiTopic: + """Create the rai topic associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items: Properties describing the custom blocklist items. Required. - :type rai_blocklist_items: - list[~azure.mgmt.cognitiveservices.models.RaiBlocklistItemBulkRequest] + :type rai_topic_name: str + :param rai_topic: Properties describing the rai topic. Required. + :type rai_topic: ~azure.mgmt.cognitiveservices.models.RaiTopic :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :return: RaiTopic. The RaiTopic is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def batch_add( + async def create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_items: List[_types.RaiBlocklistItemBulkRequest], + rai_topic_name: str, + rai_topic: _types.RaiTopic, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklist: - """Batch operation to add blocklist items. + ) -> _models.RaiTopic: + """Create the rai topic associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items: Properties describing the custom blocklist items. Required. - :type rai_blocklist_items: - list[~azure.mgmt.cognitiveservices.types.RaiBlocklistItemBulkRequest] + :type rai_topic_name: str + :param rai_topic: Properties describing the rai topic. Required. + :type rai_topic: ~azure.mgmt.cognitiveservices.types.RaiTopic :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :return: RaiTopic. The RaiTopic is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def batch_add( + async def create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_items: IO[bytes], + rai_topic_name: str, + rai_topic: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklist: - """Batch operation to add blocklist items. + ) -> _models.RaiTopic: + """Create the rai topic associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items: Properties describing the custom blocklist items. Required. - :type rai_blocklist_items: IO[bytes] + :type rai_topic_name: str + :param rai_topic: Properties describing the rai topic. Required. + :type rai_topic: 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: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :return: RaiTopic. The RaiTopic is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def batch_add( + async def create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_items: Union[ - List[_models.RaiBlocklistItemBulkRequest], List[_types.RaiBlocklistItemBulkRequest], IO[bytes] - ], + rai_topic_name: str, + rai_topic: Union[_models.RaiTopic, _types.RaiTopic, IO[bytes]], **kwargs: Any - ) -> _models.RaiBlocklist: - """Batch operation to add blocklist items. + ) -> _models.RaiTopic: + """Create the rai topic associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items: Properties describing the custom blocklist items. Is either a - [RaiBlocklistItemBulkRequest] type or a IO[bytes] type. Required. - :type rai_blocklist_items: - list[~azure.mgmt.cognitiveservices.models.RaiBlocklistItemBulkRequest] or - list[~azure.mgmt.cognitiveservices.types.RaiBlocklistItemBulkRequest] or IO[bytes] - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :type rai_topic_name: str + :param rai_topic: Properties describing the rai topic. Is either a RaiTopic type or a IO[bytes] + type. Required. + :type rai_topic: ~azure.mgmt.cognitiveservices.models.RaiTopic or + ~azure.mgmt.cognitiveservices.types.RaiTopic or IO[bytes] + :return: RaiTopic. The RaiTopic is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9162,19 +8648,19 @@ async def batch_add( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiBlocklist] = kwargs.pop("cls", None) + cls: ClsType[_models.RaiTopic] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(rai_blocklist_items, (IOBase, bytes)): - _content = rai_blocklist_items + if isinstance(rai_topic, (IOBase, bytes)): + _content = rai_topic else: - _content = json.dumps(rai_blocklist_items, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(rai_topic, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_rai_blocklist_items_batch_add_request( + _request = build_rai_topics_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, + rai_topic_name=rai_topic_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9195,7 +8681,7 @@ async def batch_add( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -9211,130 +8697,35 @@ async def batch_add( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiBlocklist, response.json()) + deserialized = _deserialize(_models.RaiTopic, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def batch_delete( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_items_names: List[str], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Batch operation to delete blocklist items. + async def _delete_initial( + self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Required. - :type rai_blocklist_items_names: list[str] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def batch_delete( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_items_names: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Batch operation to delete blocklist items. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Required. - :type rai_blocklist_items_names: 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: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def batch_delete( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_items_names: Union[List[str], IO[bytes]], - **kwargs: Any - ) -> None: - """Batch operation to delete blocklist items. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Is either a [str] type or - a IO[bytes] type. Required. - :type rai_blocklist_items_names: list[str] or IO[bytes] - :return: None - :rtype: None - :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 {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(rai_blocklist_items_names, (IOBase, bytes)): - _content = rai_blocklist_items_names - else: - _content = json.dumps(rai_blocklist_items_names, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_rai_blocklist_items_batch_delete_request( + _request = build_rai_topics_delete_request( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, + rai_topic_name=rai_topic_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -9343,14 +8734,19 @@ async def batch_delete( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [204]: + if response.status_code not in [202, 204]: + 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.ErrorResponse, @@ -9358,223 +8754,216 @@ async def batch_delete( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if cls: - return cls(pipeline_response, None, {}) # type: ignore - + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) -class RaiBlocklistsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`rai_blocklists` attribute. - """ + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return deserialized # type: ignore @distributed_trace_async - async def get( - self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any - ) -> _models.RaiBlocklist: - """Gets the specified custom blocklist associated with the Azure OpenAI account. + async def begin_delete( + self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified custom topic associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :type rai_topic_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :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.RaiBlocklist] = kwargs.pop("cls", None) + cls: ClsType[None] = 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._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + rai_topic_name=rai_topic_name, + 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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - _request = build_rai_blocklists_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.RaiBlocklist, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist: _models.RaiBlocklist, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RaiBlocklist: - """Update the state of specified blocklist associated with the Azure OpenAI account. + @distributed_trace + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncItemPaged["_models.RaiTopic"]: + """Gets the custom topics associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist: Properties describing the custom blocklist. Required. - :type rai_blocklist: ~azure.mgmt.cognitiveservices.models.RaiBlocklist - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :return: An iterator like instance of RaiTopic + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiTopic] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist: _types.RaiBlocklist, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RaiBlocklist: - """Update the state of specified blocklist associated with the Azure OpenAI account. + cls: ClsType[List[_models.RaiTopic]] = kwargs.pop("cls", None) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist: Properties describing the custom blocklist. Required. - :type rai_blocklist: ~azure.mgmt.cognitiveservices.types.RaiBlocklist - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist - :raises ~azure.core.exceptions.HttpResponseError: - """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RaiBlocklist: - """Update the state of specified blocklist associated with the Azure OpenAI account. + def prepare_request(next_link=None): + if not next_link: - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist: Properties describing the custom blocklist. Required. - :type rai_blocklist: 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: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist - :raises ~azure.core.exceptions.HttpResponseError: - """ + _request = build_rai_topics_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RaiTopic], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RaiToolLabelsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s + :attr:`rai_tool_labels` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist: Union[_models.RaiBlocklist, _types.RaiBlocklist, IO[bytes]], - **kwargs: Any - ) -> _models.RaiBlocklist: - """Update the state of specified blocklist associated with the Azure OpenAI account. + async def get( + self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any + ) -> _models.RaiToolLabel: + """Gets the specified RAI Tool Label associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist: Properties describing the custom blocklist. Is either a RaiBlocklist type - or a IO[bytes] type. Required. - :type rai_blocklist: ~azure.mgmt.cognitiveservices.models.RaiBlocklist or - ~azure.mgmt.cognitiveservices.types.RaiBlocklist or IO[bytes] - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str + :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9585,27 +8974,17 @@ async def create_or_update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.RaiBlocklist] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(rai_blocklist, (IOBase, bytes)): - _content = rai_blocklist - else: - _content = json.dumps(rai_blocklist, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RaiToolLabel] = kwargs.pop("cls", None) - _request = build_rai_blocklists_create_or_update_request( + _request = build_rai_tool_labels_get_request( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, + rai_tool_connection_name=rai_tool_connection_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -9622,7 +9001,7 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -9638,36 +9017,220 @@ async def create_or_update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiBlocklist, response.json()) + deserialized = _deserialize(_models.RaiToolLabel, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _delete_initial( - self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + @overload + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + rai_tool_connection_name: str, + rai_tool_label: _models.RaiToolLabel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RaiToolLabel: + """Creates the RAI Tool Label associated with the Azure OpenAI account. - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str + :param rai_tool_label: Properties describing the RAI Tool Label. Required. + :type rai_tool_label: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + @overload + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + rai_tool_connection_name: str, + rai_tool_label: _types.RaiToolLabel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RaiToolLabel: + """Creates the RAI Tool Label associated with the Azure OpenAI account. - _request = build_rai_blocklists_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str + :param rai_tool_label: Properties describing the RAI Tool Label. Required. + :type rai_tool_label: ~azure.mgmt.cognitiveservices.types.RaiToolLabel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + rai_tool_connection_name: str, + rai_tool_label: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RaiToolLabel: + """Creates the RAI Tool Label associated with the Azure OpenAI account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str + :param rai_tool_label: Properties describing the RAI Tool Label. Required. + :type rai_tool_label: 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: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + rai_tool_connection_name: str, + rai_tool_label: Union[_models.RaiToolLabel, _types.RaiToolLabel, IO[bytes]], + **kwargs: Any + ) -> _models.RaiToolLabel: + """Creates the RAI Tool Label associated with the Azure OpenAI account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str + :param rai_tool_label: Properties describing the RAI Tool Label. Is either a RaiToolLabel type + or a IO[bytes] type. Required. + :type rai_tool_label: ~azure.mgmt.cognitiveservices.models.RaiToolLabel or + ~azure.mgmt.cognitiveservices.types.RaiToolLabel or IO[bytes] + :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :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.RaiToolLabel] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(rai_tool_label, (IOBase, bytes)): + _content = rai_tool_label + else: + _content = json.dumps(rai_tool_label, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_rai_tool_labels_create_or_update_request( + resource_group_name=resource_group_name, + account_name=account_name, + rai_tool_connection_name=rai_tool_connection_name, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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, 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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RaiToolLabel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, account_name: str, rai_tool_connection_name: 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_rai_tool_labels_delete_request( + resource_group_name=resource_group_name, + account_name=account_name, + rai_tool_connection_name=rai_tool_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, params=_params, ) path_format_arguments = { @@ -9709,18 +9272,17 @@ async def _delete_initial( @distributed_trace_async async def begin_delete( - self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes the specified custom blocklist associated with the Azure OpenAI account. + """Deletes the specified RAI Tool Label associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -9736,7 +9298,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, + rai_tool_connection_name=rai_tool_connection_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -9773,23 +9335,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list( self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.RaiBlocklist"]: - """Gets the custom blocklists associated with the Azure OpenAI account. + ) -> AsyncItemPaged["_models.RaiToolLabel"]: + """Lists all RAI Tool Labels associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :return: An iterator like instance of RaiBlocklist + :return: An iterator like instance of RaiToolLabel :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiBlocklist] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiToolLabel] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RaiBlocklist]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RaiToolLabel]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9802,7 +9364,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_rai_blocklists_list_request( + _request = build_rai_tool_labels_list_request( resource_group_name=resource_group_name, account_name=account_name, subscription_id=self._config.subscription_id, @@ -9845,7 +9407,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RaiBlocklist], + List[_models.RaiToolLabel], deserialized.get("value", []), ) if cls: @@ -9874,14 +9436,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class RaiTopicsOperations: # pylint: disable=docstring-missing-param +class RaiContentFiltersOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`rai_topics` attribute. + :attr:`rai_content_filters` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -9894,21 +9456,15 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get( - self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any - ) -> _models.RaiTopic: - """Gets the specified custom topic associated with the Azure OpenAI account. + async def get(self, location: str, filter_name: str, **kwargs: Any) -> _models.RaiContentFilter: + """Get Content Filters by Name. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :return: RaiTopic. The RaiTopic is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic + :param location: The name of the Azure region. Required. + :type location: str + :param filter_name: The name of the RAI Content Filter. Required. + :type filter_name: str + :return: RaiContentFilter. The RaiContentFilter is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiContentFilter :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -9922,12 +9478,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiTopic] = kwargs.pop("cls", None) + cls: ClsType[_models.RaiContentFilter] = kwargs.pop("cls", None) - _request = build_rai_topics_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_topic_name=rai_topic_name, + _request = build_rai_content_filters_get_request( + location=location, + filter_name=filter_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9962,131 +9517,146 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiTopic, response.json()) + deserialized = _deserialize(_models.RaiContentFilter, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_topic_name: str, - rai_topic: _models.RaiTopic, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RaiTopic: - """Create the rai topic associated with the Azure OpenAI account. + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.RaiContentFilter"]: + """List Content Filters types. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :param rai_topic: Properties describing the rai topic. Required. - :type rai_topic: ~azure.mgmt.cognitiveservices.models.RaiTopic - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RaiTopic. The RaiTopic is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of RaiContentFilter + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiContentFilter] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_topic_name: str, - rai_topic: _types.RaiTopic, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RaiTopic: - """Create the rai topic associated with the Azure OpenAI account. + cls: ClsType[List[_models.RaiContentFilter]] = kwargs.pop("cls", None) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :param rai_topic: Properties describing the rai topic. Required. - :type rai_topic: ~azure.mgmt.cognitiveservices.types.RaiTopic - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RaiTopic. The RaiTopic is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic - :raises ~azure.core.exceptions.HttpResponseError: - """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_topic_name: str, - rai_topic: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RaiTopic: - """Create the rai topic associated with the Azure OpenAI account. + def prepare_request(next_link=None): + if not next_link: - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :param rai_topic: Properties describing the rai topic. Required. - :type rai_topic: 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: RaiTopic. The RaiTopic is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic - :raises ~azure.core.exceptions.HttpResponseError: - """ + _request = build_rai_content_filters_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RaiContentFilter], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=docstring-missing-param,name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s + :attr:`network_security_perimeter_configurations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_topic_name: str, - rai_topic: Union[_models.RaiTopic, _types.RaiTopic, IO[bytes]], - **kwargs: Any - ) -> _models.RaiTopic: - """Create the rai topic associated with the Azure OpenAI account. + async def get( + self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any + ) -> _models.NetworkSecurityPerimeterConfiguration: + """Gets the specified NSP configurations for an account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :param rai_topic: Properties describing the rai topic. Is either a RaiTopic type or a IO[bytes] - type. Required. - :type rai_topic: ~azure.mgmt.cognitiveservices.models.RaiTopic or - ~azure.mgmt.cognitiveservices.types.RaiTopic or IO[bytes] - :return: RaiTopic. The RaiTopic is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic + :param nsp_configuration_name: The name of the NSP Configuration. Required. + :type nsp_configuration_name: str + :return: NetworkSecurityPerimeterConfiguration. The NetworkSecurityPerimeterConfiguration is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10097,27 +9667,17 @@ async def create_or_update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.RaiTopic] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(rai_topic, (IOBase, bytes)): - _content = rai_topic - else: - _content = json.dumps(rai_topic, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) - _request = build_rai_topics_create_or_update_request( + _request = build_network_security_perimeter_configurations_get_request( resource_group_name=resource_group_name, account_name=account_name, - rai_topic_name=rai_topic_name, + nsp_configuration_name=nsp_configuration_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -10134,7 +9694,7 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -10150,16 +9710,34 @@ async def create_or_update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiTopic, response.json()) + deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _delete_initial( - self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + @distributed_trace + def list( + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NetworkSecurityPerimeterConfiguration"]: + """Gets a list of NSP configurations for an account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: An iterator like instance of NetworkSecurityPerimeterConfiguration + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkSecurityPerimeterConfiguration]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -10168,15 +9746,100 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + _request = build_network_security_perimeter_configurations_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _request = build_rai_topics_delete_request( + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkSecurityPerimeterConfiguration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _reconcile_initial( + self, resource_group_name: str, account_name: str, nsp_configuration_name: 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_network_security_perimeter_configurations_reconcile_request( resource_group_name=resource_group_name, account_name=account_name, - rai_topic_name=rai_topic_name, + nsp_configuration_name=nsp_configuration_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10195,7 +9858,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -10220,35 +9883,36 @@ async def _delete_initial( return deserialized # type: ignore @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified custom topic associated with the Azure OpenAI account. + async def begin_reconcile( + self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration]: + """Reconcile the NSP configuration for an account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param nsp_configuration_name: The name of the NSP Configuration. Required. + :type nsp_configuration_name: str + :return: An instance of AsyncLROPoller that returns NetworkSecurityPerimeterConfiguration. The + NetworkSecurityPerimeterConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = 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._delete_initial( + raw_result = await self._reconcile_initial( resource_group_name=resource_group_name, account_name=account_name, - rai_topic_name=rai_topic_name, + nsp_configuration_name=nsp_configuration_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10257,9 +9921,12 @@ async def begin_delete( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -10274,123 +9941,25 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncItemPaged["_models.RaiTopic"]: - """Gets the custom topics associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of RaiTopic - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiTopic] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiTopic]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_rai_topics_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiTopic], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) + return AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) -class RaiToolLabelsOperations: # pylint: disable=docstring-missing-param +class DefenderForAISettingsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`rai_tool_labels` attribute. + :attr:`defender_for_ai_settings` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -10404,19 +9973,19 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( - self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any - ) -> _models.RaiToolLabel: - """Gets the specified RAI Tool Label associated with the Azure OpenAI account. + self, resource_group_name: str, account_name: str, defender_for_ai_setting_name: str, **kwargs: Any + ) -> _models.DefenderForAISetting: + """Gets the specified Defender for AI setting by name. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10430,12 +9999,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiToolLabel] = kwargs.pop("cls", None) + cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) - _request = build_rai_tool_labels_get_request( + _request = build_defender_for_ai_settings_get_request( resource_group_name=resource_group_name, account_name=account_name, - rai_tool_connection_name=rai_tool_connection_name, + defender_for_ai_setting_name=defender_for_ai_setting_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10470,7 +10039,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiToolLabel, response.json()) + deserialized = _deserialize(_models.DefenderForAISetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -10482,28 +10051,28 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - rai_tool_connection_name: str, - rai_tool_label: _models.RaiToolLabel, + defender_for_ai_setting_name: str, + defender_for_ai_settings: _models.DefenderForAISetting, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiToolLabel: - """Creates the RAI Tool Label associated with the Azure OpenAI account. + ) -> _models.DefenderForAISetting: + """Creates or Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :param rai_tool_label: Properties describing the RAI Tool Label. Required. - :type rai_tool_label: ~azure.mgmt.cognitiveservices.models.RaiToolLabel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". :paramtype content_type: str - :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ @@ -10512,28 +10081,28 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - rai_tool_connection_name: str, - rai_tool_label: _types.RaiToolLabel, + defender_for_ai_setting_name: str, + defender_for_ai_settings: _types.DefenderForAISetting, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiToolLabel: - """Creates the RAI Tool Label associated with the Azure OpenAI account. + ) -> _models.DefenderForAISetting: + """Creates or Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :param rai_tool_label: Properties describing the RAI Tool Label. Required. - :type rai_tool_label: ~azure.mgmt.cognitiveservices.types.RaiToolLabel + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.types.DefenderForAISetting :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ @@ -10542,28 +10111,28 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - rai_tool_connection_name: str, - rai_tool_label: IO[bytes], + defender_for_ai_setting_name: str, + defender_for_ai_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiToolLabel: - """Creates the RAI Tool Label associated with the Azure OpenAI account. + ) -> _models.DefenderForAISetting: + """Creates or Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :param rai_tool_label: Properties describing the RAI Tool Label. Required. - :type rai_tool_label: IO[bytes] + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: 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: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ @@ -10572,25 +10141,25 @@ async def create_or_update( self, resource_group_name: str, account_name: str, - rai_tool_connection_name: str, - rai_tool_label: Union[_models.RaiToolLabel, _types.RaiToolLabel, IO[bytes]], + defender_for_ai_setting_name: str, + defender_for_ai_settings: Union[_models.DefenderForAISetting, _types.DefenderForAISetting, IO[bytes]], **kwargs: Any - ) -> _models.RaiToolLabel: - """Creates the RAI Tool Label associated with the Azure OpenAI account. + ) -> _models.DefenderForAISetting: + """Creates or Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :param rai_tool_label: Properties describing the RAI Tool Label. Is either a RaiToolLabel type - or a IO[bytes] type. Required. - :type rai_tool_label: ~azure.mgmt.cognitiveservices.models.RaiToolLabel or - ~azure.mgmt.cognitiveservices.types.RaiToolLabel or IO[bytes] - :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Is either a + DefenderForAISetting type or a IO[bytes] type. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting or + ~azure.mgmt.cognitiveservices.types.DefenderForAISetting or IO[bytes] + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10605,19 +10174,19 @@ async def create_or_update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiToolLabel] = kwargs.pop("cls", None) + cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(rai_tool_label, (IOBase, bytes)): - _content = rai_tool_label + if isinstance(defender_for_ai_settings, (IOBase, bytes)): + _content = defender_for_ai_settings else: - _content = json.dumps(rai_tool_label, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(defender_for_ai_settings, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_rai_tool_labels_create_or_update_request( + _request = build_defender_for_ai_settings_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - rai_tool_connection_name=rai_tool_connection_name, + defender_for_ai_setting_name=defender_for_ai_setting_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -10654,16 +10223,129 @@ async def create_or_update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiToolLabel, response.json()) + deserialized = _deserialize(_models.DefenderForAISetting, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _delete_initial( - self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + @overload + async def update( + self, + resource_group_name: str, + account_name: str, + defender_for_ai_setting_name: str, + defender_for_ai_settings: _models.DefenderForAISetting, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DefenderForAISetting: + """Updates the specified Defender for AI setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + account_name: str, + defender_for_ai_setting_name: str, + defender_for_ai_settings: _types.DefenderForAISetting, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DefenderForAISetting: + """Updates the specified Defender for AI setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.types.DefenderForAISetting + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + account_name: str, + defender_for_ai_setting_name: str, + defender_for_ai_settings: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DefenderForAISetting: + """Updates the specified Defender for AI setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: 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: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + account_name: str, + defender_for_ai_setting_name: str, + defender_for_ai_settings: Union[_models.DefenderForAISetting, _types.DefenderForAISetting, IO[bytes]], + **kwargs: Any + ) -> _models.DefenderForAISetting: + """Updates the specified Defender for AI setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Is either a + DefenderForAISetting type or a IO[bytes] type. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting or + ~azure.mgmt.cognitiveservices.types.DefenderForAISetting or IO[bytes] + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -10672,17 +10354,27 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) - _request = build_rai_tool_labels_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(defender_for_ai_settings, (IOBase, bytes)): + _content = defender_for_ai_settings + else: + _content = json.dumps(defender_for_ai_settings, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_defender_for_ai_settings_update_request( resource_group_name=resource_group_name, account_name=account_name, - rai_tool_connection_name=rai_tool_connection_name, + defender_for_ai_setting_name=defender_for_ai_setting_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -10692,18 +10384,19 @@ async def _delete_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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 [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -10711,100 +10404,36 @@ async def _delete_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DefenderForAISetting, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - rai_tool_connection_name=rai_tool_connection_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace def list( self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.RaiToolLabel"]: - """Lists all RAI Tool Labels associated with the Azure OpenAI account. + ) -> AsyncItemPaged["_models.DefenderForAISetting"]: + """Lists the Defender for AI settings. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :return: An iterator like instance of RaiToolLabel + :return: An iterator like instance of DefenderForAISetting :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiToolLabel] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.DefenderForAISetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RaiToolLabel]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.DefenderForAISetting]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10817,7 +10446,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_rai_tool_labels_list_request( + _request = build_defender_for_ai_settings_list_request( resource_group_name=resource_group_name, account_name=account_name, subscription_id=self._config.subscription_id, @@ -10860,7 +10489,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RaiToolLabel], + List[_models.DefenderForAISetting], deserialized.get("value", []), ) if cls: @@ -10889,14 +10518,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class RaiContentFiltersOperations: # pylint: disable=docstring-missing-param +class ProjectsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`rai_content_filters` attribute. + :attr:`projects` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -10909,15 +10538,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, location: str, filter_name: str, **kwargs: Any) -> _models.RaiContentFilter: - """Get Content Filters by Name. + async def get( + self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any + ) -> _models.Project: + """Returns a Cognitive Services project specified by the parameters. - :param location: The name of the Azure region. Required. - :type location: str - :param filter_name: The name of the RAI Content Filter. Required. - :type filter_name: str - :return: RaiContentFilter. The RaiContentFilter is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiContentFilter + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :return: Project. The Project is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.Project :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10931,11 +10565,12 @@ async def get(self, location: str, filter_name: str, **kwargs: Any) -> _models.R _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiContentFilter] = kwargs.pop("cls", None) + cls: ClsType[_models.Project] = kwargs.pop("cls", None) - _request = build_rai_content_filters_get_request( - location=location, - filter_name=filter_name, + _request = build_projects_get_request( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10970,29 +10605,21 @@ async def get(self, location: str, filter_name: str, **kwargs: Any) -> _models.R if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiContentFilter, response.json()) + deserialized = _deserialize(_models.Project, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.RaiContentFilter"]: - """List Content Filters types. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of RaiContentFilter - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.RaiContentFilter] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiContentFilter]] = kwargs.pop("cls", None) - + async def _create_initial( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: Union[_models.Project, _types.Project, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -11001,117 +10628,258 @@ def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.RaiConte } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_rai_content_filters_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type = content_type or "application/json" + _content = None + if isinstance(project, (IOBase, bytes)): + _content = project + else: + _content = json.dumps(project, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _request = build_projects_create_request( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiContentFilter], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - async def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200, 201, 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.ErrorResponse, + response, ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return pipeline_response + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - return AsyncItemPaged(get_next, extract_data) + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() -class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=docstring-missing-param,name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`network_security_perimeter_configurations` attribute. - """ + return deserialized # type: ignore - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload + async def begin_create( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: _models.Project, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Project]: + """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give + AI developer it's individual container to work on. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: ~azure.mgmt.cognitiveservices.models.Project + :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 Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: _types.Project, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Project]: + """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give + AI developer it's individual container to work on. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: ~azure.mgmt.cognitiveservices.types.Project + :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 Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Project]: + """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give + AI developer it's individual container to work on. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: 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 Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - async def get( - self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any - ) -> _models.NetworkSecurityPerimeterConfiguration: - """Gets the specified NSP configurations for an account. + async def begin_create( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: Union[_models.Project, _types.Project, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Project]: + """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give + AI developer it's individual container to work on. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param nsp_configuration_name: The name of the NSP Configuration. Required. - :type nsp_configuration_name: str - :return: NetworkSecurityPerimeterConfiguration. The NetworkSecurityPerimeterConfiguration is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Is either a Project type or + a IO[bytes] type. Required. + :type project: ~azure.mgmt.cognitiveservices.models.Project or + ~azure.mgmt.cognitiveservices.types.Project or IO[bytes] + :return: An instance of AsyncLROPoller that returns Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] :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.Project] = 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._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + project=project, + 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 = pipeline_response.http_response + deserialized = _deserialize(_models.Project, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(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.Project].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Project]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: Union[_models.Project, _types.Project, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -11120,17 +10888,27 @@ async def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_network_security_perimeter_configurations_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(project, (IOBase, bytes)): + _content = project + else: + _content = json.dumps(project, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_projects_update_request( resource_group_name=resource_group_name, account_name=account_name, - nsp_configuration_name=nsp_configuration_name, + project_name=project_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -11140,19 +10918,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 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.ErrorResponse, @@ -11160,121 +10937,192 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.NetworkSecurityPerimeterConfiguration"]: - """Gets a list of NSP configurations for an account. + @overload + async def begin_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: _models.Project, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Project]: + """Updates a Cognitive Services Project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :return: An iterator like instance of NetworkSecurityPerimeterConfiguration - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: ~azure.mgmt.cognitiveservices.models.Project + :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 Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ - cls: ClsType[List[_models.NetworkSecurityPerimeterConfiguration]] = kwargs.pop("cls", None) + @overload + async def begin_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: _types.Project, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Project]: + """Updates a Cognitive Services Project. - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: ~azure.mgmt.cognitiveservices.types.Project + :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 Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ - def prepare_request(next_link=None): - if not next_link: + @overload + async def begin_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Project]: + """Updates a Cognitive Services Project. - _request = build_network_security_perimeter_configurations_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: 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 Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: Union[_models.Project, _types.Project, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Project]: + """Updates a Cognitive Services Project. - return _request + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Is either a Project type or + a IO[bytes] type. Required. + :type project: ~azure.mgmt.cognitiveservices.models.Project or + ~azure.mgmt.cognitiveservices.types.Project or IO[bytes] + :return: An instance of AsyncLROPoller that returns Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.NetworkSecurityPerimeterConfiguration], - deserialized.get("value", []), + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Project] = 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._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + project=project, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def get_long_running_output(pipeline_response): response = pipeline_response.http_response + deserialized = _deserialize(_models.Project, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return AsyncItemPaged(get_next, extract_data) + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(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.Project].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Project]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _reconcile_initial( - self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any + async def _delete_initial( + self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11289,10 +11137,10 @@ async def _reconcile_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_network_security_perimeter_configurations_reconcile_request( + _request = build_projects_delete_request( resource_group_name=resource_group_name, account_name=account_name, - nsp_configuration_name=nsp_configuration_name, + project_name=project_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11311,7 +11159,7 @@ async def _reconcile_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -11325,7 +11173,10 @@ async def _reconcile_initial( response_headers = {} if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -11336,36 +11187,34 @@ async def _reconcile_initial( return deserialized # type: ignore @distributed_trace_async - async def begin_reconcile( - self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration]: - """Reconcile the NSP configuration for an account. + async def begin_delete( + self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a Cognitive Services project from the resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param nsp_configuration_name: The name of the NSP Configuration. Required. - :type nsp_configuration_name: str - :return: An instance of AsyncLROPoller that returns NetworkSecurityPerimeterConfiguration. The - NetworkSecurityPerimeterConfiguration is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) + cls: ClsType[None] = 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._reconcile_initial( + raw_result = await self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - nsp_configuration_name=nsp_configuration_name, + project_name=project_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -11374,12 +11223,9 @@ async def begin_reconcile( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -11394,25 +11240,123 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + @distributed_trace + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Project"]: + """Returns all the projects in a Cognitive Services account. -class DefenderForAISettingsOperations: # pylint: disable=docstring-missing-param + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: An iterator like instance of Project + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Project]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_projects_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Project], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ProjectConnectionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`defender_for_ai_settings` attribute. + :attr:`project_connections` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -11426,19 +11370,24 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( - self, resource_group_name: str, account_name: str, defender_for_ai_setting_name: str, **kwargs: Any - ) -> _models.DefenderForAISetting: - """Gets the specified Defender for AI setting by name. + self, resource_group_name: str, account_name: str, project_name: str, connection_name: str, **kwargs: Any + ) -> _models.ConnectionPropertiesV2BasicResource: + """Lists Cognitive Services project connection by name. + + Lists Cognitive Services project connection by name. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11452,12 +11401,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) + cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - _request = build_defender_for_ai_settings_get_request( + _request = build_project_connections_get_request( resource_group_name=resource_group_name, account_name=account_name, - defender_for_ai_setting_name=defender_for_ai_setting_name, + project_name=project_name, + connection_name=connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11492,7 +11442,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DefenderForAISetting, response.json()) + deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -11500,122 +11450,151 @@ async def get( return deserialized # type: ignore @overload - async def create_or_update( + async def create( self, resource_group_name: str, account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: _models.DefenderForAISetting, + project_name: str, + connection_name: str, + connection: Optional[_models.ConnectionPropertiesV2BasicResource] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefenderForAISetting: - """Creates or Updates the specified Defender for AI setting. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Create or update Cognitive Services project connection under the specified project. + + Create or update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: The object for creating or updating a new account connection. Default value + is None. + :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( + async def create( self, resource_group_name: str, account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: _types.DefenderForAISetting, + project_name: str, + connection_name: str, + connection: Optional[_types.ConnectionPropertiesV2BasicResource] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefenderForAISetting: - """Creates or Updates the specified Defender for AI setting. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Create or update Cognitive Services project connection under the specified project. + + Create or update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.types.DefenderForAISetting + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: The object for creating or updating a new account connection. Default value + is None. + :type connection: ~azure.mgmt.cognitiveservices.types.ConnectionPropertiesV2BasicResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( + async def create( self, resource_group_name: str, account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: IO[bytes], + project_name: str, + connection_name: str, + connection: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefenderForAISetting: - """Creates or Updates the specified Defender for AI setting. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Create or update Cognitive Services project connection under the specified project. + + Create or update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: IO[bytes] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: The object for creating or updating a new account connection. Default value + is None. + :type connection: 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: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create_or_update( + async def create( self, resource_group_name: str, account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: Union[_models.DefenderForAISetting, _types.DefenderForAISetting, IO[bytes]], + project_name: str, + connection_name: str, + connection: Optional[ + Union[_models.ConnectionPropertiesV2BasicResource, _types.ConnectionPropertiesV2BasicResource, IO[bytes]] + ] = None, **kwargs: Any - ) -> _models.DefenderForAISetting: - """Creates or Updates the specified Defender for AI setting. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Create or update Cognitive Services project connection under the specified project. + + Create or update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Is either a - DefenderForAISetting type or a IO[bytes] type. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting or - ~azure.mgmt.cognitiveservices.types.DefenderForAISetting or IO[bytes] - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: The object for creating or updating a new account connection. Is either a + ConnectionPropertiesV2BasicResource type or a IO[bytes] type. Default value is None. + :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource or + ~azure.mgmt.cognitiveservices.types.ConnectionPropertiesV2BasicResource or IO[bytes] + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -11627,19 +11606,24 @@ async def create_or_update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) + content_type = content_type if connection else None + cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if connection else None _content = None - if isinstance(defender_for_ai_settings, (IOBase, bytes)): - _content = defender_for_ai_settings + if isinstance(connection, (IOBase, bytes)): + _content = connection else: - _content = json.dumps(defender_for_ai_settings, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if connection is not None: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_defender_for_ai_settings_create_or_update_request( + _request = build_project_connections_create_request( resource_group_name=resource_group_name, account_name=account_name, - defender_for_ai_setting_name=defender_for_ai_setting_name, + project_name=project_name, + connection_name=connection_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -11660,7 +11644,7 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -11676,7 +11660,7 @@ async def create_or_update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DefenderForAISetting, response.json()) + deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -11688,28 +11672,34 @@ async def update( self, resource_group_name: str, account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: _models.DefenderForAISetting, + project_name: str, + connection_name: str, + connection: Optional[_models.ConnectionUpdateContent] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefenderForAISetting: - """Updates the specified Defender for AI setting. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Update Cognitive Services project connection under the specified project. + + Update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: Parameters for account connection update. Default value is None. + :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionUpdateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11718,28 +11708,34 @@ async def update( self, resource_group_name: str, account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: _types.DefenderForAISetting, + project_name: str, + connection_name: str, + connection: Optional[_types.ConnectionUpdateContent] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefenderForAISetting: - """Updates the specified Defender for AI setting. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Update Cognitive Services project connection under the specified project. + + Update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.types.DefenderForAISetting + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: Parameters for account connection update. Default value is None. + :type connection: ~azure.mgmt.cognitiveservices.types.ConnectionUpdateContent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11748,28 +11744,34 @@ async def update( self, resource_group_name: str, account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: IO[bytes], + project_name: str, + connection_name: str, + connection: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefenderForAISetting: - """Updates the specified Defender for AI setting. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Update Cognitive Services project connection under the specified project. + + Update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: IO[bytes] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: Parameters for account connection update. Default value is None. + :type connection: 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: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11778,25 +11780,31 @@ async def update( self, resource_group_name: str, account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: Union[_models.DefenderForAISetting, _types.DefenderForAISetting, IO[bytes]], + project_name: str, + connection_name: str, + connection: Optional[Union[_models.ConnectionUpdateContent, _types.ConnectionUpdateContent, IO[bytes]]] = None, **kwargs: Any - ) -> _models.DefenderForAISetting: - """Updates the specified Defender for AI setting. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Update Cognitive Services project connection under the specified project. + + Update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Is either a - DefenderForAISetting type or a IO[bytes] type. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting or - ~azure.mgmt.cognitiveservices.types.DefenderForAISetting or IO[bytes] - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: Parameters for account connection update. Is either a + ConnectionUpdateContent type or a IO[bytes] type. Default value is None. + :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionUpdateContent or + ~azure.mgmt.cognitiveservices.types.ConnectionUpdateContent or IO[bytes] + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11811,19 +11819,24 @@ async def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) + content_type = content_type if connection else None + cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if connection else None _content = None - if isinstance(defender_for_ai_settings, (IOBase, bytes)): - _content = defender_for_ai_settings + if isinstance(connection, (IOBase, bytes)): + _content = connection else: - _content = json.dumps(defender_for_ai_settings, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + if connection is not None: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_defender_for_ai_settings_update_request( + _request = build_project_connections_update_request( resource_group_name=resource_group_name, account_name=account_name, - defender_for_ai_setting_name=defender_for_ai_setting_name, + project_name=project_name, + connection_name=connection_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -11860,34 +11873,34 @@ async def update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DefenderForAISetting, response.json()) + deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DefenderForAISetting"]: - """Lists the Defender for AI settings. + @distributed_trace_async + async def delete( + self, resource_group_name: str, account_name: str, project_name: str, connection_name: str, **kwargs: Any + ) -> None: + """Delete Cognitive Services project connection by name. + + Delete Cognitive Services project connection by name. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :return: An iterator like instance of DefenderForAISetting - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.DefenderForAISetting] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.DefenderForAISetting]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -11896,53 +11909,143 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_defender_for_ai_settings_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + cls: ClsType[None] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_project_connections_delete_request( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + connection_name=connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.DefenderForAISetting], + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + account_name: str, + project_name: str, + *, + target: Optional[str] = None, + category: Optional[str] = None, + include_all: bool = False, + **kwargs: Any + ) -> AsyncItemPaged["_models.ConnectionPropertiesV2BasicResource"]: + """Lists all the available Cognitive Services project connections under the specified project. + + Lists all the available Cognitive Services project connections under the specified project. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :keyword target: Target of the connection. Default value is None. + :paramtype target: str + :keyword category: Category of the connection. Default value is None. + :paramtype category: str + :keyword include_all: query parameter that indicates if get connection call should return both + connections and datastores. Default value is False. + :paramtype include_all: bool + :return: An iterator like instance of ConnectionPropertiesV2BasicResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ConnectionPropertiesV2BasicResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_project_connections_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + subscription_id=self._config.subscription_id, + target=target, + category=category, + include_all=include_all, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ConnectionPropertiesV2BasicResource], deserialized.get("value", []), ) if cls: @@ -11971,14 +12074,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ProjectsOperations: # pylint: disable=docstring-missing-param +class ProjectCapabilityHostsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`projects` attribute. + :attr:`project_capability_hosts` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -11992,9 +12095,11 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( - self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any - ) -> _models.Project: - """Returns a Cognitive Services project specified by the parameters. + self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any + ) -> _models.ProjectCapabilityHost: + """Get project capabilityHost. + + Get project capabilityHost. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -12003,8 +12108,11 @@ async def get( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :return: Project. The Project is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Project + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :return: ProjectCapabilityHost. The ProjectCapabilityHost is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12018,12 +12126,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Project] = kwargs.pop("cls", None) + cls: ClsType[_models.ProjectCapabilityHost] = kwargs.pop("cls", None) - _request = build_projects_get_request( + _request = build_project_capability_hosts_get_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, + capability_host_name=capability_host_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -12058,19 +12167,20 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Project, response.json()) + deserialized = _deserialize(_models.ProjectCapabilityHost, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_initial( + async def _create_or_update_initial( self, resource_group_name: str, account_name: str, project_name: str, - project: Union[_models.Project, _types.Project, IO[bytes]], + capability_host_name: str, + capability_host: Union[_models.ProjectCapabilityHost, _types.ProjectCapabilityHost, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -12089,15 +12199,16 @@ async def _create_initial( content_type = content_type or "application/json" _content = None - if isinstance(project, (IOBase, bytes)): - _content = project + if isinstance(capability_host, (IOBase, bytes)): + _content = capability_host else: - _content = json.dumps(project, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(capability_host, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_projects_create_request( + _request = build_project_capability_hosts_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, + capability_host_name=capability_host_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -12118,7 +12229,7 @@ async def _create_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201, 202]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -12132,14 +12243,12 @@ async def _create_initial( response_headers = {} if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["x-ms-async-operation-timeout"] = self._deserialize( + "str", response.headers.get("x-ms-async-operation-timeout") + ) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -12149,18 +12258,20 @@ async def _create_initial( return deserialized # type: ignore @overload - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, account_name: str, project_name: str, - project: _models.Project, + capability_host_name: str, + capability_host: _models.ProjectCapabilityHost, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Project]: - """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give - AI developer it's individual container to work on. + ) -> AsyncLROPoller[_models.ProjectCapabilityHost]: + """Create or update project capabilityHost. + + Create or update project capabilityHost. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -12169,30 +12280,36 @@ async def begin_create( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: ~azure.mgmt.cognitiveservices.models.Project + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :param capability_host: CapabilityHost definition. Required. + :type capability_host: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost :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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :return: An instance of AsyncLROPoller that returns ProjectCapabilityHost. The + ProjectCapabilityHost is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, account_name: str, project_name: str, - project: _types.Project, + capability_host_name: str, + capability_host: _types.ProjectCapabilityHost, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Project]: - """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give - AI developer it's individual container to work on. + ) -> AsyncLROPoller[_models.ProjectCapabilityHost]: + """Create or update project capabilityHost. + + Create or update project capabilityHost. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -12201,30 +12318,36 @@ async def begin_create( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: ~azure.mgmt.cognitiveservices.types.Project + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :param capability_host: CapabilityHost definition. Required. + :type capability_host: ~azure.mgmt.cognitiveservices.types.ProjectCapabilityHost :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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :return: An instance of AsyncLROPoller that returns ProjectCapabilityHost. The + ProjectCapabilityHost is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, account_name: str, project_name: str, - project: IO[bytes], + capability_host_name: str, + capability_host: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Project]: - """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give - AI developer it's individual container to work on. + ) -> AsyncLROPoller[_models.ProjectCapabilityHost]: + """Create or update project capabilityHost. + + Create or update project capabilityHost. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -12233,28 +12356,34 @@ async def begin_create( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: IO[bytes] + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :param capability_host: CapabilityHost definition. Required. + :type capability_host: 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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :return: An instance of AsyncLROPoller that returns ProjectCapabilityHost. The + ProjectCapabilityHost is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create( + async def begin_create_or_update( self, resource_group_name: str, account_name: str, project_name: str, - project: Union[_models.Project, _types.Project, IO[bytes]], + capability_host_name: str, + capability_host: Union[_models.ProjectCapabilityHost, _types.ProjectCapabilityHost, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Project]: - """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give - AI developer it's individual container to work on. + ) -> AsyncLROPoller[_models.ProjectCapabilityHost]: + """Create or update project capabilityHost. + + Create or update project capabilityHost. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -12263,29 +12392,34 @@ async def begin_create( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param project: The parameters to provide for the created project. Is either a Project type or - a IO[bytes] type. Required. - :type project: ~azure.mgmt.cognitiveservices.models.Project or - ~azure.mgmt.cognitiveservices.types.Project or IO[bytes] - :return: An instance of AsyncLROPoller that returns Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :param capability_host: CapabilityHost definition. Is either a ProjectCapabilityHost type or a + IO[bytes] type. Required. + :type capability_host: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost or + ~azure.mgmt.cognitiveservices.types.ProjectCapabilityHost or IO[bytes] + :return: An instance of AsyncLROPoller that returns ProjectCapabilityHost. The + ProjectCapabilityHost is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] :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.Project] = kwargs.pop("cls", None) + cls: ClsType[_models.ProjectCapabilityHost] = 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._create_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - project=project, + capability_host_name=capability_host_name, + capability_host=capability_host, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -12297,7 +12431,7 @@ async def begin_create( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Project, response.json()) + deserialized = _deserialize(_models.ProjectCapabilityHost, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -12315,23 +12449,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Project].from_continuation_token( + return AsyncLROPoller[_models.ProjectCapabilityHost].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Project]( + return AsyncLROPoller[_models.ProjectCapabilityHost]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - project_name: str, - project: Union[_models.Project, _types.Project, IO[bytes]], - **kwargs: Any + async def _delete_initial( + self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12341,27 +12470,18 @@ async def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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(project, (IOBase, bytes)): - _content = project - else: - _content = json.dumps(project, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_projects_update_request( + _request = build_project_capability_hosts_delete_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, + capability_host_name=capability_host_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -12378,7 +12498,7 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -12393,6 +12513,9 @@ async def _update_initial( response_headers = {} if response.status_code == 202: response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["x-ms-async-operation-timeout"] = self._deserialize( + "str", response.headers.get("x-ms-async-operation-timeout") + ) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -12401,109 +12524,13 @@ async def _update_initial( return deserialized # type: ignore - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - project: _models.Project, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Project]: - """Updates a Cognitive Services Project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: ~azure.mgmt.cognitiveservices.models.Project - :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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - project: _types.Project, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Project]: - """Updates a Cognitive Services Project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: ~azure.mgmt.cognitiveservices.types.Project - :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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - project: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Project]: - """Updates a Cognitive Services Project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: 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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - project: Union[_models.Project, _types.Project, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Project]: - """Updates a Cognitive Services Project. + async def begin_delete( + self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete project capabilityHost. + + Delete project capabilityHost. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -12512,30 +12539,26 @@ async def begin_update( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param project: The parameters to provide for the created project. Is either a Project type or - a IO[bytes] type. Required. - :type project: ~azure.mgmt.cognitiveservices.models.Project or - ~azure.mgmt.cognitiveservices.types.Project or IO[bytes] - :return: An instance of AsyncLROPoller that returns Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Project] + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.Project] = kwargs.pop("cls", None) + cls: ClsType[None] = 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._update_initial( + raw_result = await self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - project=project, - content_type=content_type, + capability_host_name=capability_host_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -12544,12 +12567,9 @@ async def begin_update( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Project, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -12564,19 +12584,39 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Project].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Project]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _delete_initial( + @distributed_trace + def list( self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + ) -> AsyncItemPaged["_models.ProjectCapabilityHost"]: + """List capabilityHost. + + List capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :return: An iterator like instance of ProjectCapabilityHost + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ProjectCapabilityHost]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -12585,165 +12625,24 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_projects_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 [200, 202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("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_delete( - self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a Cognitive Services project from the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Project"]: - """Returns all the projects in a Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of Project - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.Project] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Project]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_projects_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_project_capability_hosts_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -12773,7 +12672,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Project], + List[_models.ProjectCapabilityHost], deserialized.get("value", []), ) if cls: @@ -12802,14 +12701,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class ProjectConnectionsOperations: # pylint: disable=docstring-missing-param +class QuotaTiersOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`project_connections` attribute. + :attr:`quota_tiers` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -12822,25 +12721,16 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get( - self, resource_group_name: str, account_name: str, project_name: str, connection_name: str, **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Lists Cognitive Services project connection by name. + async def get(self, default: str, **kwargs: Any) -> _models.QuotaTier: + """Gets the Quota Tier for a subscription. - Lists Cognitive Services project connection by name. + Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12854,13 +12744,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) + cls: ClsType[_models.QuotaTier] = kwargs.pop("cls", None) - _request = build_project_connections_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - connection_name=connection_name, + _request = build_quota_tiers_get_request( + default=default, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -12895,7 +12782,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) + deserialized = _deserialize(_models.QuotaTier, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -12903,7200 +12790,85 @@ async def get( return deserialized # type: ignore @overload - async def create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[_models.ConnectionPropertiesV2BasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Create or update Cognitive Services project connection under the specified project. + async def create_or_update( + self, default: str, tier: _models.QuotaTier, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. - Create or update Cognitive Services project connection under the specified project. + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: The object for creating or updating a new account connection. Default value - is None. - :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[_types.ConnectionPropertiesV2BasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Create or update Cognitive Services project connection under the specified project. + async def create_or_update( + self, default: str, tier: _types.QuotaTier, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. - Create or update Cognitive Services project connection under the specified project. + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: The object for creating or updating a new account connection. Default value - is None. - :type connection: ~azure.mgmt.cognitiveservices.types.ConnectionPropertiesV2BasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Create or update Cognitive Services project connection under the specified project. - - Create or update Cognitive Services project connection under the specified project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: The object for creating or updating a new account connection. Default value - is None. - :type connection: 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: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[ - Union[_models.ConnectionPropertiesV2BasicResource, _types.ConnectionPropertiesV2BasicResource, IO[bytes]] - ] = None, - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Create or update Cognitive Services project connection under the specified project. - - Create or update Cognitive Services project connection under the specified project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: The object for creating or updating a new account connection. Is either a - ConnectionPropertiesV2BasicResource type or a IO[bytes] type. Default value is None. - :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource or - ~azure.mgmt.cognitiveservices.types.ConnectionPropertiesV2BasicResource or IO[bytes] - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :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)) - content_type = content_type if connection else None - cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if connection else None - _content = None - if isinstance(connection, (IOBase, bytes)): - _content = connection - else: - if connection is not None: - _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_project_connections_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - connection_name=connection_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[_models.ConnectionUpdateContent] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Update Cognitive Services project connection under the specified project. - - Update Cognitive Services project connection under the specified project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: Parameters for account connection update. Default value is None. - :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionUpdateContent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[_types.ConnectionUpdateContent] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Update Cognitive Services project connection under the specified project. - - Update Cognitive Services project connection under the specified project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: Parameters for account connection update. Default value is None. - :type connection: ~azure.mgmt.cognitiveservices.types.ConnectionUpdateContent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Update Cognitive Services project connection under the specified project. - - Update Cognitive Services project connection under the specified project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: Parameters for account connection update. Default value is None. - :type connection: 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: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[Union[_models.ConnectionUpdateContent, _types.ConnectionUpdateContent, IO[bytes]]] = None, - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Update Cognitive Services project connection under the specified project. - - Update Cognitive Services project connection under the specified project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: Parameters for account connection update. Is either a - ConnectionUpdateContent type or a IO[bytes] type. Default value is None. - :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionUpdateContent or - ~azure.mgmt.cognitiveservices.types.ConnectionUpdateContent or IO[bytes] - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :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)) - content_type = content_type if connection else None - cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if connection else None - _content = None - if isinstance(connection, (IOBase, bytes)): - _content = connection - else: - if connection is not None: - _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None - - _request = build_project_connections_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - connection_name=connection_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, account_name: str, project_name: str, connection_name: str, **kwargs: Any - ) -> None: - """Delete Cognitive Services project connection by name. - - Delete Cognitive Services project connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :return: None - :rtype: None - :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[None] = kwargs.pop("cls", None) - - _request = build_project_connections_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - project_name: str, - *, - target: Optional[str] = None, - category: Optional[str] = None, - include_all: bool = False, - **kwargs: Any - ) -> AsyncItemPaged["_models.ConnectionPropertiesV2BasicResource"]: - """Lists all the available Cognitive Services project connections under the specified project. - - Lists all the available Cognitive Services project connections under the specified project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :keyword target: Target of the connection. Default value is None. - :paramtype target: str - :keyword category: Category of the connection. Default value is None. - :paramtype category: str - :keyword include_all: query parameter that indicates if get connection call should return both - connections and datastores. Default value is False. - :paramtype include_all: bool - :return: An iterator like instance of ConnectionPropertiesV2BasicResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ConnectionPropertiesV2BasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_project_connections_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - subscription_id=self._config.subscription_id, - target=target, - category=category, - include_all=include_all, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ConnectionPropertiesV2BasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ProjectCapabilityHostsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`project_capability_hosts` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any - ) -> _models.ProjectCapabilityHost: - """Get project capabilityHost. - - Get project capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :return: ProjectCapabilityHost. The ProjectCapabilityHost is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost - :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.ProjectCapabilityHost] = kwargs.pop("cls", None) - - _request = build_project_capability_hosts_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - capability_host_name=capability_host_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ProjectCapabilityHost, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - project_name: str, - capability_host_name: str, - capability_host: Union[_models.ProjectCapabilityHost, _types.ProjectCapabilityHost, 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(capability_host, (IOBase, bytes)): - _content = capability_host - else: - _content = json.dumps(capability_host, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_project_capability_hosts_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - capability_host_name=capability_host_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "str", response.headers.get("x-ms-async-operation-timeout") - ) - - 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_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - capability_host_name: str, - capability_host: _models.ProjectCapabilityHost, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ProjectCapabilityHost]: - """Create or update project capabilityHost. - - Create or update project capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :param capability_host: CapabilityHost definition. Required. - :type capability_host: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost - :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 ProjectCapabilityHost. The - ProjectCapabilityHost is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - capability_host_name: str, - capability_host: _types.ProjectCapabilityHost, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ProjectCapabilityHost]: - """Create or update project capabilityHost. - - Create or update project capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :param capability_host: CapabilityHost definition. Required. - :type capability_host: ~azure.mgmt.cognitiveservices.types.ProjectCapabilityHost - :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 ProjectCapabilityHost. The - ProjectCapabilityHost is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - capability_host_name: str, - capability_host: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ProjectCapabilityHost]: - """Create or update project capabilityHost. - - Create or update project capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :param capability_host: CapabilityHost definition. Required. - :type capability_host: 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 ProjectCapabilityHost. The - ProjectCapabilityHost is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - capability_host_name: str, - capability_host: Union[_models.ProjectCapabilityHost, _types.ProjectCapabilityHost, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ProjectCapabilityHost]: - """Create or update project capabilityHost. - - Create or update project capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :param capability_host: CapabilityHost definition. Is either a ProjectCapabilityHost type or a - IO[bytes] type. Required. - :type capability_host: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost or - ~azure.mgmt.cognitiveservices.types.ProjectCapabilityHost or IO[bytes] - :return: An instance of AsyncLROPoller that returns ProjectCapabilityHost. The - ProjectCapabilityHost is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] - :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.ProjectCapabilityHost] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - capability_host_name=capability_host_name, - capability_host=capability_host, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.ProjectCapabilityHost, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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.ProjectCapabilityHost].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ProjectCapabilityHost]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: 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_project_capability_hosts_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - capability_host_name=capability_host_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "str", response.headers.get("x-ms-async-operation-timeout") - ) - - 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_delete( - self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete project capabilityHost. - - Delete project capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - capability_host_name=capability_host_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ProjectCapabilityHost"]: - """List capabilityHost. - - List capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :return: An iterator like instance of ProjectCapabilityHost - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ProjectCapabilityHost]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_project_capability_hosts_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ProjectCapabilityHost], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class QuotaTiersOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`quota_tiers` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, default: str, **kwargs: Any) -> _models.QuotaTier: - """Gets the Quota Tier for a subscription. - - Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :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.QuotaTier] = kwargs.pop("cls", None) - - _request = build_quota_tiers_get_request( - default=default, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.QuotaTier, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, default: str, tier: _models.QuotaTier, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, default: str, tier: _types.QuotaTier, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: ~azure.mgmt.cognitiveservices.types.QuotaTier - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, default: str, tier: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: 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: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, default: str, tier: Union[_models.QuotaTier, _types.QuotaTier, IO[bytes]], **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Is either a QuotaTier type - or a IO[bytes] type. Required. - :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier or - ~azure.mgmt.cognitiveservices.types.QuotaTier or IO[bytes] - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :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.QuotaTier] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(tier, (IOBase, bytes)): - _content = tier - else: - _content = json.dumps(tier, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_quota_tiers_create_or_update_request( - default=default, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.QuotaTier, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, default: str, tier: _models.QuotaTier, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. The only properties that can be updated are - "tierUpgradePolicy". - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, default: str, tier: _types.QuotaTier, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. The only properties that can be updated are - "tierUpgradePolicy". - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: ~azure.mgmt.cognitiveservices.types.QuotaTier - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, default: str, tier: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. The only properties that can be updated are - "tierUpgradePolicy". - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: 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: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, default: str, tier: Union[_models.QuotaTier, _types.QuotaTier, IO[bytes]], **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. The only properties that can be updated are - "tierUpgradePolicy". - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Is either a QuotaTier type - or a IO[bytes] type. Required. - :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier or - ~azure.mgmt.cognitiveservices.types.QuotaTier or IO[bytes] - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :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.QuotaTier] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(tier, (IOBase, bytes)): - _content = tier - else: - _content = json.dumps(tier, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_quota_tiers_update_request( - default=default, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.QuotaTier, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.QuotaTier"]: - """Returns all the resources of a particular type belonging to a subscription. - - :return: An iterator like instance of QuotaTier - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.QuotaTier] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.QuotaTier]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_quota_tiers_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.QuotaTier], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ArcDeploymentsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`arc_deployments` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "accept", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - async def get( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> _models.ArcDeployment: - """Gets the specified Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :return: ArcDeployment. The ArcDeployment is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ArcDeployment - :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.ArcDeployment] = kwargs.pop("cls", None) - - _request = build_arc_deployments_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ArcDeployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: Union[_models.ArcDeployment, _types.ArcDeployment, 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(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_arc_deployments_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - 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_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: _models.ArcDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcDeployment]: - """Creates or updates an Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param resource: The Arc deployment properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.ArcDeployment - :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 ArcDeployment. The ArcDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: _types.ArcDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcDeployment]: - """Creates or updates an Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param resource: The Arc deployment properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.ArcDeployment - :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 ArcDeployment. The ArcDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcDeployment]: - """Creates or updates an Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param resource: The Arc deployment properties. Required. - :type resource: 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 ArcDeployment. The ArcDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: Union[_models.ArcDeployment, _types.ArcDeployment, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcDeployment]: - """Creates or updates an Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param resource: The Arc deployment properties. Is either a ArcDeployment type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.ArcDeployment or - ~azure.mgmt.cognitiveservices.types.ArcDeployment or IO[bytes] - :return: An instance of AsyncLROPoller that returns ArcDeployment. The ArcDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :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.ArcDeployment] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - resource=resource, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.ArcDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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.ArcDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ArcDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: Union[_models.ArcDeploymentUpdate, _types.ArcDeploymentUpdate, 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(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_arc_deployments_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - 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_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: _models.ArcDeploymentUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcDeployment]: - """Updates the specified Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param properties: The Arc deployment update properties. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.ArcDeploymentUpdate - :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 ArcDeployment. The ArcDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: _types.ArcDeploymentUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcDeployment]: - """Updates the specified Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param properties: The Arc deployment update properties. Required. - :type properties: ~azure.mgmt.cognitiveservices.types.ArcDeploymentUpdate - :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 ArcDeployment. The ArcDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcDeployment]: - """Updates the specified Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param properties: The Arc deployment update properties. Required. - :type properties: 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 ArcDeployment. The ArcDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: Union[_models.ArcDeploymentUpdate, _types.ArcDeploymentUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ArcDeployment]: - """Updates the specified Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param properties: The Arc deployment update properties. Is either a ArcDeploymentUpdate type - or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.ArcDeploymentUpdate or - ~azure.mgmt.cognitiveservices.types.ArcDeploymentUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns ArcDeployment. The ArcDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :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.ArcDeployment] = 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._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - properties=properties, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.ArcDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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.ArcDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ArcDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - async def _delete_initial( - self, resource_group_name: str, account_name: str, deployment_name: 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_arc_deployments_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - 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 - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_delete( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ArcDeployment"]: - """Gets the Arc deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of ArcDeployment - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ArcDeployment]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_arc_deployments_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ArcDeployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class AgentApplicationsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`agent_applications` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any - ) -> _models.AgentApplication: - """Gets an Agent Application by name. - - Gets an Agent Application by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :return: AgentApplication. The AgentApplication is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.AgentApplication - :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.AgentApplication] = kwargs.pop("cls", None) - - _request = build_agent_applications_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AgentApplication, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - project_name: str, - name: str, - body: Union[_models.AgentApplication, _types.AgentApplication, 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_agent_applications_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "str", response.headers.get("x-ms-async-operation-timeout") - ) - - 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_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - name: str, - body: _models.AgentApplication, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AgentApplication]: - """Creates or updates an Agent Application (asynchronous). - - Creates or updates an Agent Application (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :param body: Agent Application definition object. Required. - :type body: ~azure.mgmt.cognitiveservices.models.AgentApplication - :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 AgentApplication. The AgentApplication is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - name: str, - body: _types.AgentApplication, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AgentApplication]: - """Creates or updates an Agent Application (asynchronous). - - Creates or updates an Agent Application (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :param body: Agent Application definition object. Required. - :type body: ~azure.mgmt.cognitiveservices.types.AgentApplication - :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 AgentApplication. The AgentApplication is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AgentApplication]: - """Creates or updates an Agent Application (asynchronous). - - Creates or updates an Agent Application (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :param body: Agent Application definition object. 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 AgentApplication. The AgentApplication is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - name: str, - body: Union[_models.AgentApplication, _types.AgentApplication, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.AgentApplication]: - """Creates or updates an Agent Application (asynchronous). - - Creates or updates an Agent Application (asynchronous). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :param body: Agent Application definition object. Is either a AgentApplication type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.cognitiveservices.models.AgentApplication or - ~azure.mgmt.cognitiveservices.types.AgentApplication or IO[bytes] - :return: An instance of AsyncLROPoller that returns AgentApplication. The AgentApplication is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] - :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.AgentApplication] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.AgentApplication, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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.AgentApplication].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AgentApplication]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, account_name: str, project_name: str, name: 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_agent_applications_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_delete( - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete Agent Application. - - Delete Agent Application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - project_name: str, - *, - count: int = 30, - skip: Optional[int] = None, - skip_token: Optional[str] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: bool = False, - **kwargs: Any - ) -> AsyncItemPaged["_models.AgentApplication"]: - """Lists Agent Applications in the project. - - Lists Agent Applications in the project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :keyword count: Number of agent applications to be retrieved in a page of results. Default - value is 30. - :paramtype count: int - :keyword skip: Number of agent applications to skip. Default value is None. - :paramtype skip: int - :keyword skip_token: Continuation token for pagination. Default value is None. - :paramtype skip_token: str - :keyword names: Names of agent applications to retrieve. Default value is None. - :paramtype names: list[str] - :keyword search_text: Search text for filtering agent applications. Default value is None. - :paramtype search_text: str - :keyword order_by: Field to order by. Default value is None. - :paramtype order_by: str - :keyword order_by_asc: Whether to order in ascending order. Default value is False. - :paramtype order_by_asc: bool - :return: An iterator like instance of AgentApplication - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.AgentApplication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.AgentApplication]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_agent_applications_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - subscription_id=self._config.subscription_id, - count=count, - skip=skip, - skip_token=skip_token, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.AgentApplication], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def list_agents( - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any - ) -> _models.AgentReferenceResourceArmPaginatedResult: - """Lists agents for an Agent Application. - - Lists agents for an Agent Application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :return: AgentReferenceResourceArmPaginatedResult. The AgentReferenceResourceArmPaginatedResult - is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult - :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.AgentReferenceResourceArmPaginatedResult] = kwargs.pop("cls", None) - - _request = build_agent_applications_list_agents_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AgentReferenceResourceArmPaginatedResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def enable( - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any - ) -> None: - """Enables an Agent Application. - - Enables an Agent Application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :return: None - :rtype: None - :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[None] = kwargs.pop("cls", None) - - _request = build_agent_applications_enable_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def disable( - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any - ) -> None: - """Disables an Agent Application. - - Disables an Agent Application. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :return: None - :rtype: None - :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[None] = kwargs.pop("cls", None) - - _request = build_agent_applications_disable_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class ManagedComputeDeploymentsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`managed_compute_deployments` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def get( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> _models.ManagedComputeDeployment: - """Gets the specified managed compute deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :return: ManagedComputeDeployment. The ManagedComputeDeployment is compatible with - MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment - :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.ManagedComputeDeployment] = kwargs.pop("cls", None) - - _request = build_managed_compute_deployments_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ManagedComputeDeployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: Union[_models.ManagedComputeDeployment, _types.ManagedComputeDeployment, 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(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_managed_compute_deployments_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("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_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: _models.ManagedComputeDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedComputeDeployment]: - """Creates or updates a managed compute deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param resource: The managed compute deployment properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment - :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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: _types.ManagedComputeDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedComputeDeployment]: - """Creates or updates a managed compute deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param resource: The managed compute deployment properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.ManagedComputeDeployment - :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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedComputeDeployment]: - """Creates or updates a managed compute deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param resource: The managed compute deployment properties. Required. - :type resource: 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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: Union[_models.ManagedComputeDeployment, _types.ManagedComputeDeployment, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedComputeDeployment]: - """Creates or updates a managed compute deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param resource: The managed compute deployment properties. Is either a - ManagedComputeDeployment type or a IO[bytes] type. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment or - ~azure.mgmt.cognitiveservices.types.ManagedComputeDeployment or IO[bytes] - :return: An instance of AsyncLROPoller that returns ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] - :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.ManagedComputeDeployment] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - resource=resource, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.ManagedComputeDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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.ManagedComputeDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedComputeDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _update_initial( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: Union[_models.PatchResourceSku, _types.PatchResourceSku, 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(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_managed_compute_deployments_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - 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_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: _models.PatchResourceSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedComputeDeployment]: - """Updates the specified managed compute deployment associated with the Cognitive Services - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param properties: The managed compute deployment patch properties. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.PatchResourceSku - :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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: _types.PatchResourceSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedComputeDeployment]: - """Updates the specified managed compute deployment associated with the Cognitive Services - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param properties: The managed compute deployment patch properties. Required. - :type properties: ~azure.mgmt.cognitiveservices.types.PatchResourceSku - :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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedComputeDeployment]: - """Updates the specified managed compute deployment associated with the Cognitive Services - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param properties: The managed compute deployment patch properties. Required. - :type properties: 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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: Union[_models.PatchResourceSku, _types.PatchResourceSku, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedComputeDeployment]: - """Updates the specified managed compute deployment associated with the Cognitive Services - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param properties: The managed compute deployment patch properties. Is either a - PatchResourceSku type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.PatchResourceSku or - ~azure.mgmt.cognitiveservices.types.PatchResourceSku or IO[bytes] - :return: An instance of AsyncLROPoller that returns ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] - :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.ManagedComputeDeployment] = 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._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - properties=properties, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.ManagedComputeDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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.ManagedComputeDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedComputeDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _delete_initial( - self, resource_group_name: str, account_name: str, deployment_name: 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_managed_compute_deployments_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 [200, 202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("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 - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_delete( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified managed compute deployment associated with the Cognitive Services - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedComputeDeployment"]: - """Gets the managed compute deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of ManagedComputeDeployment - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ManagedComputeDeployment]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_managed_compute_deployments_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ManagedComputeDeployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class AdapterDeploymentsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`adapter_deployments` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "adapter_deployment_name", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def get( - self, resource_group_name: str, account_name: str, adapter_deployment_name: str, **kwargs: Any - ) -> _models.AdapterDeployment: - """Gets an adapter deployment by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :return: AdapterDeployment. The AdapterDeployment is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.AdapterDeployment - :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.AdapterDeployment] = kwargs.pop("cls", None) - - _request = build_adapter_deployments_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - adapter_deployment_name=adapter_deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AdapterDeployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "adapter_deployment_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: Union[_models.AdapterDeployment, _types.AdapterDeployment, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError - 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(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_adapter_deployments_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - adapter_deployment_name=adapter_deployment_name, - subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - 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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - 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_create_or_update( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: _models.AdapterDeployment, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.AdapterDeployment]: - """Creates an adapter deployment or re-targets it to another compatible managed compute - deployment. The source model ID is immutable. Returns 201 for a new adapter or 200 for an - existing adapter, including retries. Either response may require polling while provisioning is - in progress. After polling completes, retrieve the final resource from the original resource - URL. Omit conditional headers to allow either creation or update. To create only when absent, - send If-None-Match: *. To update only a matching version, send If-Match with the ETag returned - by GET. Conditional requests, including retries, return 412 if the precondition is not met. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :param resource: The complete adapter deployment resource to create or re-target. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.AdapterDeployment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns AdapterDeployment. The AdapterDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AdapterDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: _types.AdapterDeployment, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.AdapterDeployment]: - """Creates an adapter deployment or re-targets it to another compatible managed compute - deployment. The source model ID is immutable. Returns 201 for a new adapter or 200 for an - existing adapter, including retries. Either response may require polling while provisioning is - in progress. After polling completes, retrieve the final resource from the original resource - URL. Omit conditional headers to allow either creation or update. To create only when absent, - send If-None-Match: *. To update only a matching version, send If-Match with the ETag returned - by GET. Conditional requests, including retries, return 412 if the precondition is not met. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :param resource: The complete adapter deployment resource to create or re-target. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.AdapterDeployment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns AdapterDeployment. The AdapterDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AdapterDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.AdapterDeployment]: - """Creates an adapter deployment or re-targets it to another compatible managed compute - deployment. The source model ID is immutable. Returns 201 for a new adapter or 200 for an - existing adapter, including retries. Either response may require polling while provisioning is - in progress. After polling completes, retrieve the final resource from the original resource - URL. Omit conditional headers to allow either creation or update. To create only when absent, - send If-None-Match: *. To update only a matching version, send If-Match with the ETag returned - by GET. Conditional requests, including retries, return 412 if the precondition is not met. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :param resource: The complete adapter deployment resource to create or re-target. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns AdapterDeployment. The AdapterDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AdapterDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "adapter_deployment_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - resource: Union[_models.AdapterDeployment, _types.AdapterDeployment, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.AdapterDeployment]: - """Creates an adapter deployment or re-targets it to another compatible managed compute - deployment. The source model ID is immutable. Returns 201 for a new adapter or 200 for an - existing adapter, including retries. Either response may require polling while provisioning is - in progress. After polling completes, retrieve the final resource from the original resource - URL. Omit conditional headers to allow either creation or update. To create only when absent, - send If-None-Match: *. To update only a matching version, send If-Match with the ETag returned - by GET. Conditional requests, including retries, return 412 if the precondition is not met. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :param resource: The complete adapter deployment resource to create or re-target. Is either a - AdapterDeployment type or a IO[bytes] type. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.AdapterDeployment or - ~azure.mgmt.cognitiveservices.types.AdapterDeployment or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns AdapterDeployment. The AdapterDeployment is - compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AdapterDeployment] - :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.AdapterDeployment] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - adapter_deployment_name=adapter_deployment_name, - resource=resource, - etag=etag, - match_condition=match_condition, - 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["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - deserialized = _deserialize(_models.AdapterDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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.AdapterDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AdapterDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=["2026-09-15-preview"], - ) - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.AdapterDeployment"]: - """Lists adapter deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of AdapterDeployment - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.AdapterDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.AdapterDeployment]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_adapter_deployments_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.AdapterDeployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "adapter_deployment_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def _delete_initial( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError - 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_adapter_deployments_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - adapter_deployment_name=adapter_deployment_name, - subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("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 - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "adapter_deployment_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def begin_delete( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Drains requests and deletes an adapter deployment and its serving snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - adapter_deployment_name=adapter_deployment_name, - etag=etag, - match_condition=match_condition, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ComputeOperationsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`compute_operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-01-15-preview", - params_added_on={ - "2026-01-15-preview": ["api_version", "subscription_id", "location", "operation_id", "accept"] - }, - api_versions_list=[ - "2026-01-15-preview", - "2026-03-15-preview", - "2026-05-15-preview", - "2026-07-15-preview", - "2026-09-15-preview", - ], - ) - async def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.ComputeOperationStatus: - """Gets the status of a compute operation. - - :param location: The name of the Azure region. Required. - :type location: str - :param operation_id: The ID of the compute operation. Required. - :type operation_id: str - :return: ComputeOperationStatus. The ComputeOperationStatus is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ComputeOperationStatus - :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.ComputeOperationStatus] = kwargs.pop("cls", None) - - _request = build_compute_operations_get_request( - location=location, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComputeOperationStatus, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class ManagedComputeUsagesOperationGroupOperations: # pylint: disable=docstring-missing-param,name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`managed_compute_usages_operation_group` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={"2026-03-15-preview": ["api_version", "subscription_id", "location", "accept"]}, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.ManagedComputeUsage"]: - """List managed compute quota usages for a subscription and location. - - :param location: The location name. Required. - :type location: str - :return: An iterator like instance of ManagedComputeUsage - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.ManagedComputeUsage] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.ManagedComputeUsage]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_managed_compute_usages_operation_group_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ManagedComputeUsage], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class ComputesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`computes` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def get( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> _models.Compute: - """Gets the specified compute associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :return: Compute. The Compute is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Compute - :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.Compute] = kwargs.pop("cls", None) - - _request = build_computes_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Compute, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - "content_type", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: Union[_models.Compute, _types.Compute, 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(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_computes_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - 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_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: _models.Compute, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Compute]: - """Creates or updates a compute associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :param resource: The compute properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.Compute - :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 Compute. The Compute is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Compute] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: _types.Compute, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Compute]: - """Creates or updates a compute associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :param resource: The compute properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.Compute - :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 Compute. The Compute is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Compute] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Compute]: - """Creates or updates a compute associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :param resource: The compute properties. Required. - :type resource: 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 Compute. The Compute is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Compute] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - "content_type", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: Union[_models.Compute, _types.Compute, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Compute]: - """Creates or updates a compute associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :param resource: The compute properties. Is either a Compute type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.cognitiveservices.models.Compute or - ~azure.mgmt.cognitiveservices.types.Compute or IO[bytes] - :return: An instance of AsyncLROPoller that returns Compute. The Compute is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Compute] - :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.Compute] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - resource=resource, - 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["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = _deserialize(_models.Compute, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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.Compute].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Compute]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _delete_initial( - self, resource_group_name: str, account_name: str, compute_name: 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_computes_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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 - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_delete( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified compute associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Compute"]: - """Gets the computes associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of Compute - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.Compute] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Compute]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_computes_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Compute], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _start_initial( - self, resource_group_name: str, account_name: str, compute_name: 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_computes_start_request( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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 - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_start( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Starts a stopped ContainerInstance compute resource. This is a long-running operation that - returns 202 Accepted. Only applicable when computeType is ContainerInstance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._start_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _stop_initial( - self, resource_group_name: str, account_name: str, compute_name: 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_computes_stop_request( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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 - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_stop( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Stops a running ContainerInstance compute resource. This is a long-running operation that - returns 202 Accepted. Only applicable when computeType is ContainerInstance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._stop_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _restart_initial( - self, resource_group_name: str, account_name: str, compute_name: 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_computes_restart_request( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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 - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_restart( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Restarts a running ContainerInstance compute resource. This is a long-running operation that - returns 202 Accepted. Only applicable when computeType is ContainerInstance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._restart_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class WorkbenchesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`workbenches` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def get( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any - ) -> _models.Workbench: - """Gets the specified workbench associated with the project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :return: Workbench. The Workbench is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Workbench - :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.Workbench] = kwargs.pop("cls", None) - - _request = build_workbenches_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Workbench, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: Union[_models.Workbench, _types.Workbench, 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(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_workbenches_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: _models.Workbench, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Workbench]: - """Creates or updates a workbench associated with the project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param resource: The workbench properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.Workbench + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: ~azure.mgmt.cognitiveservices.types.QuotaTier :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 Workbench. The Workbench is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Workbench] + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: _types.Workbench, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Workbench]: - """Creates or updates a workbench associated with the project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param resource: The workbench properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.Workbench - :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 Workbench. The Workbench is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Workbench] - :raises ~azure.core.exceptions.HttpResponseError: - """ + async def create_or_update( + self, default: str, tier: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Workbench]: - """Creates or updates a workbench associated with the project. + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param resource: The workbench properties. Required. - :type resource: IO[bytes] + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: 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 Workbench. The Workbench is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Workbench] + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: Union[_models.Workbench, _types.Workbench, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Workbench]: - """Creates or updates a workbench associated with the project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param resource: The workbench properties. Is either a Workbench type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.cognitiveservices.models.Workbench or - ~azure.mgmt.cognitiveservices.types.Workbench or IO[bytes] - :return: An instance of AsyncLROPoller that returns Workbench. The Workbench is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.Workbench] - :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.Workbench] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, - resource=resource, - 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["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = _deserialize(_models.Workbench, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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.Workbench].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Workbench]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: _models.WorkbenchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Workbench: - """Updates a workbench associated with the project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param properties: The workbench properties to update. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.WorkbenchUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Workbench. The Workbench is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Workbench - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: _types.WorkbenchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Workbench: - """Updates a workbench associated with the project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param properties: The workbench properties to update. Required. - :type properties: ~azure.mgmt.cognitiveservices.types.WorkbenchUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Workbench. The Workbench is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Workbench - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Workbench: - """Updates a workbench associated with the project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param properties: The workbench properties to update. Required. - :type properties: 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: Workbench. The Workbench is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Workbench - :raises ~azure.core.exceptions.HttpResponseError: - """ + async def create_or_update( + self, default: str, tier: Union[_models.QuotaTier, _types.QuotaTier, IO[bytes]], **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. - @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: Union[_models.WorkbenchUpdate, _types.WorkbenchUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.Workbench: - """Updates a workbench associated with the project. + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param properties: The workbench properties to update. Is either a WorkbenchUpdate type or a - IO[bytes] type. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.WorkbenchUpdate or - ~azure.mgmt.cognitiveservices.types.WorkbenchUpdate or IO[bytes] - :return: Workbench. The Workbench is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Workbench + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Is either a QuotaTier type + or a IO[bytes] type. Required. + :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier or + ~azure.mgmt.cognitiveservices.types.QuotaTier or IO[bytes] + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -20111,20 +12883,17 @@ async def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Workbench] = kwargs.pop("cls", None) + cls: ClsType[_models.QuotaTier] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(tier, (IOBase, bytes)): + _content = tier else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(tier, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_workbenches_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, + _request = build_quota_tiers_create_or_update_request( + default=default, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -20145,7 +12914,7 @@ async def update( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -20161,204 +12930,177 @@ async def update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Workbench, response.json()) + deserialized = _deserialize(_models.QuotaTier, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _delete_initial( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: 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) + @overload + async def update( + self, default: str, tier: _models.QuotaTier, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. The only properties that can be updated are + "tierUpgradePolicy". - _request = build_workbenches_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :raises ~azure.core.exceptions.HttpResponseError: + """ - response = pipeline_response.http_response + @overload + async def update( + self, default: str, tier: _types.QuotaTier, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. The only properties that can be updated are + "tierUpgradePolicy". - if response.status_code not in [202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: ~azure.mgmt.cognitiveservices.types.QuotaTier + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :raises ~azure.core.exceptions.HttpResponseError: + """ - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + @overload + async def update( + self, default: str, tier: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. The only properties that can be updated are + "tierUpgradePolicy". - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - return deserialized # type: ignore + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: 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: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_delete( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified workbench associated with the project. + async def update( + self, default: str, tier: Union[_models.QuotaTier, _types.QuotaTier, IO[bytes]], **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. The only properties that can be updated are + "tierUpgradePolicy". - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. + + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Is either a QuotaTier type + or a IO[bytes] type. Required. + :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier or + ~azure.mgmt.cognitiveservices.types.QuotaTier or IO[bytes] + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + 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 {} - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QuotaTier] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + content_type = content_type or "application/json" + _content = None + if isinstance(tier, (IOBase, bytes)): + _content = tier + else: + _content = json.dumps(tier, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_quota_tiers_update_request( + default=default, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _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.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + deserialized = _deserialize(_models.QuotaTier, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def list( - self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Workbench"]: - """Gets the workbenches associated with the project. + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.QuotaTier"]: + """Returns all the resources of a particular type belonging to a subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :return: An iterator like instance of Workbench - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.Workbench] + :return: An iterator like instance of QuotaTier + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.QuotaTier] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Workbench]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.QuotaTier]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -20371,10 +13113,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_workbenches_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, + _request = build_quota_tiers_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -20415,7 +13154,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Workbench], + List[_models.QuotaTier], deserialized.get("value", []), ) if cls: @@ -20443,23 +13182,47 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _start_initial( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + +class AgentApplicationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s + :attr:`agent_applications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any + ) -> _models.AgentApplication: + """Gets an Agent Application by name. + + Gets an Agent Application by name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :return: AgentApplication. The AgentApplication is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.AgentApplication + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -20471,13 +13234,13 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentApplication] = kwargs.pop("cls", None) - _request = build_workbenches_start_request( + _request = build_agent_applications_get_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + name=name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -20489,18 +13252,19 @@ async def _start_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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 [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -20508,114 +13272,24 @@ async def _start_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AgentApplication, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_start( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Starts a stopped workbench resource. This is a long-running operation that returns 202 - Accepted. Returns 204 if the workbench is already in the target state. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._start_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _stop_initial( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any + async def _create_or_update_initial( + self, + resource_group_name: str, + account_name: str, + project_name: str, + name: str, + body: Union[_models.AgentApplication, _types.AgentApplication, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -20625,18 +13299,28 @@ async def _stop_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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) - _request = build_workbenches_stop_request( + 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_agent_applications_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + name=name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -20653,7 +13337,7 @@ async def _stop_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -20666,9 +13350,14 @@ async def _stop_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: + if response.status_code == 201: response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["x-ms-async-operation-timeout"] = self._deserialize( + "str", response.headers.get("x-ms-async-operation-timeout") + ) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -20677,26 +13366,130 @@ async def _stop_initial( return deserialized # type: ignore + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + name: str, + body: _models.AgentApplication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentApplication]: + """Creates or updates an Agent Application (asynchronous). + + Creates or updates an Agent Application (asynchronous). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :param body: Agent Application definition object. Required. + :type body: ~azure.mgmt.cognitiveservices.models.AgentApplication + :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 AgentApplication. The AgentApplication is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + name: str, + body: _types.AgentApplication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentApplication]: + """Creates or updates an Agent Application (asynchronous). + + Creates or updates an Agent Application (asynchronous). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :param body: Agent Application definition object. Required. + :type body: ~azure.mgmt.cognitiveservices.types.AgentApplication + :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 AgentApplication. The AgentApplication is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentApplication]: + """Creates or updates an Agent Application (asynchronous). + + Creates or updates an Agent Application (asynchronous). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :param body: Agent Application definition object. 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 AgentApplication. The AgentApplication is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_stop( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Stops a running workbench resource. This is a long-running operation that returns 202 Accepted. - Returns 204 if the workbench is already in the target state. + async def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + name: str, + body: Union[_models.AgentApplication, _types.AgentApplication, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentApplication]: + """Creates or updates an Agent Application (asynchronous). + + Creates or updates an Agent Application (asynchronous). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -20705,25 +13498,34 @@ async def begin_stop( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param name: Name for the Agent Application. Required. + :type name: str + :param body: Agent Application definition object. Is either a AgentApplication type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.cognitiveservices.models.AgentApplication or + ~azure.mgmt.cognitiveservices.types.AgentApplication or IO[bytes] + :return: An instance of AsyncLROPoller that returns AgentApplication. The AgentApplication is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentApplication] = 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._stop_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + name=name, + body=body, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -20732,9 +13534,12 @@ async def begin_stop( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AgentApplication, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -20749,30 +13554,18 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.AgentApplication].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return AsyncLROPoller[_models.AgentApplication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def _restart_initial( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any + async def _delete_initial( + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -20787,11 +13580,11 @@ async def _restart_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_workbenches_restart_request( + _request = build_agent_applications_delete_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + name=name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -20835,25 +13628,12 @@ async def _restart_initial( return deserialized # type: ignore @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_restart( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any + async def begin_delete( + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Restarts a running workbench resource. This is a long-running operation that returns 202 - Accepted. Returns 204 if the workbench is already in the target state. + """Delete Agent Application. + + Delete Agent Application. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -20862,8 +13642,8 @@ async def begin_restart( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str + :param name: Name for the Agent Application. Required. + :type name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -20876,11 +13656,11 @@ async def begin_restart( 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._restart_initial( + raw_result = await self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + name=name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -20912,67 +13692,59 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ManagedComputeCapacitiesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`managed_compute_capacities` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "offer", - "accelerator_type", - "deployment_id", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace def list( - self, *, offer: str, accelerator_type: Optional[str] = None, deployment_id: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedComputeCapacity"]: - """Gets the managed compute capacities for a subscription. Returns available capacity per - accelerator type, including deployment size information. + self, + resource_group_name: str, + account_name: str, + project_name: str, + *, + count: int = 30, + skip: Optional[int] = None, + skip_token: Optional[str] = None, + names: Optional[List[str]] = None, + search_text: Optional[str] = None, + order_by: Optional[str] = None, + order_by_asc: bool = False, + **kwargs: Any + ) -> AsyncItemPaged["_models.AgentApplication"]: + """Lists Agent Applications in the project. - :keyword offer: The offer name to query capacity for (required). Required. - :paramtype offer: str - :keyword accelerator_type: Optional accelerator type filter to narrow results to a specific - accelerator type. Default value is None. - :paramtype accelerator_type: str - :keyword deployment_id: Optional deployment resource ID. When provided, returns capacity for - the specific region - where the deployment is hosted rather than the best available region. Default value is None. - :paramtype deployment_id: str - :return: An iterator like instance of ManagedComputeCapacity + Lists Agent Applications in the project. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :keyword count: Number of agent applications to be retrieved in a page of results. Default + value is 30. + :paramtype count: int + :keyword skip: Number of agent applications to skip. Default value is None. + :paramtype skip: int + :keyword skip_token: Continuation token for pagination. Default value is None. + :paramtype skip_token: str + :keyword names: Names of agent applications to retrieve. Default value is None. + :paramtype names: list[str] + :keyword search_text: Search text for filtering agent applications. Default value is None. + :paramtype search_text: str + :keyword order_by: Field to order by. Default value is None. + :paramtype order_by: str + :keyword order_by_asc: Whether to order in ascending order. Default value is False. + :paramtype order_by_asc: bool + :return: An iterator like instance of AgentApplication :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.ManagedComputeCapacity] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.AgentApplication] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ManagedComputeCapacity]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentApplication]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -20985,11 +13757,18 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_managed_compute_capacities_list_request( + _request = build_agent_applications_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, subscription_id=self._config.subscription_id, - offer=offer, - accelerator_type=accelerator_type, - deployment_id=deployment_id, + count=count, + skip=skip, + skip_token=skip_token, + names=names, + search_text=search_text, + order_by=order_by, + order_by_asc=order_by_asc, api_version=self._config.api_version, headers=_headers, params=_params, @@ -21029,7 +13808,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ManagedComputeCapacity], + List[_models.AgentApplication], deserialized.get("value", []), ) if cls: @@ -21057,278 +13836,26 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - -class CostControlsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s - :attr:`cost_controls` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "cost_control_name", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def get( - self, resource_group_name: str, account_name: str, cost_control_name: str, **kwargs: Any - ) -> _models.CostControl: - """Gets a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :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.CostControl] = kwargs.pop("cls", None) - - _request = build_cost_controls_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - cost_control_name=cost_control_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CostControl, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: _models.CostControl, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Creates or replaces a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.CostControl - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: _types.CostControl, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Creates or replaces a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.CostControl - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Creates or replaces a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "cost_control_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: Union[_models.CostControl, _types.CostControl, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Creates or replaces a cost control. + async def list_agents( + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any + ) -> _models.AgentReferenceResourceArmPaginatedResult: + """Lists agents for an Agent Application. + + Lists agents for an Agent Application. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param resource: Resource create parameters. Is either a CostControl type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.cognitiveservices.models.CostControl or - ~azure.mgmt.cognitiveservices.types.CostControl or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :return: AgentReferenceResourceArmPaginatedResult. The AgentReferenceResourceArmPaginatedResult + is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -21337,37 +13864,20 @@ async def create_or_update( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.CostControl] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.AgentReferenceResourceArmPaginatedResult] = kwargs.pop("cls", None) - _request = build_cost_controls_create_or_update_request( + _request = build_agent_applications_list_agents_request( resource_group_name=resource_group_name, account_name=account_name, - cost_control_name=cost_control_name, + project_name=project_name, + name=name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -21384,7 +13894,7 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -21397,179 +13907,35 @@ async def create_or_update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.CostControl, response.json()) + deserialized = _deserialize(_models.AgentReferenceResourceArmPaginatedResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: _models.CostControlPatch, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Updates selected properties of a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.CostControlPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: _types.CostControlPatch, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Updates selected properties of a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.cognitiveservices.types.CostControlPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Updates selected properties of a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "cost_control_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: Union[_models.CostControlPatch, _types.CostControlPatch, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Updates selected properties of a cost control. + async def enable( + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any + ) -> None: + """Enables an Agent Application. + + Enables an Agent Application. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param properties: The resource properties to be updated. Is either a CostControlPatch type or - a IO[bytes] type. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.CostControlPatch or - ~azure.mgmt.cognitiveservices.types.CostControlPatch or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -21578,37 +13944,20 @@ async def update( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.CostControl] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_cost_controls_update_request( + _request = build_agent_applications_enable_request( resource_group_name=resource_group_name, account_name=account_name, - cost_control_name=cost_control_name, + project_name=project_name, + name=name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -21617,8 +13966,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -21626,11 +13974,6 @@ async def update( 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.ErrorResponse, @@ -21638,59 +13981,26 @@ async def update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CostControl, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "cost_control_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - async def delete( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + async def disable( + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any ) -> None: - """Deletes a cost control. + """Disables an Agent Application. + + Disables an Agent Application. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -21701,12 +14011,6 @@ async def delete( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -21714,13 +14018,12 @@ async def delete( cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_cost_controls_delete_request( + _request = build_agent_applications_disable_request( resource_group_name=resource_group_name, account_name=account_name, - cost_control_name=cost_control_name, + project_name=project_name, + name=name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, api_version=self._config.api_version, headers=_headers, params=_params, @@ -21737,7 +14040,7 @@ async def delete( response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -21748,31 +14051,87 @@ async def delete( if cls: return cls(pipeline_response, None, {}) # type: ignore + +class ManagedComputeCapacitiesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.aio.CognitiveServicesManagementClient`'s + :attr:`managed_compute_capacities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace @api_version_validation( - method_added_on="2026-09-15-preview", + method_added_on="2026-03-15-preview", params_added_on={ - "2026-09-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] + "2026-03-15-preview": [ + "api_version", + "subscription_id", + "offer", + "accelerator_type", + "deployment_id", + "accept", + ], + "2026-11-01": ["location"], }, - api_versions_list=["2026-09-15-preview"], + api_versions_list=[ + "2026-03-15-preview", + "2026-05-15-preview", + "2026-07-15-preview", + "2026-09-15-preview", + "2026-11-01", + ], ) - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncItemPaged["_models.CostControl"]: - """Lists the cost controls owned by an account. + def list( + self, + *, + offer: str, + accelerator_type: Optional[str] = None, + deployment_id: Optional[str] = None, + location: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedComputeCapacity"]: + """Gets the managed compute capacities for a subscription. Returns available capacity per + accelerator type, including deployment size information. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of CostControl + :keyword offer: The offer name to query capacity for (required). Required. + :paramtype offer: str + :keyword accelerator_type: Optional accelerator type filter to narrow results to a specific + accelerator type. Default value is None. + :paramtype accelerator_type: str + :keyword deployment_id: Optional deployment resource ID. When provided, returns capacity for + the specific region + where the deployment is hosted rather than the best available region. Default value is None. + :paramtype deployment_id: str + :keyword location: Optional Azure location used to select a DataZone scope. Without a + deployment ID, + omitted or blank location returns Global and both US and EU DataZone capacities. + A supported location returns Global and the matching DataZone capacities; an + unsupported location returns Global capacity only. With a deployment ID, a + nonblank location must match the parent account location, ignoring case and + surrounding whitespace, or the request returns HTTP 400. Capacity is still + returned for the deployment's backend region. Default value is None. + :paramtype location: str + :return: An iterator like instance of ManagedComputeCapacity :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.CostControl] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.ManagedComputeCapacity] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.CostControl]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ManagedComputeCapacity]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -21785,10 +14144,12 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> As def prepare_request(next_link=None): if not next_link: - _request = build_cost_controls_list_request( - resource_group_name=resource_group_name, - account_name=account_name, + _request = build_managed_compute_capacities_list_request( subscription_id=self._config.subscription_id, + offer=offer, + accelerator_type=accelerator_type, + deployment_id=deployment_id, + location=location, api_version=self._config.api_version, headers=_headers, params=_params, @@ -21828,7 +14189,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.CostControl], + List[_models.ManagedComputeCapacity], deserialized.get("value", []), ) if cls: @@ -25255,6 +17616,7 @@ def get_long_running_output(pipeline_response): "2026-07-15-preview", "2026-09-01", "2026-09-15-preview", + "2026-11-01", ], ) async def _delete_initial( @@ -25341,6 +17703,7 @@ async def _delete_initial( "2026-07-15-preview", "2026-09-01", "2026-09-15-preview", + "2026-11-01", ], ) async def begin_delete( diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_patch.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_patch.py index 216464a0c770..ea765788358a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_patch.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_patch.py @@ -7,225 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -import asyncio # pylint: disable=do-not-import-asyncio -import time -from typing import IO, Any, Optional, Union, cast, overload -from azure.core.exceptions import HttpResponseError -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict - -from ... import models as _models, types as _types -from ..._utils.model_base import _deserialize -from ..._validation import api_version_validation -from ...operations._patch import ( - _CANCELED_STATES, - _TERMINAL_FAILED_STATES, - _TERMINAL_SUCCESS_STATES, - _decode_continuation_token, - _encode_continuation_token, - _provisioning_error, - _state_of, -) -from ._operations import ComputesOperations as _ComputesOperationsGenerated - - -class _AsyncComputeListPolling(AsyncPollingMethod): - """Poll compute provisioning through list(), avoiding the permission-gated status endpoint.""" - - _NOT_FOUND_GRACE_SECONDS = 300 - - def __init__( - self, - operations: "ComputesOperations", - resource_group_name: str, - account_name: str, - compute_name: str, - interval: float, - cls: Any = None, - ) -> None: - self._operations = operations - self._resource_group_name = resource_group_name - self._account_name = account_name - self._compute_name = compute_name - self._interval = interval - self._cls = cls - self._status = "InProgress" - self._resource: Optional[_models.Compute] = None - self._first_missing_at: Optional[float] = None - - def initialize(self, client: Any, initial_response: Any, deserialization_callback: Any) -> None: - pass - - async def _current_compute(self) -> Optional[_models.Compute]: - async for compute in self._operations.list(self._resource_group_name, self._account_name): - if getattr(compute, "name", None) == self._compute_name: - return compute - return None - - async def run(self) -> None: - while not self.finished(): - compute = await self._current_compute() - if compute is None: - if self._first_missing_at is None: - self._first_missing_at = time.monotonic() - elif time.monotonic() - self._first_missing_at > self._NOT_FOUND_GRACE_SECONDS: - raise HttpResponseError( - message=f"Compute '{self._compute_name}' did not appear in the account's compute list." - ) - else: - self._first_missing_at = None - self._resource = compute - state = _state_of(compute) - if state in _TERMINAL_SUCCESS_STATES: - self._status = "Succeeded" - elif state in _TERMINAL_FAILED_STATES: - self._status = "Canceled" if state in _CANCELED_STATES else "Failed" - raise _provisioning_error(compute) - if not self.finished(): - await asyncio.sleep(self._interval) - - def status(self) -> str: - return self._status - - def finished(self) -> bool: - return self._status in ("Succeeded", "Failed", "Canceled") - - def resource(self) -> Optional[_models.Compute]: - if self._resource is not None and self._cls is not None: - return self._cls(None, self._resource, {}) - return self._resource - - def get_continuation_token(self) -> str: - return _encode_continuation_token(self._resource_group_name, self._account_name, self._compute_name) - - @classmethod - def from_continuation_token(cls, continuation_token: str, **kwargs: Any): - _decode_continuation_token(continuation_token) - return kwargs["client"], None, kwargs["deserialization_callback"] - - -class ComputesOperations(_ComputesOperationsGenerated): - """Computes operations that poll provisioning through the account's compute list.""" - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: _models.Compute, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> AsyncLROPoller[_models.Compute]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: _types.Compute, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> AsyncLROPoller[_models.Compute]: ... - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> AsyncLROPoller[_models.Compute]: ... - - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - "content_type", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - async def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: Union[_models.Compute, _types.Compute, IO[bytes]], - **kwargs: Any, - ) -> AsyncLROPoller[_models.Compute]: - _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: Any = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - continuation_token: Optional[str] = kwargs.pop("continuation_token", None) - if continuation_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - resource=resource, - content_type=content_type, - cls=lambda response, value, headers: response, - headers=_headers, - params=_params, - **kwargs, - ) - await raw_result.http_response.read() # type: ignore - try: - initial_body = raw_result.http_response.json() - except Exception: # pylint: disable=broad-except - initial_body = None - if isinstance(initial_body, dict) and _state_of(initial_body) in _TERMINAL_FAILED_STATES: - raise _provisioning_error(initial_body) - else: - resource_group_name, account_name, compute_name = _decode_continuation_token(continuation_token) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = _deserialize(_models.Compute, pipeline_response.http_response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - _AsyncComputeListPolling(self, resource_group_name, account_name, compute_name, lro_delay, cls), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if continuation_token: - return AsyncLROPoller[_models.Compute].from_continuation_token( - polling_method=polling_method, - continuation_token=continuation_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Compute]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -__all__: list[str] = ["ComputesOperations"] +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py index 5486bc40dd5b..0d791ab53018 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py @@ -23,13 +23,9 @@ AccountProperties, AccountSku, AccountSkuListResult, - AdapterDeployment, - AdapterDeploymentLastOperation, - AdapterDeploymentProperties, AgentApplication, AgentDeployment, AgentDeploymentProperties, - AgentHostingConfiguration, AgentProtocolVersion, AgentReference, AgentReferenceProperties, @@ -40,19 +36,6 @@ ApiProperties, ApplicationAuthorizationPolicy, ApplicationTrafficRoutingPolicy, - ArcDeployment, - ArcDeploymentCpuMemoryResourceRequirements, - ArcDeploymentKubernetesResources, - ArcDeploymentModel, - ArcDeploymentPatchCpuMemoryResourceRequirements, - ArcDeploymentPatchKubernetesResources, - ArcDeploymentProperties, - ArcDeploymentProvisioningDetails, - ArcDeploymentResourceRequirements, - ArcDeploymentSku, - ArcDeploymentUpdate, - ArcDeploymentUpdateProperties, - ArcDeploymentVllmParameters, AssignedIdentity, BillingMeterInfo, CalculateModelCapacityParameter, @@ -61,12 +44,11 @@ CallRateLimit, CapabilityHost, CapabilityHostProperties, - CapabilitySettings, CapacityConfig, + CertificateBundleReference, ChannelsBuiltInAuthorizationPolicy, CheckDomainAvailabilityParameter, CheckSkuAvailabilityParameter, - ClusterComputeProperties, CommitmentCost, CommitmentPeriod, CommitmentPlan, @@ -76,10 +58,6 @@ CommitmentPlanProperties, CommitmentQuota, CommitmentTier, - Compute, - ComputeOperationStatus, - ComputeOperationStatusProperties, - ComputeProperties, ConnectionAccessKey, ConnectionAccountKey, ConnectionApiKey, @@ -92,17 +70,6 @@ ConnectionSharedAccessSignature, ConnectionUpdateContent, ConnectionUsernamePassword, - ConnectivityEndpoints, - ContainerInstanceComputeProperties, - CostControl, - CostControlConnections, - CostControlDimension, - CostControlMatch, - CostControlPatch, - CostControlPatchProperties, - CostControlProperties, - CostControlRule, - CostControlThreshold, CustomBlocklistConfig, CustomKeys, CustomKeysConnectionProperties, @@ -111,12 +78,10 @@ Deployment, DeploymentCapacitySettings, DeploymentModel, - DeploymentPolicyEvaluationResult, DeploymentProperties, DeploymentRouting, DeploymentScaleSettings, DeploymentSizeCapacity, - DeploymentSpeculativeDecoding, DomainAvailability, Encryption, EncryptionScope, @@ -124,27 +89,14 @@ ErrorAdditionalInfo, ErrorDetail, ErrorResponse, - EvaluateDeploymentPoliciesDeployment, - EvaluateDeploymentPoliciesDeploymentProperties, - EvaluateDeploymentPoliciesRequest, - EvaluateDeploymentPoliciesResponse, - FoundryAutoUpgrade, FqdnOutboundRule, - GatedModelAccessProperties, HostedAgentDeployment, Identity, IpRule, KeyVaultProperties, ManagedAgentDeployment, - ManagedClusterAgentHostingConfiguration, ManagedComputeCapacity, ManagedComputeCapacityProperties, - ManagedComputeDeployment, - ManagedComputeDeploymentInfo, - ManagedComputeDeploymentProperties, - ManagedComputeDeploymentProvisioningDetails, - ManagedComputeDeploymentRoutes, - ManagedComputeUsage, ManagedIdentityAuthTypeConnectionProperties, ManagedNetworkProvisionOptions, ManagedNetworkProvisionStatus, @@ -180,12 +132,8 @@ OutboundRule, OutboundRuleBasicResource, PATAuthTypeConnectionProperties, - PatchResourceSku, PatchResourceTags, PatchResourceTagsAndSku, - PolicyAssignmentEvaluationDetails, - PolicyExpressionEvaluationDetails, - Pool, PrivateEndpoint, PrivateEndpointConnection, PrivateEndpointConnectionListResult, @@ -207,18 +155,6 @@ QuotaTier, QuotaTierProperties, QuotaTierUpgradeEligibilityInfo, - RaiAcsEmptyObject, - RaiAcsHarmConfiguration, - RaiAcsInterventionPoint, - RaiAcsInterventionPoints, - RaiAcsManifest, - RaiAcsModerationBindingExtension, - RaiAcsPolicyBinding, - RaiAcsRegoPolicyDefinition, - RaiAcsToolDefinition, - RaiAcsToolInterventionPoint, - RaiBinding, - RaiBindingProperties, RaiBlocklist, RaiBlocklistConfig, RaiBlocklistItem, @@ -241,11 +177,7 @@ RaiMonitorConfig, RaiPolicy, RaiPolicyContentFilter, - RaiPolicyCustomExternalSafetyProviderReference, RaiPolicyProperties, - RaiRego, - RaiRegoProperties, - RaiRegoReference, RaiSafetyProviderConfig, RaiToolLabel, RaiToolLabelProperties, @@ -274,10 +206,10 @@ SkuCapability, SkuChangeInfo, SkuResource, - SshSettings, SystemData, ThrottlingRule, TrafficRoutingRule, + TrustedCertificateSource, Usage, UsageListResult, UserAssignedIdentity, @@ -286,43 +218,25 @@ UsernamePasswordAuthTypeConnectionProperties, VersionedAgentReference, VirtualNetworkRule, - Workbench, - WorkbenchProperties, - WorkbenchUpdate, - WorkbenchUpdateProperties, ) from ._enums import ( # type: ignore AbusePenaltyAction, ActionType, - AdapterDeploymentOperationState, - AdapterDeploymentOperationType, AgentDeploymentProvisioningState, AgentDeploymentState, AgentDeploymentType, - AgentHostingType, AgentProtocol, AgenticApplicationProvisioningState, - ArcDeploymentComputeType, - ArcDeploymentRuntime, - ArcDeploymentSkuName, BuiltInAuthorizationScheme, ByPassSelection, CapabilityHostKind, CapabilityHostProvisioningState, CommitmentPlanProvisioningState, - ComputeOperationStatusType, - ComputeProvisioningState, - ComputeType, ConnectionAuthType, ConnectionCategory, ConnectionGroup, ContentLevel, - CostControlDimensionType, - CostControlPeriod, - CostControlThresholdAction, - CostControlThresholdType, - CostControlUnit, CreatedByType, DefenderForAISettingState, DeploymentModelVersionUpgradeOption, @@ -333,7 +247,6 @@ EncryptionScopeProvisioningState, EncryptionScopeState, FirewallSku, - FoundryAutoUpgradeMode, HostingModel, IdentityKind, IdentityManagementType, @@ -350,19 +263,12 @@ NetworkRuleAction, NspAccessRuleDirection, Origin, - PolicyEvaluationOutcome, PrivateEndpointConnectionProvisioningState, PrivateEndpointServiceConnectionStatus, ProvisioningState, PublicNetworkAccess, QuotaScopeType, QuotaUsageStatus, - RaiAcsHarmCategory, - RaiAcsModerationSubjectFormat, - RaiAcsPolicyDefinitionType, - RaiAcsPolicyTarget, - RaiAcsPolicyTargetKind, - RaiAcsToolNameSelector, RaiActionType, RaiEgressDefaultAction, RaiEgressHeaderOperation, @@ -371,10 +277,8 @@ RaiEgressRuleType, RaiEgressScheme, RaiPolicyContentSource, - RaiPolicyFormat, RaiPolicyMode, RaiPolicyType, - RaiRegoEncoding, ResourceIdentityType, ResourceSkuRestrictionsReasonCode, ResourceSkuRestrictionsType, @@ -389,11 +293,9 @@ SkuTier, TierUpgradePolicy, TrafficRoutingProtocol, + TrustedCertificateSourceType, UnitType, UpgradeAvailabilityStatus, - VmPriority, - WorkbenchProvisioningState, - WorkbenchStatus, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -409,13 +311,9 @@ "AccountProperties", "AccountSku", "AccountSkuListResult", - "AdapterDeployment", - "AdapterDeploymentLastOperation", - "AdapterDeploymentProperties", "AgentApplication", "AgentDeployment", "AgentDeploymentProperties", - "AgentHostingConfiguration", "AgentProtocolVersion", "AgentReference", "AgentReferenceProperties", @@ -426,19 +324,6 @@ "ApiProperties", "ApplicationAuthorizationPolicy", "ApplicationTrafficRoutingPolicy", - "ArcDeployment", - "ArcDeploymentCpuMemoryResourceRequirements", - "ArcDeploymentKubernetesResources", - "ArcDeploymentModel", - "ArcDeploymentPatchCpuMemoryResourceRequirements", - "ArcDeploymentPatchKubernetesResources", - "ArcDeploymentProperties", - "ArcDeploymentProvisioningDetails", - "ArcDeploymentResourceRequirements", - "ArcDeploymentSku", - "ArcDeploymentUpdate", - "ArcDeploymentUpdateProperties", - "ArcDeploymentVllmParameters", "AssignedIdentity", "BillingMeterInfo", "CalculateModelCapacityParameter", @@ -447,12 +332,11 @@ "CallRateLimit", "CapabilityHost", "CapabilityHostProperties", - "CapabilitySettings", "CapacityConfig", + "CertificateBundleReference", "ChannelsBuiltInAuthorizationPolicy", "CheckDomainAvailabilityParameter", "CheckSkuAvailabilityParameter", - "ClusterComputeProperties", "CommitmentCost", "CommitmentPeriod", "CommitmentPlan", @@ -462,10 +346,6 @@ "CommitmentPlanProperties", "CommitmentQuota", "CommitmentTier", - "Compute", - "ComputeOperationStatus", - "ComputeOperationStatusProperties", - "ComputeProperties", "ConnectionAccessKey", "ConnectionAccountKey", "ConnectionApiKey", @@ -478,17 +358,6 @@ "ConnectionSharedAccessSignature", "ConnectionUpdateContent", "ConnectionUsernamePassword", - "ConnectivityEndpoints", - "ContainerInstanceComputeProperties", - "CostControl", - "CostControlConnections", - "CostControlDimension", - "CostControlMatch", - "CostControlPatch", - "CostControlPatchProperties", - "CostControlProperties", - "CostControlRule", - "CostControlThreshold", "CustomBlocklistConfig", "CustomKeys", "CustomKeysConnectionProperties", @@ -497,12 +366,10 @@ "Deployment", "DeploymentCapacitySettings", "DeploymentModel", - "DeploymentPolicyEvaluationResult", "DeploymentProperties", "DeploymentRouting", "DeploymentScaleSettings", "DeploymentSizeCapacity", - "DeploymentSpeculativeDecoding", "DomainAvailability", "Encryption", "EncryptionScope", @@ -510,27 +377,14 @@ "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", - "EvaluateDeploymentPoliciesDeployment", - "EvaluateDeploymentPoliciesDeploymentProperties", - "EvaluateDeploymentPoliciesRequest", - "EvaluateDeploymentPoliciesResponse", - "FoundryAutoUpgrade", "FqdnOutboundRule", - "GatedModelAccessProperties", "HostedAgentDeployment", "Identity", "IpRule", "KeyVaultProperties", "ManagedAgentDeployment", - "ManagedClusterAgentHostingConfiguration", "ManagedComputeCapacity", "ManagedComputeCapacityProperties", - "ManagedComputeDeployment", - "ManagedComputeDeploymentInfo", - "ManagedComputeDeploymentProperties", - "ManagedComputeDeploymentProvisioningDetails", - "ManagedComputeDeploymentRoutes", - "ManagedComputeUsage", "ManagedIdentityAuthTypeConnectionProperties", "ManagedNetworkProvisionOptions", "ManagedNetworkProvisionStatus", @@ -566,12 +420,8 @@ "OutboundRule", "OutboundRuleBasicResource", "PATAuthTypeConnectionProperties", - "PatchResourceSku", "PatchResourceTags", "PatchResourceTagsAndSku", - "PolicyAssignmentEvaluationDetails", - "PolicyExpressionEvaluationDetails", - "Pool", "PrivateEndpoint", "PrivateEndpointConnection", "PrivateEndpointConnectionListResult", @@ -593,18 +443,6 @@ "QuotaTier", "QuotaTierProperties", "QuotaTierUpgradeEligibilityInfo", - "RaiAcsEmptyObject", - "RaiAcsHarmConfiguration", - "RaiAcsInterventionPoint", - "RaiAcsInterventionPoints", - "RaiAcsManifest", - "RaiAcsModerationBindingExtension", - "RaiAcsPolicyBinding", - "RaiAcsRegoPolicyDefinition", - "RaiAcsToolDefinition", - "RaiAcsToolInterventionPoint", - "RaiBinding", - "RaiBindingProperties", "RaiBlocklist", "RaiBlocklistConfig", "RaiBlocklistItem", @@ -627,11 +465,7 @@ "RaiMonitorConfig", "RaiPolicy", "RaiPolicyContentFilter", - "RaiPolicyCustomExternalSafetyProviderReference", "RaiPolicyProperties", - "RaiRego", - "RaiRegoProperties", - "RaiRegoReference", "RaiSafetyProviderConfig", "RaiToolLabel", "RaiToolLabelProperties", @@ -660,10 +494,10 @@ "SkuCapability", "SkuChangeInfo", "SkuResource", - "SshSettings", "SystemData", "ThrottlingRule", "TrafficRoutingRule", + "TrustedCertificateSource", "Usage", "UsageListResult", "UserAssignedIdentity", @@ -672,40 +506,22 @@ "UsernamePasswordAuthTypeConnectionProperties", "VersionedAgentReference", "VirtualNetworkRule", - "Workbench", - "WorkbenchProperties", - "WorkbenchUpdate", - "WorkbenchUpdateProperties", "AbusePenaltyAction", "ActionType", - "AdapterDeploymentOperationState", - "AdapterDeploymentOperationType", "AgentDeploymentProvisioningState", "AgentDeploymentState", "AgentDeploymentType", - "AgentHostingType", "AgentProtocol", "AgenticApplicationProvisioningState", - "ArcDeploymentComputeType", - "ArcDeploymentRuntime", - "ArcDeploymentSkuName", "BuiltInAuthorizationScheme", "ByPassSelection", "CapabilityHostKind", "CapabilityHostProvisioningState", "CommitmentPlanProvisioningState", - "ComputeOperationStatusType", - "ComputeProvisioningState", - "ComputeType", "ConnectionAuthType", "ConnectionCategory", "ConnectionGroup", "ContentLevel", - "CostControlDimensionType", - "CostControlPeriod", - "CostControlThresholdAction", - "CostControlThresholdType", - "CostControlUnit", "CreatedByType", "DefenderForAISettingState", "DeploymentModelVersionUpgradeOption", @@ -716,7 +532,6 @@ "EncryptionScopeProvisioningState", "EncryptionScopeState", "FirewallSku", - "FoundryAutoUpgradeMode", "HostingModel", "IdentityKind", "IdentityManagementType", @@ -733,19 +548,12 @@ "NetworkRuleAction", "NspAccessRuleDirection", "Origin", - "PolicyEvaluationOutcome", "PrivateEndpointConnectionProvisioningState", "PrivateEndpointServiceConnectionStatus", "ProvisioningState", "PublicNetworkAccess", "QuotaScopeType", "QuotaUsageStatus", - "RaiAcsHarmCategory", - "RaiAcsModerationSubjectFormat", - "RaiAcsPolicyDefinitionType", - "RaiAcsPolicyTarget", - "RaiAcsPolicyTargetKind", - "RaiAcsToolNameSelector", "RaiActionType", "RaiEgressDefaultAction", "RaiEgressHeaderOperation", @@ -754,10 +562,8 @@ "RaiEgressRuleType", "RaiEgressScheme", "RaiPolicyContentSource", - "RaiPolicyFormat", "RaiPolicyMode", "RaiPolicyType", - "RaiRegoEncoding", "ResourceIdentityType", "ResourceSkuRestrictionsReasonCode", "ResourceSkuRestrictionsType", @@ -772,11 +578,9 @@ "SkuTier", "TierUpgradePolicy", "TrafficRoutingProtocol", + "TrustedCertificateSourceType", "UnitType", "UpgradeAvailabilityStatus", - "VmPriority", - "WorkbenchProvisioningState", - "WorkbenchStatus", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_enums.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_enums.py index e058922c7344..d7dc8e6a0d05 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_enums.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_enums.py @@ -29,30 +29,6 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Actions are for internal-only APIs.""" -class AdapterDeploymentOperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Lifecycle operation states reported by an adapter deployment.""" - - ACCEPTED = "Accepted" - """The operation was accepted.""" - RUNNING = "Running" - """The operation is running.""" - SUCCEEDED = "Succeeded" - """The operation completed successfully.""" - FAILED = "Failed" - """The operation failed.""" - - -class AdapterDeploymentOperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Lifecycle operation types reported by an adapter deployment.""" - - CREATE = "Create" - """Creates the adapter deployment.""" - UPDATE = "Update" - """Re-targets the adapter deployment.""" - DELETE = "Delete" - """Deletes the adapter deployment.""" - - class AgentDeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of an agentic deployment, as an Azure resource.""" @@ -104,13 +80,6 @@ class AgentDeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The underlying infra is provisioned by the deployer (BYO).""" -class AgentHostingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of infrastructure used to host Foundry agents.""" - - MANAGED_CLUSTER = "ManagedCluster" - """Agents are hosted on an Azure Kubernetes Service managed cluster.""" - - class AgenticApplicationProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of an agentic application.""" @@ -139,31 +108,6 @@ class AgentProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """OpenAI-compatible.""" -class ArcDeploymentComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Compute type for an Arc deployment.""" - - GPU = "gpu" - """GPU compute.""" - CPU = "cpu" - """CPU compute.""" - - -class ArcDeploymentRuntime(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Inference runtime for an Arc deployment.""" - - VLLM = "vllm" - """vLLM runtime.""" - ONNX = "onnx-genai" - """ONNX runtime.""" - - -class ArcDeploymentSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SKU for an Arc deployment.""" - - ARC = "Arc" - """Arc SKU.""" - - class BuiltInAuthorizationScheme(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Authorization scheme type.""" @@ -229,55 +173,6 @@ class CommitmentPlanProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMe """CANCELED.""" -class ComputeOperationStatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status type of a compute operation.""" - - IN_PROGRESS = "InProgress" - """The operation is in progress.""" - SUCCEEDED = "Succeeded" - """The operation has succeeded.""" - FAILED = "Failed" - """The operation has failed.""" - CANCELED = "Canceled" - """The operation has been canceled.""" - - -class ComputeProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state of a compute resource.""" - - ACCEPTED = "Accepted" - """The resource provisioning request has been accepted.""" - SUCCEEDED = "Succeeded" - """The resource has been fully provisioned.""" - FAILED = "Failed" - """The resource provisioning has failed.""" - CANCELED = "Canceled" - """The resource provisioning was canceled.""" - DELETING = "Deleting" - """The resource is being deleted.""" - SCALING = "Scaling" - """The resource is scaling.""" - DISABLED = "Disabled" - """The resource is disabled.""" - STARTING = "Starting" - """The compute resource is starting.""" - STOPPING = "Stopping" - """The compute resource is stopping.""" - RESTARTING = "Restarting" - """The compute resource is restarting.""" - STOPPED = "Stopped" - """The compute resource is stopped.""" - - -class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of compute resource.""" - - CLUSTER = "Cluster" - """Cluster (AKS-backed) compute type.""" - CONTAINER_INSTANCE = "ContainerInstance" - """Container Instance compute type.""" - - class ConnectionAuthType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Authentication type of the connection target.""" @@ -474,8 +369,6 @@ class ConnectionCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): """GENERIC_REST.""" REMOTE_TOOL = "RemoteTool" """REMOTE_TOOL.""" - OPEN_API = "OpenAPI" - """Connection to an endpoint described by an OpenAPI specification.""" AMAZON_MWS = "AmazonMws" """AMAZON_MWS.""" CONCUR = "Concur" @@ -598,69 +491,6 @@ class ContentLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """HIGH.""" -class CostControlDimensionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Cost control counter dimensions, including Custom retained for legacy read compatibility.""" - - AGENT = "Agent" - """Consumption is partitioned by the stable Foundry agent ID.""" - IDENTITY = "Identity" - """Consumption is partitioned by the authenticated principal object ID.""" - SESSION = "Session" - """Consumption is partitioned by the Foundry session ID.""" - PROJECT = "Project" - """Consumption is partitioned by the Foundry project resource ID.""" - ACCOUNT = "Account" - """Consumption is partitioned by the owning Cognitive Services account.""" - CUSTOM = "Custom" - """Legacy read-only dimension using ``CostControlDimension.Attribute``. New Custom counter - authoring is reserved for future support.""" - - -class CostControlPeriod(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Calendar-aligned UTC renewal periods, including legacy values retained for read compatibility.""" - - MINUTE = "Minute" - """Legacy read-only period renewing at the start of the next UTC minute.""" - HOUR = "Hour" - """Legacy read-only period renewing at the start of the next UTC hour.""" - DAY = "Day" - """Renews daily at 00:00 UTC.""" - WEEK = "Week" - """Renews Monday at 00:00 UTC.""" - MONTH = "Month" - """Renews on the first day of each month at 00:00 UTC.""" - YEAR = "Year" - """Legacy read-only period renewing January 1 at 00:00 UTC.""" - - -class CostControlThresholdAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The supported actions when a threshold is reached.""" - - AUDIT = "Audit" - """Legacy read-only action retained to deserialize existing definitions without changing their - semantics.""" - ALERT = "Alert" - """Emits a customer-facing alert without blocking requests.""" - BLOCK = "Block" - """Blocks the request without emitting a customer-facing alert.""" - - -class CostControlThresholdType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The supported threshold value interpretations.""" - - PERCENTAGE = "Percentage" - """The value is a percentage of the configured rule amount.""" - ABSOLUTE = "Absolute" - """The value is expressed in the rule's unit.""" - - -class CostControlUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The supported unit for cost control amounts and thresholds.""" - - USD = "Usd" - """Estimated cost in United States dollars.""" - - class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The kind of entity that created the resource.""" @@ -786,15 +616,6 @@ class FirewallSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): """BASIC.""" -class FoundryAutoUpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represents the mode for foundry auto-upgrade configuration.""" - - ENABLED = "Enabled" - """Auto-upgrade is enabled.""" - DISABLED = "Disabled" - """Auto-upgrade is disabled (opted out).""" - - class HostingModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Account hosting model.""" @@ -992,17 +813,6 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates the operation is initiated by a user or system.""" -class PolicyEvaluationOutcome(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The outcome of a policy evaluation.""" - - COMPLIANT = "Compliant" - """The deployment is compliant with all policies.""" - NON_COMPLIANT = "NonCompliant" - """The deployment violates one or more policies.""" - ERROR = "Error" - """An error occurred during evaluation.""" - - class PrivateEndpointConnectionProvisioningState( # pylint: disable=name-too-long str, Enum, metaclass=CaseInsensitiveEnumMeta ): @@ -1048,8 +858,6 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """CANCELED.""" RESOLVING_DNS = "ResolvingDNS" """RESOLVING_DNS.""" - EXTENSION_UNREACHABLE = "ExtensionUnreachable" - """EXTENSION_UNREACHABLE.""" class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1087,81 +895,6 @@ class QuotaUsageStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """UNKNOWN.""" -class RaiAcsHarmCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Harm categories supported by the Unified Moderate text profile.""" - - HATE = "Hate" - """Hate-related content.""" - SELF_HARM = "SelfHarm" - """Self-harm-related content.""" - SEXUAL = "Sexual" - """Sexual content.""" - VIOLENCE = "Violence" - """Violent content.""" - PROMPT_INJECTION = "PromptInjection" - """Prompt-injection content.""" - PROTECTED_MATERIAL_TEXT = "ProtectedMaterialText" - """Protected text material.""" - PROTECTED_MATERIAL_CODE = "ProtectedMaterialCode" - """Protected source-code material.""" - - -class RaiAcsModerationSubjectFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The representation sent to Azure AI Content Safety moderation capabilities.""" - - TEXT = "text" - """Moderates the selected policy target as text.""" - CANONICAL_JSON = "canonical_json" - """Moderates the canonical JSON representation of the selected policy target.""" - - -class RaiAcsPolicyDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The policy language supported by the Azure AI Content Safety Unified Moderate host profile.""" - - REGO = "rego" - """A policy evaluated by Rego.""" - - -class RaiAcsPolicyTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Canonical policy targets supported by the Azure AI Content Safety Unified Moderate host - profile. - """ - - INPUT = "$snap.input" - """Selects the incoming user input.""" - OUTPUT = "$snap.output" - """Selects the assistant output.""" - TOOL_ARGUMENTS = "$snap.tool_call.args" - """Selects tool-call arguments.""" - TOOL_RESULT = "$snap.tool_result.value" - """Selects a tool result.""" - - -class RaiAcsPolicyTargetKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Canonical target kinds supported by the Azure AI Content Safety Unified Moderate host profile.""" - - USER_INPUT = "user_input" - """The target contains user input.""" - ASSISTANT_OUTPUT = "assistant_output" - """The target contains assistant output.""" - TOOL_ARGUMENTS = "tool_args" - """The target contains tool-call arguments.""" - TOOL_RESULT = "tool_result" - """The target contains a tool result.""" - - -class RaiAcsToolNameSelector(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Snapshot paths for selecting a tool catalog entry. The listed values are recognized by the - Azure AI Content Safety Unified Moderate host profile; other values are allowed for forward - compatibility. - """ - - TOOL_CALL_NAME = "$snap.tool_call.name" - """Selects the tool-call name from the canonical snapshot root.""" - TOOL_CALL_NAME_ALIAS = "$.tool_call.name" - """Selects the tool-call name through the snapshot-root alias.""" - - class RaiActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The action types to apply to the content filters.""" @@ -1255,15 +988,6 @@ class RaiPolicyContentSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): """POST_RUN.""" -class RaiPolicyFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The public representation used by a RAI policy body.""" - - CONTENT_FILTERS = "ContentFilters" - """A legacy content-filter policy.""" - ACS = "ACS" - """An Agent Control Specification policy.""" - - class RaiPolicyMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2025-06-01. It is the same as @@ -1289,15 +1013,6 @@ class RaiPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SYSTEM_MANAGED.""" -class RaiRegoEncoding(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The transport encoding of reusable Rego source.""" - - NONE = "None" - """The Rego property contains plain UTF-8 source.""" - BASE64 = "Base64" - """The Rego property contains Base64-encoded UTF-8 source.""" - - class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The identity type.""" @@ -1460,6 +1175,13 @@ class TrafficRoutingProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Percentage based routing.""" +class TrustedCertificateSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of Azure resource containing trusted CA certificate bundles.""" + + AZURE_KEY_VAULT = "AzureKeyVault" + """Azure Key Vault secrets containing CA certificates or certificate bundles.""" + + class UnitType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The unit of the metric.""" @@ -1486,50 +1208,3 @@ class UpgradeAvailabilityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AVAILABLE.""" NOT_AVAILABLE = "NotAvailable" """NOT_AVAILABLE.""" - - -class VmPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """VM priority for a compute pool.""" - - REGULAR = "Regular" - """Regular VM priority.""" - SPOT = "Spot" - """Spot VM priority.""" - - -class WorkbenchProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of a workbench resource, independent of runtime lifecycle status.""" - - CREATING = "Creating" - """The workbench resource is being created.""" - SUCCEEDED = "Succeeded" - """The workbench resource has been provisioned.""" - FAILED = "Failed" - """Provisioning of the workbench resource failed.""" - CANCELED = "Canceled" - """Provisioning of the workbench resource was canceled.""" - - -class WorkbenchStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Runtime lifecycle status of a workbench.""" - - UNKNOWN = "Unknown" - """The runtime status is unknown.""" - CREATING = "Creating" - """The runtime is being created.""" - STARTING = "Starting" - """The runtime is starting.""" - RUNNING = "Running" - """The runtime is running.""" - STOPPING = "Stopping" - """The runtime is stopping.""" - STOPPED = "Stopped" - """The runtime is stopped.""" - RESTARTING = "Restarting" - """The runtime is restarting.""" - UPDATING = "Updating" - """The runtime is being updated.""" - DELETING = "Deleting" - """The runtime is being deleted.""" - FAILED = "Failed" - """The runtime has failed.""" diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models.py index 93bfd60894dc..1adda58bc238 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/_models.py @@ -12,14 +12,7 @@ from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload from .._utils.model_base import Model as _Model, rest_discriminator, rest_field -from ._enums import ( - AgentDeploymentType, - AgentHostingType, - BuiltInAuthorizationScheme, - ComputeType, - ConnectionAuthType, - RuleType, -) +from ._enums import AgentDeploymentType, BuiltInAuthorizationScheme, ConnectionAuthType, RuleType if TYPE_CHECKING: from .. import models as _models @@ -55,11 +48,11 @@ class ConnectionPropertiesV2(_Model): # pylint: disable=docstring-keyword-shoul "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -117,10 +110,10 @@ class ConnectionPropertiesV2(_Model): # pylint: disable=docstring-keyword-shoul \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -206,11 +199,11 @@ class AADAuthTypeConnectionProperties( "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -243,7 +236,7 @@ class AADAuthTypeConnectionProperties( :ivar use_workspace_managed_identity: :vartype use_workspace_managed_identity: bool :ivar auth_type: Authentication type of the connection target. Required. AAD. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.AAD + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ auth_type: Literal[ConnectionAuthType.AAD] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -339,11 +332,11 @@ class AccessKeyAuthTypeConnectionProperties( "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -378,7 +371,7 @@ class AccessKeyAuthTypeConnectionProperties( :ivar credentials: :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionAccessKey :ivar auth_type: Authentication type of the connection target. Required. ACCESS_KEY. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ACCESS_KEY + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ credentials: Optional["_models.ConnectionAccessKey"] = rest_field( @@ -550,11 +543,11 @@ class AccountKeyAuthTypeConnectionProperties( "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -589,7 +582,7 @@ class AccountKeyAuthTypeConnectionProperties( :ivar credentials: Account key object for connection credential. :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionAccountKey :ivar auth_type: Authentication type of the connection target. Required. ACCOUNT_KEY. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ACCOUNT_KEY + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ credentials: Optional["_models.ConnectionAccountKey"] = rest_field( @@ -818,7 +811,7 @@ class AccountProperties(_Model): # pylint: disable=docstring-keyword-should-mat :ivar provisioning_state: Gets the status of the cognitive services account at the time the operation was called. Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", - "Succeeded", "Canceled", "ResolvingDNS", and "ExtensionUnreachable". + "Succeeded", "Canceled", and "ResolvingDNS". :vartype provisioning_state: str or ~azure.mgmt.cognitiveservices.models.ProvisioningState :ivar endpoint: Endpoint of the created account. :vartype endpoint: str @@ -893,9 +886,6 @@ class AccountProperties(_Model): # pylint: disable=docstring-keyword-should-mat :vartype rai_monitor_config: ~azure.mgmt.cognitiveservices.models.RaiMonitorConfig :ivar network_injections: :vartype network_injections: list[~azure.mgmt.cognitiveservices.models.NetworkInjection] - :ivar foundry_auto_upgrade: Represents the foundry auto-upgrade configuration for a Cognitive - Services account. - :vartype foundry_auto_upgrade: ~azure.mgmt.cognitiveservices.models.FoundryAutoUpgrade :ivar allow_project_management: Specifies whether this resource support project management as child resources, used as containers for access management, data isolation and cost in AI Foundry. @@ -906,28 +896,14 @@ class AccountProperties(_Model): # pylint: disable=docstring-keyword-should-mat :ivar associated_projects: Specifies the projects, by project name, that are associated with this resource. :vartype associated_projects: list[str] - :ivar capability_settings: Reusable default agent capability settings inherited by child - projects. - :vartype capability_settings: ~azure.mgmt.cognitiveservices.models.CapabilitySettings - :ivar agent_hosting_configurations: Customer-owned AKS hosting configurations for Foundry - agents. This property can only be specified when the account is created; an existing account - without a hosting configuration cannot add one later. This API version supports exactly one - configuration, while the array shape is reserved for future API versions that may support - multiple configurations. Once set, the configuration cannot be changed, removed, or reordered. - Account update requests should omit this property or send the complete existing value - unchanged. Responses only include hosting configuration types defined by the requested API - version. - :vartype agent_hosting_configurations: - list[~azure.mgmt.cognitiveservices.models.AgentHostingConfiguration] - :ivar cost_control_ids: The full resource IDs of cost controls directly attached to this - account. At the moment the service only supports a single cost control. This will be expanded - in future API versions. - :vartype cost_control_ids: list[str] - :ivar cost_control_connections: The account-level connections used to publish cost control - telemetry and events. Application Insights is optional for attachment, accounting, and - enforcement and can be configured later. Event Grid must be configured before attaching a cost - control with an alert threshold. - :vartype cost_control_connections: ~azure.mgmt.cognitiveservices.models.CostControlConnections + :ivar trusted_certificate_sources: Private CA trust sources for supported features in an + AIServices account with allowProjectManagement enabled. Supports one Azure Key Vault source + containing version-pinned references to secrets with PEM-encoded CA certificates or certificate + bundles. On PUT or PATCH, a non-null array replaces the complete configuration, so include all + references to retain. Omit this property or send null to preserve the existing configuration; + send an empty array to clear it. + :vartype trusted_certificate_sources: + list[~azure.mgmt.cognitiveservices.models.TrustedCertificateSource] """ provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( @@ -935,7 +911,7 @@ class AccountProperties(_Model): # pylint: disable=docstring-keyword-should-mat ) """Gets the status of the cognitive services account at the time the operation was called. Known values are: \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", - \"Canceled\", \"ResolvingDNS\", and \"ExtensionUnreachable\".""" + \"Canceled\", and \"ResolvingDNS\".""" endpoint: Optional[str] = rest_field(visibility=["read"]) """Endpoint of the created account.""" internal_id: Optional[str] = rest_field(name="internalId", visibility=["read"]) @@ -945,9 +921,7 @@ class AccountProperties(_Model): # pylint: disable=docstring-keyword-should-mat a specific feature. The values are read-only and for reference only.""" is_migrated: Optional[bool] = rest_field(name="isMigrated", visibility=["read"]) """If the resource is migrated from an existing key.""" - migration_token: Optional[str] = rest_field( - name="migrationToken", visibility=["read", "create", "update", "delete", "query"] - ) + migration_token: Optional[str] = rest_field(name="migrationToken", visibility=["create", "update"]) """Resource migration token.""" sku_change_info: Optional["_models.SkuChangeInfo"] = rest_field(name="skuChangeInfo", visibility=["read"]) """Sku change info of account.""" @@ -1032,10 +1006,6 @@ class AccountProperties(_Model): # pylint: disable=docstring-keyword-should-mat network_injections: Optional[list["_models.NetworkInjection"]] = rest_field( name="networkInjections", visibility=["read", "create", "update", "delete", "query"] ) - foundry_auto_upgrade: Optional["_models.FoundryAutoUpgrade"] = rest_field( - name="foundryAutoUpgrade", visibility=["read", "create", "update", "delete", "query"] - ) - """Represents the foundry auto-upgrade configuration for a Cognitive Services account.""" allow_project_management: Optional[bool] = rest_field( name="allowProjectManagement", visibility=["read", "create", "update", "delete", "query"] ) @@ -1050,31 +1020,15 @@ class AccountProperties(_Model): # pylint: disable=docstring-keyword-should-mat name="associatedProjects", visibility=["read", "create", "update", "delete", "query"] ) """Specifies the projects, by project name, that are associated with this resource.""" - capability_settings: Optional["_models.CapabilitySettings"] = rest_field( - name="capabilitySettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Reusable default agent capability settings inherited by child projects.""" - agent_hosting_configurations: Optional[list["_models.AgentHostingConfiguration"]] = rest_field( - name="agentHostingConfigurations", visibility=["read", "create"] - ) - """Customer-owned AKS hosting configurations for Foundry agents. This property can only be - specified when the account is created; an existing account without a hosting configuration - cannot add one later. This API version supports exactly one configuration, while the array - shape is reserved for future API versions that may support multiple configurations. Once set, - the configuration cannot be changed, removed, or reordered. Account update requests should omit - this property or send the complete existing value unchanged. Responses only include hosting - configuration types defined by the requested API version.""" - cost_control_ids: Optional[list[str]] = rest_field( - name="costControlIds", visibility=["read", "create", "update", "delete", "query"] - ) - """The full resource IDs of cost controls directly attached to this account. At the moment the - service only supports a single cost control. This will be expanded in future API versions.""" - cost_control_connections: Optional["_models.CostControlConnections"] = rest_field( - name="costControlConnections", visibility=["read", "update"] + trusted_certificate_sources: Optional[list["_models.TrustedCertificateSource"]] = rest_field( + name="trustedCertificateSources", visibility=["read", "create", "update"] ) - """The account-level connections used to publish cost control telemetry and events. Application - Insights is optional for attachment, accounting, and enforcement and can be configured later. - Event Grid must be configured before attaching a cost control with an alert threshold.""" + """Private CA trust sources for supported features in an AIServices account with + allowProjectManagement enabled. Supports one Azure Key Vault source containing version-pinned + references to secrets with PEM-encoded CA certificates or certificate bundles. On PUT or PATCH, + a non-null array replaces the complete configuration, so include all references to retain. Omit + this property or send null to preserve the existing configuration; send an empty array to clear + it.""" @overload def __init__( # pylint: disable=too-many-locals @@ -1098,14 +1052,10 @@ def __init__( # pylint: disable=too-many-locals locations: Optional["_models.MultiRegionSettings"] = None, rai_monitor_config: Optional["_models.RaiMonitorConfig"] = None, network_injections: Optional[list["_models.NetworkInjection"]] = None, - foundry_auto_upgrade: Optional["_models.FoundryAutoUpgrade"] = None, allow_project_management: Optional[bool] = None, default_project: Optional[str] = None, associated_projects: Optional[list[str]] = None, - capability_settings: Optional["_models.CapabilitySettings"] = None, - agent_hosting_configurations: Optional[list["_models.AgentHostingConfiguration"]] = None, - cost_control_ids: Optional[list[str]] = None, - cost_control_connections: Optional["_models.CostControlConnections"] = None, + trusted_certificate_sources: Optional[list["_models.TrustedCertificateSource"]] = None, ) -> None: ... @overload @@ -1182,184 +1132,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AdapterDeployment(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An independently managed LoRA adapter attached to a managed compute deployment. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of the Cognitive Services adapter deployment. - :vartype properties: ~azure.mgmt.cognitiveservices.models.AdapterDeploymentProperties - :ivar etag: The concurrency token for this adapter deployment. - :vartype etag: str - """ - - properties: Optional["_models.AdapterDeploymentProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of the Cognitive Services adapter deployment.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """The concurrency token for this adapter deployment.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.AdapterDeploymentProperties"] = 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 AdapterDeploymentLastOperation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The most recently requested adapter lifecycle operation. - - :ivar type: The type of lifecycle operation. Required. Known values are: "Create", "Update", - and "Delete". - :vartype type: str or ~azure.mgmt.cognitiveservices.models.AdapterDeploymentOperationType - :ivar status: The current or terminal operation state. Required. Known values are: "Accepted", - "Running", "Succeeded", and "Failed". - :vartype status: str or ~azure.mgmt.cognitiveservices.models.AdapterDeploymentOperationState - :ivar requested_target_deployment_name: The target deployment requested by a create or - re-target operation. - :vartype requested_target_deployment_name: str - :ivar started_at: The time at which the operation started. Required. - :vartype started_at: ~datetime.datetime - :ivar completed_at: The time at which the operation reached a terminal state. - :vartype completed_at: ~datetime.datetime - """ - - type: Union[str, "_models.AdapterDeploymentOperationType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of lifecycle operation. Required. Known values are: \"Create\", \"Update\", and - \"Delete\".""" - status: Union[str, "_models.AdapterDeploymentOperationState"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The current or terminal operation state. Required. Known values are: \"Accepted\", \"Running\", - \"Succeeded\", and \"Failed\".""" - requested_target_deployment_name: Optional[str] = rest_field( - name="requestedTargetDeploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """The target deployment requested by a create or re-target operation.""" - started_at: datetime.datetime = rest_field( - name="startedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The time at which the operation started. Required.""" - completed_at: Optional[datetime.datetime] = rest_field( - name="completedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The time at which the operation reached a terminal state.""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.AdapterDeploymentOperationType"], - status: Union[str, "_models.AdapterDeploymentOperationState"], - started_at: datetime.datetime, - requested_target_deployment_name: Optional[str] = None, - completed_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 AdapterDeploymentProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of an adapter deployment. - - :ivar source_model_id: The immutable Project Models version produced by Foundry fine-tuning. - The identifier uses the Azure AI project model URI format. Model and version segments use ASCII - letters, digits, periods, underscores, and hyphens. The service validates LoRA weight type, - protected status, provenance, compatibility metadata, and registration state. Required. - :vartype source_model_id: str - :ivar target_deployment_name: The name of the compatible managed compute parent deployment. The - service resolves this name within the adapter's owning account; full Azure Resource Manager - resource IDs and cross-account references are not accepted. It cannot equal the adapter - deployment's resource name. Updating this value re-targets the adapter while its source model - remains unchanged. Required. - :vartype target_deployment_name: str - :ivar active_target_deployment_name: The managed compute deployment currently serving the - adapter. During re-targeting this remains the prior deployment until atomic cutover. - :vartype active_target_deployment_name: str - :ivar provisioning_state: The provisioning state of the adapter deployment. Known values are: - "Accepted", "Creating", "Deleting", "Moving", "Failed", "Succeeded", "Canceled", - "ResolvingDNS", and "ExtensionUnreachable". - :vartype provisioning_state: str or ~azure.mgmt.cognitiveservices.models.ProvisioningState - :ivar last_operation: Information about the most recently requested lifecycle operation. - :vartype last_operation: ~azure.mgmt.cognitiveservices.models.AdapterDeploymentLastOperation - """ - - source_model_id: str = rest_field(name="sourceModelId", visibility=["read", "create"]) - """The immutable Project Models version produced by Foundry fine-tuning. The identifier uses the - Azure AI project model URI format. Model and version segments use ASCII letters, digits, - periods, underscores, and hyphens. The service validates LoRA weight type, protected status, - provenance, compatibility metadata, and registration state. Required.""" - target_deployment_name: str = rest_field( - name="targetDeploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the compatible managed compute parent deployment. The service resolves this name - within the adapter's owning account; full Azure Resource Manager resource IDs and cross-account - references are not accepted. It cannot equal the adapter deployment's resource name. Updating - this value re-targets the adapter while its source model remains unchanged. Required.""" - active_target_deployment_name: Optional[str] = rest_field(name="activeTargetDeploymentName", visibility=["read"]) - """The managed compute deployment currently serving the adapter. During re-targeting this remains - the prior deployment until atomic cutover.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The provisioning state of the adapter deployment. Known values are: \"Accepted\", \"Creating\", - \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", \"Canceled\", \"ResolvingDNS\", and - \"ExtensionUnreachable\".""" - last_operation: Optional["_models.AdapterDeploymentLastOperation"] = rest_field( - name="lastOperation", visibility=["read"] - ) - """Information about the most recently requested lifecycle operation.""" - - @overload - def __init__( - self, - *, - source_model_id: str, - target_deployment_name: 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 AgentApplication(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Agent Application resource. @@ -1566,46 +1338,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AgentHostingConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base configuration for hosting Foundry agents. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ManagedClusterAgentHostingConfiguration - - :ivar name: Unique name of the hosting configuration within the Foundry account. Required. - :vartype name: str - :ivar hosting_type: Type of infrastructure used to host Foundry agents. Required. - "ManagedCluster" - :vartype hosting_type: str or ~azure.mgmt.cognitiveservices.models.AgentHostingType - """ - - __mapping__: dict[str, _Model] = {} - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Unique name of the hosting configuration within the Foundry account. Required.""" - hosting_type: str = rest_discriminator( - name="hostingType", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of infrastructure used to host Foundry agents. Required. \"ManagedCluster\"""" - - @overload - def __init__( - self, - *, - name: str, - hosting_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 AgenticApplicationProperties(ResourceBase): # pylint: disable=docstring-keyword-should-match-keyword-only """Resource type representing an agentic application as a management construct. @@ -1887,11 +1619,11 @@ class ApiKeyAuthConnectionProperties( "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -1926,7 +1658,7 @@ class ApiKeyAuthConnectionProperties( :ivar credentials: Api key object for connection credential. :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionApiKey :ivar auth_type: Authentication type of the connection target. Required. API_KEY. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.API_KEY + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ credentials: Optional["_models.ConnectionApiKey"] = rest_field( @@ -2030,7 +1762,7 @@ class ApiProperties(_Model): # pylint: disable=docstring-keyword-should-match-k ) """(QnAMaker Only) The runtime endpoint of QnAMaker.""" qna_azure_search_endpoint_key: Optional[str] = rest_field( - name="qnaAzureSearchEndpointKey", visibility=["read", "create", "update", "delete", "query"] + name="qnaAzureSearchEndpointKey", visibility=["create", "update"] ) """(QnAMaker Only) The Azure Search endpoint key of QnAMaker.""" qna_azure_search_endpoint_id: Optional[str] = rest_field( @@ -2042,11 +1774,11 @@ class ApiProperties(_Model): # pylint: disable=docstring-keyword-should-match-k ) """(Bing Search Only) The flag to enable statistics of Bing Search.""" event_hub_connection_string: Optional[str] = rest_field( - name="eventHubConnectionString", visibility=["read", "create", "update", "delete", "query"] + name="eventHubConnectionString", visibility=["create", "update"] ) """(Personalization Only) The flag to enable statistics of Bing Search.""" storage_account_connection_string: Optional[str] = rest_field( - name="storageAccountConnectionString", visibility=["read", "create", "update", "delete", "query"] + name="storageAccountConnectionString", visibility=["create", "update"] ) """(Personalization Only) The storage account connection string.""" aad_client_id: Optional[str] = rest_field( @@ -2165,44 +1897,61 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeployment(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services account Arc deployment, backed by customer-managed Arc-enabled Kubernetes - resources. +class AssignedIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Type representing an identity assignment. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of the Cognitive Services Arc deployment. Required. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ArcDeploymentProperties - :ivar sku: The Arc deployment SKU. Only the SKU name is required for Arc deployments. Required. - :vartype sku: ~azure.mgmt.cognitiveservices.models.ArcDeploymentSku - :ivar etag: Resource Etag. - :vartype etag: str + :ivar kind: Specifies the kind of Entra identity described by this object. Required. Known + values are: "AgentBlueprint", "AgentInstance", "AgenticUser", "Managed", and "None". + :vartype kind: str or ~azure.mgmt.cognitiveservices.models.IdentityKind + :ivar type: Enumeration of identity types, from the perspective of management. Required. Known + values are: "System", "User", and "None". + :vartype type: str or ~azure.mgmt.cognitiveservices.models.IdentityManagementType + :ivar client_id: The client ID of the identity. Required. + :vartype client_id: str + :ivar principal_id: The principal ID of the identity. Required. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the identity. Required. + :vartype tenant_id: str + :ivar subject: The subject of this identity assignment. + :vartype subject: str + :ivar provisioning_state: Represents the provisioning state of an identity resource. Known + values are: "Creating", "Updating", "Succeeded", "Failed", "Canceled", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.IdentityProvisioningState """ - properties: "_models.ArcDeploymentProperties" = rest_field( + kind: Union[str, "_models.IdentityKind"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specifies the kind of Entra identity described by this object. Required. Known values are: + \"AgentBlueprint\", \"AgentInstance\", \"AgenticUser\", \"Managed\", and \"None\".""" + type: Union[str, "_models.IdentityManagementType"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Properties of the Cognitive Services Arc deployment. Required.""" - sku: "_models.ArcDeploymentSku" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Arc deployment SKU. Only the SKU name is required for Arc deployments. Required.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource Etag.""" + """Enumeration of identity types, from the perspective of management. Required. Known values are: + \"System\", \"User\", and \"None\".""" + client_id: str = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) + """The client ID of the identity. Required.""" + principal_id: str = rest_field(name="principalId", visibility=["read", "create", "update", "delete", "query"]) + """The principal ID of the identity. Required.""" + tenant_id: str = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """The tenant ID of the identity. Required.""" + subject: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The subject of this identity assignment.""" + provisioning_state: Optional[Union[str, "_models.IdentityProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Represents the provisioning state of an identity resource. Known values are: \"Creating\", + \"Updating\", \"Succeeded\", \"Failed\", \"Canceled\", and \"Deleting\".""" @overload def __init__( self, *, - properties: "_models.ArcDeploymentProperties", - sku: "_models.ArcDeploymentSku", + kind: Union[str, "_models.IdentityKind"], + type: Union[str, "_models.IdentityManagementType"], + client_id: str, + principal_id: str, + tenant_id: str, + subject: Optional[str] = None, ) -> None: ... @overload @@ -2216,28 +1965,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentCpuMemoryResourceRequirements( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """CPU and memory resource requirements for an Arc deployment replica. +class BillingMeterInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """BillingMeterInfo. - :ivar cpu: Kubernetes CPU quantity string, for example 500m, 2, 4, or 8. Required. - :vartype cpu: str - :ivar memory: Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi. Required. - :vartype memory: str + :ivar name: + :vartype name: str + :ivar meter_id: + :vartype meter_id: str + :ivar unit: + :vartype unit: str """ - cpu: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Kubernetes CPU quantity string, for example 500m, 2, 4, or 8. Required.""" - memory: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi. Required.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + meter_id: Optional[str] = rest_field(name="meterId", visibility=["read", "create", "update", "delete", "query"]) + unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - cpu: str, - memory: str, + name: Optional[str] = None, + meter_id: Optional[str] = None, + unit: Optional[str] = None, ) -> None: ... @overload @@ -2251,31 +2000,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentKubernetesResources(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-replica Kubernetes resource requests and limits for an Arc deployment. +class CalculateModelCapacityParameter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Calculate Model Capacity parameter. - :ivar requests: Kubernetes CPU and memory resource requests for each deployment replica. - :vartype requests: - ~azure.mgmt.cognitiveservices.models.ArcDeploymentCpuMemoryResourceRequirements - :ivar limits: Kubernetes resource limits for each deployment replica. - :vartype limits: ~azure.mgmt.cognitiveservices.models.ArcDeploymentResourceRequirements + :ivar model: Properties of Cognitive Services account deployment model. + :vartype model: ~azure.mgmt.cognitiveservices.models.DeploymentModel + :ivar sku_name: The name of SKU. + :vartype sku_name: str + :ivar workloads: List of Model Capacity Calculator Workload. + :vartype workloads: list[~azure.mgmt.cognitiveservices.models.ModelCapacityCalculatorWorkload] """ - requests: Optional["_models.ArcDeploymentCpuMemoryResourceRequirements"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Kubernetes CPU and memory resource requests for each deployment replica.""" - limits: Optional["_models.ArcDeploymentResourceRequirements"] = rest_field( + model: Optional["_models.DeploymentModel"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Properties of Cognitive Services account deployment model.""" + sku_name: Optional[str] = rest_field(name="skuName", visibility=["read", "create", "update", "delete", "query"]) + """The name of SKU.""" + workloads: Optional[list["_models.ModelCapacityCalculatorWorkload"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Kubernetes resource limits for each deployment replica.""" + """List of Model Capacity Calculator Workload.""" @overload def __init__( self, *, - requests: Optional["_models.ArcDeploymentCpuMemoryResourceRequirements"] = None, - limits: Optional["_models.ArcDeploymentResourceRequirements"] = None, + model: Optional["_models.DeploymentModel"] = None, + sku_name: Optional[str] = None, + workloads: Optional[list["_models.ModelCapacityCalculatorWorkload"]] = None, ) -> None: ... @overload @@ -2289,26 +2040,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentModel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Model reference for an Arc deployment. +class CalculateModelCapacityResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Calculate Model Capacity result. - :ivar format: Deployment model format. Required. - :vartype format: str - :ivar name: Deployment model name. Required. - :vartype name: str + :ivar model: Properties of Cognitive Services account deployment model. + :vartype model: ~azure.mgmt.cognitiveservices.models.DeploymentModel + :ivar sku_name: + :vartype sku_name: str + :ivar estimated_capacity: Model Estimated Capacity. + :vartype estimated_capacity: + ~azure.mgmt.cognitiveservices.models.CalculateModelCapacityResultEstimatedCapacity """ - format: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deployment model format. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deployment model name. Required.""" + model: Optional["_models.DeploymentModel"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Properties of Cognitive Services account deployment model.""" + sku_name: Optional[str] = rest_field(name="skuName", visibility=["read", "create", "update", "delete", "query"]) + estimated_capacity: Optional["_models.CalculateModelCapacityResultEstimatedCapacity"] = rest_field( + name="estimatedCapacity", visibility=["read", "create", "update", "delete", "query"] + ) + """Model Estimated Capacity.""" @overload def __init__( self, *, - format: str, - name: str, + model: Optional["_models.DeploymentModel"] = None, + sku_name: Optional[str] = None, + estimated_capacity: Optional["_models.CalculateModelCapacityResultEstimatedCapacity"] = None, ) -> None: ... @overload @@ -2322,28 +2080,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentPatchCpuMemoryResourceRequirements( +class CalculateModelCapacityResultEstimatedCapacity( _Model ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """CPU and memory resource requirements for an Arc deployment replica update. + """Model Estimated Capacity. - :ivar cpu: Kubernetes CPU quantity string, for example 500m, 2, 4, or 8. - :vartype cpu: str - :ivar memory: Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi. - :vartype memory: str + :ivar value: + :vartype value: int + :ivar deployable_value: + :vartype deployable_value: int """ - cpu: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Kubernetes CPU quantity string, for example 500m, 2, 4, or 8.""" - memory: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi.""" + value: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + deployable_value: Optional[int] = rest_field( + name="deployableValue", visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - cpu: Optional[str] = None, - memory: Optional[str] = None, + value: Optional[int] = None, + deployable_value: Optional[int] = None, ) -> None: ... @overload @@ -2357,31 +2115,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentPatchKubernetesResources(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Per-replica Kubernetes resource requests and limits for an Arc deployment update. - - :ivar requests: Kubernetes CPU and memory resource requests for each deployment replica. - :vartype requests: - ~azure.mgmt.cognitiveservices.models.ArcDeploymentPatchCpuMemoryResourceRequirements - :ivar limits: Kubernetes resource limits for each deployment replica. - :vartype limits: ~azure.mgmt.cognitiveservices.models.ArcDeploymentResourceRequirements +class CallRateLimit(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The call rate limit Cognitive Services account. + + :ivar count: The count value of Call Rate Limit. + :vartype count: float + :ivar renewal_period: The renewal period in seconds of Call Rate Limit. + :vartype renewal_period: float + :ivar rules: + :vartype rules: list[~azure.mgmt.cognitiveservices.models.ThrottlingRule] """ - requests: Optional["_models.ArcDeploymentPatchCpuMemoryResourceRequirements"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + count: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The count value of Call Rate Limit.""" + renewal_period: Optional[float] = rest_field( + name="renewalPeriod", visibility=["read", "create", "update", "delete", "query"] ) - """Kubernetes CPU and memory resource requests for each deployment replica.""" - limits: Optional["_models.ArcDeploymentResourceRequirements"] = rest_field( + """The renewal period in seconds of Call Rate Limit.""" + rules: Optional[list["_models.ThrottlingRule"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Kubernetes resource limits for each deployment replica.""" @overload def __init__( self, *, - requests: Optional["_models.ArcDeploymentPatchCpuMemoryResourceRequirements"] = None, - limits: Optional["_models.ArcDeploymentResourceRequirements"] = None, + count: Optional[float] = None, + renewal_period: Optional[float] = None, + rules: Optional[list["_models.ThrottlingRule"]] = None, ) -> None: ... @overload @@ -2395,121 +2156,128 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a Cognitive Services Arc deployment. +class CapabilityHost(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure Resource Manager resource envelope. - :ivar model: Model reference. Required on creation and immutable after creation. Required. - :vartype model: ~azure.mgmt.cognitiveservices.models.ArcDeploymentModel - :ivar extension_id: Full Azure resource ID of the Foundry inference extension on the target - Arc-enabled Kubernetes cluster. Required on creation and immutable after creation. Required. - :vartype extension_id: str - :ivar runtime: Inference runtime. Required on creation and immutable after creation. Required. - Known values are: "vllm" and "onnx-genai". - :vartype runtime: str or ~azure.mgmt.cognitiveservices.models.ArcDeploymentRuntime - :ivar compute: Compute type for the deployment. Required on creation and immutable after - creation. Required. Known values are: "gpu" and "cpu". - :vartype compute: str or ~azure.mgmt.cognitiveservices.models.ArcDeploymentComputeType - :ivar deployment_template: Optional deployment template identifier for advanced vLLM tuning. - Allowed only when runtime is vllm. Example: - azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}. - :vartype deployment_template: str - :ivar vllm_parameters: Read-only. Effective vLLM runtime parameters resolved for the deployed - model. Returned only when runtime is vllm. - :vartype vllm_parameters: ~azure.mgmt.cognitiveservices.models.ArcDeploymentVllmParameters - :ivar replicas: Physical replica count on the Arc cluster. Required. - :vartype replicas: int - :ivar resources: Per-replica Kubernetes resource requests and limits. Required. - :vartype resources: ~azure.mgmt.cognitiveservices.models.ArcDeploymentKubernetesResources - :ivar node_selector: Kubernetes node selector key-value map used to schedule pods onto nodes - with matching labels. - :vartype node_selector: dict[str, str] - :ivar deployment_state: The deployment state. Known values are: "Running" and "Paused". - :vartype deployment_state: str or ~azure.mgmt.cognitiveservices.models.DeploymentState - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar provisioning_state: Read-only. Current provisioning state. Known values are: "Accepted", - "Creating", "Deleting", "Moving", "Failed", "Succeeded", "Canceled", "ResolvingDNS", and - "ExtensionUnreachable". - :vartype provisioning_state: str or ~azure.mgmt.cognitiveservices.models.ProvisioningState - :ivar provisioning_details: Read-only. Status message and timestamp from the last provisioning - operation. - :vartype provisioning_details: - ~azure.mgmt.cognitiveservices.models.ArcDeploymentProvisioningDetails - :ivar inference_endpoint: Read-only. Base URL for inference calls to this deployment on the Arc - cluster. Populated when provisioningState is Succeeded. - :vartype inference_endpoint: str - :ivar capabilities: Read-only. Deployment capabilities represented as key-value pairs. - :vartype capabilities: dict[str, str] + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: [Required] Additional attributes of the entity. Required. + :vartype properties: ~azure.mgmt.cognitiveservices.models.CapabilityHostProperties """ - model: "_models.ArcDeploymentModel" = rest_field(visibility=["read", "create"]) - """Model reference. Required on creation and immutable after creation. Required.""" - extension_id: str = rest_field(name="extensionId", visibility=["read", "create"]) - """Full Azure resource ID of the Foundry inference extension on the target Arc-enabled Kubernetes - cluster. Required on creation and immutable after creation. Required.""" - runtime: Union[str, "_models.ArcDeploymentRuntime"] = rest_field(visibility=["read", "create"]) - """Inference runtime. Required on creation and immutable after creation. Required. Known values - are: \"vllm\" and \"onnx-genai\".""" - compute: Union[str, "_models.ArcDeploymentComputeType"] = rest_field(visibility=["read", "create"]) - """Compute type for the deployment. Required on creation and immutable after creation. Required. - Known values are: \"gpu\" and \"cpu\".""" - deployment_template: Optional[str] = rest_field(name="deploymentTemplate", visibility=["read", "create"]) - """Optional deployment template identifier for advanced vLLM tuning. Allowed only when runtime is - vllm. Example: - azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}.""" - vllm_parameters: Optional["_models.ArcDeploymentVllmParameters"] = rest_field( - name="vllmParameters", visibility=["read"] - ) - """Read-only. Effective vLLM runtime parameters resolved for the deployed model. Returned only - when runtime is vllm.""" - replicas: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Physical replica count on the Arc cluster. Required.""" - resources: "_models.ArcDeploymentKubernetesResources" = rest_field( + properties: "_models.CapabilityHostProperties" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Per-replica Kubernetes resource requests and limits. Required.""" - node_selector: Optional[dict[str, str]] = rest_field( - name="nodeSelector", visibility=["read", "create", "update", "delete", "query"] + """[Required] Additional attributes of the entity. Required.""" + + @overload + def __init__( + self, + *, + properties: "_models.CapabilityHostProperties", + ) -> 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 CapabilityHostProperties(ResourceBase): # pylint: disable=docstring-keyword-should-match-keyword-only + """CapabilityHostProperties. + + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar ai_services_connections: List of AI services connections. + :vartype ai_services_connections: list[str] + :ivar capability_host_kind: Kind of this capability host. "Agents" + :vartype capability_host_kind: str or ~azure.mgmt.cognitiveservices.models.CapabilityHostKind + :ivar customer_subnet: Customer subnet info to help set up this capability host. + :vartype customer_subnet: str + :ivar provisioning_state: Provisioning state for the CapabilityHost. Known values are: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.CapabilityHostProvisioningState + :ivar storage_connections: List of connection names from those available in the account or + project to be used as a storage resource. + :vartype storage_connections: list[str] + :ivar thread_storage_connections: List of connection names from those available in the account + or project to be used for Thread storage. + :vartype thread_storage_connections: list[str] + :ivar vector_store_connections: List of connection names from those available in the account or + project to be used for vector database (e.g. CosmosDB). + :vartype vector_store_connections: list[str] + :ivar enable_public_hosting_environment: Whether public hosting environment is enabled for the + capability host. + :vartype enable_public_hosting_environment: bool + """ + + ai_services_connections: Optional[list[str]] = rest_field( + name="aiServicesConnections", visibility=["read", "create", "update", "delete", "query"] ) - """Kubernetes node selector key-value map used to schedule pods onto nodes with matching labels.""" - deployment_state: Optional[Union[str, "_models.DeploymentState"]] = rest_field( - name="deploymentState", visibility=["read", "create", "update", "delete", "query"] + """List of AI services connections.""" + capability_host_kind: Optional[Union[str, "_models.CapabilityHostKind"]] = rest_field( + name="capabilityHostKind", visibility=["read", "create", "update", "delete", "query"] ) - """The deployment state. Known values are: \"Running\" and \"Paused\".""" - rai_policy_name: Optional[str] = rest_field( - name="raiPolicyName", visibility=["read", "create", "update", "delete", "query"] + """Kind of this capability host. \"Agents\"""" + customer_subnet: Optional[str] = rest_field( + name="customerSubnet", visibility=["read", "create", "update", "delete", "query"] ) - """The name of RAI policy.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + """Customer subnet info to help set up this capability host.""" + provisioning_state: Optional[Union[str, "_models.CapabilityHostProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) - """Read-only. Current provisioning state. Known values are: \"Accepted\", \"Creating\", - \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", \"Canceled\", \"ResolvingDNS\", and - \"ExtensionUnreachable\".""" - provisioning_details: Optional["_models.ArcDeploymentProvisioningDetails"] = rest_field( - name="provisioningDetails", visibility=["read"] + """Provisioning state for the CapabilityHost. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" + storage_connections: Optional[list[str]] = rest_field( + name="storageConnections", visibility=["read", "create", "update", "delete", "query"] ) - """Read-only. Status message and timestamp from the last provisioning operation.""" - inference_endpoint: Optional[str] = rest_field(name="inferenceEndpoint", visibility=["read"]) - """Read-only. Base URL for inference calls to this deployment on the Arc cluster. Populated when - provisioningState is Succeeded.""" - capabilities: Optional[dict[str, str]] = rest_field(visibility=["read"]) - """Read-only. Deployment capabilities represented as key-value pairs.""" + """List of connection names from those available in the account or project to be used as a storage + resource.""" + thread_storage_connections: Optional[list[str]] = rest_field( + name="threadStorageConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """List of connection names from those available in the account or project to be used for Thread + storage.""" + vector_store_connections: Optional[list[str]] = rest_field( + name="vectorStoreConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """List of connection names from those available in the account or project to be used for vector + database (e.g. CosmosDB).""" + enable_public_hosting_environment: Optional[bool] = rest_field( + name="enablePublicHostingEnvironment", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether public hosting environment is enabled for the capability host.""" @overload def __init__( self, *, - model: "_models.ArcDeploymentModel", - extension_id: str, - runtime: Union[str, "_models.ArcDeploymentRuntime"], - compute: Union[str, "_models.ArcDeploymentComputeType"], - replicas: int, - resources: "_models.ArcDeploymentKubernetesResources", - deployment_template: Optional[str] = None, - node_selector: Optional[dict[str, str]] = None, - deployment_state: Optional[Union[str, "_models.DeploymentState"]] = None, - rai_policy_name: Optional[str] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + ai_services_connections: Optional[list[str]] = None, + capability_host_kind: Optional[Union[str, "_models.CapabilityHostKind"]] = None, + customer_subnet: Optional[str] = None, + storage_connections: Optional[list[str]] = None, + thread_storage_connections: Optional[list[str]] = None, + vector_store_connections: Optional[list[str]] = None, + enable_public_hosting_environment: Optional[bool] = None, ) -> None: ... @overload @@ -2523,28 +2291,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentProvisioningDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Provisioning status details for an Arc deployment. +class CapacityConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The capacity configuration. - :ivar message: A human-readable status message from the last provisioning operation. - :vartype message: str - :ivar last_operation_timestamp: Timestamp of the last provisioning operation. - :vartype last_operation_timestamp: ~datetime.datetime + :ivar minimum: The minimum capacity. + :vartype minimum: int + :ivar maximum: The maximum capacity. + :vartype maximum: int + :ivar step: The minimal incremental between allowed values for capacity. + :vartype step: int + :ivar default: The default capacity. + :vartype default: int + :ivar allowed_values: The array of allowed values for capacity. + :vartype allowed_values: list[int] """ - message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable status message from the last provisioning operation.""" - last_operation_timestamp: Optional[datetime.datetime] = rest_field( - name="lastOperationTimestamp", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + minimum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The minimum capacity.""" + maximum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The maximum capacity.""" + step: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The minimal incremental between allowed values for capacity.""" + default: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The default capacity.""" + allowed_values: Optional[list[int]] = rest_field( + name="allowedValues", visibility=["read", "create", "update", "delete", "query"] ) - """Timestamp of the last provisioning operation.""" + """The array of allowed values for capacity.""" @overload def __init__( self, *, - message: Optional[str] = None, - last_operation_timestamp: Optional[datetime.datetime] = None, + minimum: Optional[int] = None, + maximum: Optional[int] = None, + step: Optional[int] = None, + default: Optional[int] = None, + allowed_values: Optional[list[int]] = None, ) -> None: ... @overload @@ -2558,38 +2341,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentResourceRequirements(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Kubernetes resource requirements for an Arc deployment replica. Specify either cpu and memory - together, or gpu. GPU is supported only in limits, not requests. +class CertificateBundleReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A reference to a specific version of a Key Vault secret containing a PEM-encoded CA certificate + or certificate bundle. - :ivar cpu: Kubernetes CPU quantity string, for example 500m, 2, 4, or 8. Required with memory - when specifying CPU and memory limits. Do not specify with gpu. - :vartype cpu: str - :ivar memory: Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi. Required with - cpu when specifying CPU and memory limits. Do not specify with gpu. - :vartype memory: str - :ivar gpu: Kubernetes GPU quantity, for example 1, 2, or 5. Required when specifying GPU - limits. Do not specify with cpu or memory. - :vartype gpu: int + :ivar secret_name: Name of the Key Vault secret containing the CA certificate or certificate + bundle. Required. + :vartype secret_name: str + :ivar secret_version: Required, pinned version of the Key Vault secret. Newer secret versions + are not followed automatically. To rotate a bundle, update this value and resubmit the complete + account trust configuration. Required. + :vartype secret_version: str """ - cpu: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Kubernetes CPU quantity string, for example 500m, 2, 4, or 8. Required with memory when - specifying CPU and memory limits. Do not specify with gpu.""" - memory: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi. Required with cpu when - specifying CPU and memory limits. Do not specify with gpu.""" - gpu: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Kubernetes GPU quantity, for example 1, 2, or 5. Required when specifying GPU limits. Do not - specify with cpu or memory.""" + secret_name: str = rest_field(name="secretName", visibility=["read", "create", "update", "delete", "query"]) + """Name of the Key Vault secret containing the CA certificate or certificate bundle. Required.""" + secret_version: str = rest_field(name="secretVersion", visibility=["read", "create", "update", "delete", "query"]) + """Required, pinned version of the Key Vault secret. Newer secret versions are not followed + automatically. To rotate a bundle, update this value and resubmit the complete account trust + configuration. Required.""" @overload def __init__( self, *, - cpu: Optional[str] = None, - memory: Optional[str] = None, - gpu: Optional[int] = None, + secret_name: str, + secret_version: str, ) -> None: ... @overload @@ -2603,23 +2380,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """SKU for an Arc deployment. +class ChannelsBuiltInAuthorizationPolicy(ApplicationAuthorizationPolicy, discriminator="Channels"): + """Represents a built-in authorization policy specific to Azure Bot Service/Channels + authentication. - :ivar name: The name of the Arc deployment SKU. Must be Arc. Required. "Arc" - :vartype name: str or ~azure.mgmt.cognitiveservices.models.ArcDeploymentSkuName + :ivar type: Authorization scheme type. Required. Channels-specific (AzureBotService) + authorization. + :vartype type: str or ~azure.mgmt.cognitiveservices.models.BuiltInAuthorizationScheme """ - name: Union[str, "_models.ArcDeploymentSkuName"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the Arc deployment SKU. Must be Arc. Required. \"Arc\"""" + type: Literal[BuiltInAuthorizationScheme.CHANNELS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Authorization scheme type. Required. Channels-specific (AzureBotService) authorization.""" @overload def __init__( self, - *, - name: Union[str, "_models.ArcDeploymentSkuName"], ) -> None: ... @overload @@ -2631,25 +2406,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = BuiltInAuthorizationScheme.CHANNELS # type: ignore -class ArcDeploymentUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The object used to update an Arc deployment. +class CheckDomainAvailabilityParameter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Check Domain availability parameter. - :ivar properties: Properties that can be updated on an Arc deployment. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ArcDeploymentUpdateProperties + :ivar subdomain_name: The subdomain name to use. Required. + :vartype subdomain_name: str + :ivar type: The Type of the resource. Required. + :vartype type: str + :ivar kind: The kind (type) of cognitive service account. + :vartype kind: str """ - properties: Optional["_models.ArcDeploymentUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties that can be updated on an Arc deployment.""" + subdomain_name: str = rest_field(name="subdomainName", visibility=["read", "create", "update", "delete", "query"]) + """The subdomain name to use. Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Type of the resource. Required.""" + kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kind (type) of cognitive service account.""" @overload def __init__( self, *, - properties: Optional["_models.ArcDeploymentUpdateProperties"] = None, + subdomain_name: str, + type: str, + kind: Optional[str] = None, ) -> None: ... @overload @@ -2663,36 +2447,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Mutable properties for an Arc deployment. +class CheckSkuAvailabilityParameter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Check SKU availability parameter. - :ivar replicas: Physical replica count on the Arc cluster. - :vartype replicas: int - :ivar resources: Per-replica Kubernetes resource requests and limits. - :vartype resources: ~azure.mgmt.cognitiveservices.models.ArcDeploymentPatchKubernetesResources - :ivar node_selector: Kubernetes node selector key-value map used to schedule pods onto nodes - with matching labels. - :vartype node_selector: dict[str, str] + :ivar skus: The SKU of the resource. Required. + :vartype skus: list[str] + :ivar kind: The kind (type) of cognitive service account. Required. + :vartype kind: str + :ivar type: The Type of the resource. Required. + :vartype type: str """ - replicas: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Physical replica count on the Arc cluster.""" - resources: Optional["_models.ArcDeploymentPatchKubernetesResources"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Per-replica Kubernetes resource requests and limits.""" - node_selector: Optional[dict[str, str]] = rest_field( - name="nodeSelector", visibility=["read", "create", "update", "delete", "query"] - ) - """Kubernetes node selector key-value map used to schedule pods onto nodes with matching labels.""" + skus: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SKU of the resource. Required.""" + kind: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kind (type) of cognitive service account. Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Type of the resource. Required.""" @overload def __init__( self, *, - replicas: Optional[int] = None, - resources: Optional["_models.ArcDeploymentPatchKubernetesResources"] = None, - node_selector: Optional[dict[str, str]] = None, + skus: list[str], + kind: str, + type: str, ) -> None: ... @overload @@ -2706,44 +2485,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ArcDeploymentVllmParameters(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Effective vLLM runtime parameters for an Arc deployment. +class CommitmentCost(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services account commitment cost. - :ivar tensor_parallel_size: Number of GPUs used for tensor parallelism. - :vartype tensor_parallel_size: int - :ivar max_model_len: Maximum model context length. - :vartype max_model_len: int - :ivar gpu_memory_utilization: Fraction of GPU memory reserved for model execution. - :vartype gpu_memory_utilization: float - :ivar enforce_eager: Whether eager execution is enforced for the vLLM runtime. - :vartype enforce_eager: bool + :ivar commitment_meter_id: Commitment meter Id. + :vartype commitment_meter_id: str + :ivar overage_meter_id: Overage meter Id. + :vartype overage_meter_id: str """ - tensor_parallel_size: Optional[int] = rest_field( - name="tensorParallelSize", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of GPUs used for tensor parallelism.""" - max_model_len: Optional[int] = rest_field( - name="maxModelLen", visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum model context length.""" - gpu_memory_utilization: Optional[float] = rest_field( - name="gpuMemoryUtilization", visibility=["read", "create", "update", "delete", "query"] + commitment_meter_id: Optional[str] = rest_field( + name="commitmentMeterId", visibility=["read", "create", "update", "delete", "query"] ) - """Fraction of GPU memory reserved for model execution.""" - enforce_eager: Optional[bool] = rest_field( - name="enforceEager", visibility=["read", "create", "update", "delete", "query"] + """Commitment meter Id.""" + overage_meter_id: Optional[str] = rest_field( + name="overageMeterId", visibility=["read", "create", "update", "delete", "query"] ) - """Whether eager execution is enforced for the vLLM runtime.""" + """Overage meter Id.""" @overload def __init__( self, *, - tensor_parallel_size: Optional[int] = None, - max_model_len: Optional[int] = None, - gpu_memory_utilization: Optional[float] = None, - enforce_eager: Optional[bool] = None, + commitment_meter_id: Optional[str] = None, + overage_meter_id: Optional[str] = None, ) -> None: ... @overload @@ -2757,61 +2522,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssignedIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Type representing an identity assignment. +class CommitmentPeriod(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services account commitment period. - :ivar kind: Specifies the kind of Entra identity described by this object. Required. Known - values are: "AgentBlueprint", "AgentInstance", "AgenticUser", "Managed", and "None". - :vartype kind: str or ~azure.mgmt.cognitiveservices.models.IdentityKind - :ivar type: Enumeration of identity types, from the perspective of management. Required. Known - values are: "System", "User", and "None". - :vartype type: str or ~azure.mgmt.cognitiveservices.models.IdentityManagementType - :ivar client_id: The client ID of the identity. Required. - :vartype client_id: str - :ivar principal_id: The principal ID of the identity. Required. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the identity. Required. - :vartype tenant_id: str - :ivar subject: The subject of this identity assignment. - :vartype subject: str - :ivar provisioning_state: Represents the provisioning state of an identity resource. Known - values are: "Creating", "Updating", "Succeeded", "Failed", "Canceled", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.IdentityProvisioningState + :ivar tier: Commitment period commitment tier. + :vartype tier: str + :ivar count: Commitment period commitment count. + :vartype count: int + :ivar quota: Cognitive Services account commitment quota. + :vartype quota: ~azure.mgmt.cognitiveservices.models.CommitmentQuota + :ivar start_date: Commitment period start date. + :vartype start_date: str + :ivar end_date: Commitment period end date. + :vartype end_date: str """ - kind: Union[str, "_models.IdentityKind"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Specifies the kind of Entra identity described by this object. Required. Known values are: - \"AgentBlueprint\", \"AgentInstance\", \"AgenticUser\", \"Managed\", and \"None\".""" - type: Union[str, "_models.IdentityManagementType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Enumeration of identity types, from the perspective of management. Required. Known values are: - \"System\", \"User\", and \"None\".""" - client_id: str = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) - """The client ID of the identity. Required.""" - principal_id: str = rest_field(name="principalId", visibility=["read", "create", "update", "delete", "query"]) - """The principal ID of the identity. Required.""" - tenant_id: str = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - """The tenant ID of the identity. Required.""" - subject: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The subject of this identity assignment.""" - provisioning_state: Optional[Union[str, "_models.IdentityProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Represents the provisioning state of an identity resource. Known values are: \"Creating\", - \"Updating\", \"Succeeded\", \"Failed\", \"Canceled\", and \"Deleting\".""" + tier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Commitment period commitment tier.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Commitment period commitment count.""" + quota: Optional["_models.CommitmentQuota"] = rest_field(visibility=["read"]) + """Cognitive Services account commitment quota.""" + start_date: Optional[str] = rest_field(name="startDate", visibility=["read"]) + """Commitment period start date.""" + end_date: Optional[str] = rest_field(name="endDate", visibility=["read"]) + """Commitment period end date.""" @overload def __init__( self, *, - kind: Union[str, "_models.IdentityKind"], - type: Union[str, "_models.IdentityManagementType"], - client_id: str, - principal_id: str, - tenant_id: str, - subject: Optional[str] = None, + tier: Optional[str] = None, + count: Optional[int] = None, ) -> None: ... @overload @@ -2825,28 +2567,58 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BillingMeterInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """BillingMeterInfo. +class CommitmentPlan(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services account commitment plan. - :ivar name: + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. :vartype name: str - :ivar meter_id: - :vartype meter_id: str - :ivar unit: - :vartype unit: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: Properties of Cognitive Services account commitment plan. + :vartype properties: ~azure.mgmt.cognitiveservices.models.CommitmentPlanProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. + :vartype location: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar kind: The kind (type) of cognitive service account. + :vartype kind: str + :ivar sku: The resource model definition representing SKU. + :vartype sku: ~azure.mgmt.cognitiveservices.models.Sku """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - meter_id: Optional[str] = rest_field(name="meterId", visibility=["read", "create", "update", "delete", "query"]) - unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + properties: Optional["_models.CommitmentPlanProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of Cognitive Services account commitment plan.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) + """Resource tags.""" + location: Optional[str] = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """Resource Etag.""" + kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kind (type) of cognitive service account.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource model definition representing SKU.""" @overload def __init__( self, *, - name: Optional[str] = None, - meter_id: Optional[str] = None, - unit: Optional[str] = None, + properties: Optional["_models.CommitmentPlanProperties"] = None, + tags: Optional[dict[str, str]] = None, + location: Optional[str] = None, + kind: Optional[str] = None, + sku: Optional["_models.Sku"] = None, ) -> None: ... @overload @@ -2860,33 +2632,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CalculateModelCapacityParameter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Calculate Model Capacity parameter. +class CommitmentPlanAccountAssociation(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The commitment plan association. - :ivar model: Properties of Cognitive Services account deployment model. - :vartype model: ~azure.mgmt.cognitiveservices.models.DeploymentModel - :ivar sku_name: The name of SKU. - :vartype sku_name: str - :ivar workloads: List of Model Capacity Calculator Workload. - :vartype workloads: list[~azure.mgmt.cognitiveservices.models.ModelCapacityCalculatorWorkload] + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: Properties of Cognitive Services account commitment plan association. + :vartype properties: + ~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociationProperties + :ivar etag: Resource Etag. + :vartype etag: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] """ - model: Optional["_models.DeploymentModel"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Properties of Cognitive Services account deployment model.""" - sku_name: Optional[str] = rest_field(name="skuName", visibility=["read", "create", "update", "delete", "query"]) - """The name of SKU.""" - workloads: Optional[list["_models.ModelCapacityCalculatorWorkload"]] = rest_field( + properties: Optional["_models.CommitmentPlanAccountAssociationProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """List of Model Capacity Calculator Workload.""" + """Properties of Cognitive Services account commitment plan association.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """Resource Etag.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) + """Resource tags.""" + + __flattened_items = ["account_id"] @overload def __init__( self, *, - model: Optional["_models.DeploymentModel"] = None, - sku_name: Optional[str] = None, - workloads: Optional[list["_models.ModelCapacityCalculatorWorkload"]] = None, + properties: Optional["_models.CommitmentPlanAccountAssociationProperties"] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -2897,36 +2682,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) -class CalculateModelCapacityResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Calculate Model Capacity result. - :ivar model: Properties of Cognitive Services account deployment model. - :vartype model: ~azure.mgmt.cognitiveservices.models.DeploymentModel - :ivar sku_name: - :vartype sku_name: str - :ivar estimated_capacity: Model Estimated Capacity. - :vartype estimated_capacity: - ~azure.mgmt.cognitiveservices.models.CalculateModelCapacityResultEstimatedCapacity +class CommitmentPlanAccountAssociationProperties( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The commitment plan account association properties. + + :ivar account_id: The Azure resource id of the account. + :vartype account_id: str """ - model: Optional["_models.DeploymentModel"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Properties of Cognitive Services account deployment model.""" - sku_name: Optional[str] = rest_field(name="skuName", visibility=["read", "create", "update", "delete", "query"]) - estimated_capacity: Optional["_models.CalculateModelCapacityResultEstimatedCapacity"] = rest_field( - name="estimatedCapacity", visibility=["read", "create", "update", "delete", "query"] - ) - """Model Estimated Capacity.""" + account_id: Optional[str] = rest_field(name="accountId", visibility=["read", "create", "update", "delete", "query"]) + """The Azure resource id of the account.""" @overload def __init__( self, *, - model: Optional["_models.DeploymentModel"] = None, - sku_name: Optional[str] = None, - estimated_capacity: Optional["_models.CalculateModelCapacityResultEstimatedCapacity"] = None, + account_id: Optional[str] = None, ) -> None: ... @overload @@ -2940,28 +2733,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CalculateModelCapacityResultEstimatedCapacity( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Model Estimated Capacity. +class CommitmentPlanAssociation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The commitment plan association. - :ivar value: - :vartype value: int - :ivar deployable_value: - :vartype deployable_value: int + :ivar commitment_plan_id: The Azure resource id of the commitment plan. + :vartype commitment_plan_id: str + :ivar commitment_plan_location: The location of of the commitment plan. + :vartype commitment_plan_location: str """ - value: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - deployable_value: Optional[int] = rest_field( - name="deployableValue", visibility=["read", "create", "update", "delete", "query"] + commitment_plan_id: Optional[str] = rest_field( + name="commitmentPlanId", visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure resource id of the commitment plan.""" + commitment_plan_location: Optional[str] = rest_field( + name="commitmentPlanLocation", visibility=["read", "create", "update", "delete", "query"] ) + """The location of of the commitment plan.""" @overload def __init__( self, *, - value: Optional[int] = None, - deployable_value: Optional[int] = None, + commitment_plan_id: Optional[str] = None, + commitment_plan_location: Optional[str] = None, ) -> None: ... @overload @@ -2975,34 +2770,75 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CallRateLimit(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The call rate limit Cognitive Services account. - - :ivar count: The count value of Call Rate Limit. - :vartype count: float - :ivar renewal_period: The renewal period in seconds of Call Rate Limit. - :vartype renewal_period: float - :ivar rules: - :vartype rules: list[~azure.mgmt.cognitiveservices.models.ThrottlingRule] - """ - - count: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The count value of Call Rate Limit.""" - renewal_period: Optional[float] = rest_field( - name="renewalPeriod", visibility=["read", "create", "update", "delete", "query"] - ) - """The renewal period in seconds of Call Rate Limit.""" - rules: Optional[list["_models.ThrottlingRule"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) +class CommitmentPlanProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of Cognitive Services account commitment plan. - @overload - def __init__( - self, - *, - count: Optional[float] = None, - renewal_period: Optional[float] = None, - rules: Optional[list["_models.ThrottlingRule"]] = None, + :ivar provisioning_state: Gets the status of the resource at the time the operation was called. + Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", "Succeeded", and + "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.CommitmentPlanProvisioningState + :ivar commitment_plan_guid: Commitment plan guid. + :vartype commitment_plan_guid: str + :ivar hosting_model: Account hosting model. Known values are: "Web", "ConnectedContainer", + "DisconnectedContainer", and "ProvisionedWeb". + :vartype hosting_model: str or ~azure.mgmt.cognitiveservices.models.HostingModel + :ivar plan_type: Commitment plan type. + :vartype plan_type: str + :ivar current: Cognitive Services account commitment period. + :vartype current: ~azure.mgmt.cognitiveservices.models.CommitmentPeriod + :ivar auto_renew: AutoRenew commitment plan. + :vartype auto_renew: bool + :ivar next: Cognitive Services account commitment period. + :vartype next: ~azure.mgmt.cognitiveservices.models.CommitmentPeriod + :ivar last: Cognitive Services account commitment period. + :vartype last: ~azure.mgmt.cognitiveservices.models.CommitmentPeriod + :ivar provisioning_issues: The list of ProvisioningIssue. + :vartype provisioning_issues: list[str] + """ + + provisioning_state: Optional[Union[str, "_models.CommitmentPlanProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Gets the status of the resource at the time the operation was called. Known values are: + \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", and + \"Canceled\".""" + commitment_plan_guid: Optional[str] = rest_field( + name="commitmentPlanGuid", visibility=["read", "create", "update", "delete", "query"] + ) + """Commitment plan guid.""" + hosting_model: Optional[Union[str, "_models.HostingModel"]] = rest_field( + name="hostingModel", visibility=["read", "create", "update", "delete", "query"] + ) + """Account hosting model. Known values are: \"Web\", \"ConnectedContainer\", + \"DisconnectedContainer\", and \"ProvisionedWeb\".""" + plan_type: Optional[str] = rest_field(name="planType", visibility=["read", "create", "update", "delete", "query"]) + """Commitment plan type.""" + current: Optional["_models.CommitmentPeriod"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Cognitive Services account commitment period.""" + auto_renew: Optional[bool] = rest_field( + name="autoRenew", visibility=["read", "create", "update", "delete", "query"] + ) + """AutoRenew commitment plan.""" + next: Optional["_models.CommitmentPeriod"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Cognitive Services account commitment period.""" + last: Optional["_models.CommitmentPeriod"] = rest_field(visibility=["read"]) + """Cognitive Services account commitment period.""" + provisioning_issues: Optional[list[str]] = rest_field(name="provisioningIssues", visibility=["read"]) + """The list of ProvisioningIssue.""" + + @overload + def __init__( + self, + *, + commitment_plan_guid: Optional[str] = None, + hosting_model: Optional[Union[str, "_models.HostingModel"]] = None, + plan_type: Optional[str] = None, + current: Optional["_models.CommitmentPeriod"] = None, + auto_renew: Optional[bool] = None, + next: Optional["_models.CommitmentPeriod"] = None, ) -> None: ... @overload @@ -3016,34 +2852,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CapabilityHost(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure Resource Manager resource envelope. +class CommitmentQuota(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services account commitment quota. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: ~azure.mgmt.cognitiveservices.models.CapabilityHostProperties + :ivar quantity: Commitment quota quantity. + :vartype quantity: int + :ivar unit: Commitment quota unit. + :vartype unit: str """ - properties: "_models.CapabilityHostProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" + quantity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Commitment quota quantity.""" + unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Commitment quota unit.""" @overload def __init__( self, *, - properties: "_models.CapabilityHostProperties", + quantity: Optional[int] = None, + unit: Optional[str] = None, ) -> None: ... @overload @@ -3057,87 +2885,60 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CapabilityHostProperties(ResourceBase): # pylint: disable=docstring-keyword-should-match-keyword-only - """CapabilityHostProperties. +class CommitmentTier(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services account commitment tier. - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar ai_services_connections: List of AI services connections. - :vartype ai_services_connections: list[str] - :ivar capability_host_kind: Kind of this capability host. "Agents" - :vartype capability_host_kind: str or ~azure.mgmt.cognitiveservices.models.CapabilityHostKind - :ivar customer_subnet: Customer subnet info to help set up this capability host. - :vartype customer_subnet: str - :ivar provisioning_state: Provisioning state for the CapabilityHost. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.CapabilityHostProvisioningState - :ivar storage_connections: List of connection names from those available in the account or - project to be used as a storage resource. - :vartype storage_connections: list[str] - :ivar thread_storage_connections: List of connection names from those available in the account - or project to be used for Thread storage. - :vartype thread_storage_connections: list[str] - :ivar vector_store_connections: List of connection names from those available in the account or - project to be used for vector database (e.g. CosmosDB). - :vartype vector_store_connections: list[str] - :ivar enable_public_hosting_environment: Whether public hosting environment is enabled for the - capability host. - :vartype enable_public_hosting_environment: bool + :ivar kind: The kind (type) of cognitive service account. + :vartype kind: str + :ivar sku_name: The name of the SKU. Ex - P3. It is typically a letter+number code. + :vartype sku_name: str + :ivar hosting_model: Account hosting model. Known values are: "Web", "ConnectedContainer", + "DisconnectedContainer", and "ProvisionedWeb". + :vartype hosting_model: str or ~azure.mgmt.cognitiveservices.models.HostingModel + :ivar plan_type: Commitment plan type. + :vartype plan_type: str + :ivar tier: Commitment period commitment tier. + :vartype tier: str + :ivar max_count: Commitment period commitment max count. + :vartype max_count: int + :ivar quota: Cognitive Services account commitment quota. + :vartype quota: ~azure.mgmt.cognitiveservices.models.CommitmentQuota + :ivar cost: Cognitive Services account commitment cost. + :vartype cost: ~azure.mgmt.cognitiveservices.models.CommitmentCost """ - ai_services_connections: Optional[list[str]] = rest_field( - name="aiServicesConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of AI services connections.""" - capability_host_kind: Optional[Union[str, "_models.CapabilityHostKind"]] = rest_field( - name="capabilityHostKind", visibility=["read", "create", "update", "delete", "query"] - ) - """Kind of this capability host. \"Agents\"""" - customer_subnet: Optional[str] = rest_field( - name="customerSubnet", visibility=["read", "create", "update", "delete", "query"] - ) - """Customer subnet info to help set up this capability host.""" - provisioning_state: Optional[Union[str, "_models.CapabilityHostProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state for the CapabilityHost. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" - storage_connections: Optional[list[str]] = rest_field( - name="storageConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of connection names from those available in the account or project to be used as a storage - resource.""" - thread_storage_connections: Optional[list[str]] = rest_field( - name="threadStorageConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of connection names from those available in the account or project to be used for Thread - storage.""" - vector_store_connections: Optional[list[str]] = rest_field( - name="vectorStoreConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of connection names from those available in the account or project to be used for vector - database (e.g. CosmosDB).""" - enable_public_hosting_environment: Optional[bool] = rest_field( - name="enablePublicHostingEnvironment", visibility=["read", "create", "update", "delete", "query"] + kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kind (type) of cognitive service account.""" + sku_name: Optional[str] = rest_field(name="skuName", visibility=["read", "create", "update", "delete", "query"]) + """The name of the SKU. Ex - P3. It is typically a letter+number code.""" + hosting_model: Optional[Union[str, "_models.HostingModel"]] = rest_field( + name="hostingModel", visibility=["read", "create", "update", "delete", "query"] ) - """Whether public hosting environment is enabled for the capability host.""" + """Account hosting model. Known values are: \"Web\", \"ConnectedContainer\", + \"DisconnectedContainer\", and \"ProvisionedWeb\".""" + plan_type: Optional[str] = rest_field(name="planType", visibility=["read", "create", "update", "delete", "query"]) + """Commitment plan type.""" + tier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Commitment period commitment tier.""" + max_count: Optional[int] = rest_field(name="maxCount", visibility=["read", "create", "update", "delete", "query"]) + """Commitment period commitment max count.""" + quota: Optional["_models.CommitmentQuota"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Cognitive Services account commitment quota.""" + cost: Optional["_models.CommitmentCost"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Cognitive Services account commitment cost.""" @overload def __init__( self, *, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - ai_services_connections: Optional[list[str]] = None, - capability_host_kind: Optional[Union[str, "_models.CapabilityHostKind"]] = None, - customer_subnet: Optional[str] = None, - storage_connections: Optional[list[str]] = None, - thread_storage_connections: Optional[list[str]] = None, - vector_store_connections: Optional[list[str]] = None, - enable_public_hosting_environment: Optional[bool] = None, + kind: Optional[str] = None, + sku_name: Optional[str] = None, + hosting_model: Optional[Union[str, "_models.HostingModel"]] = None, + plan_type: Optional[str] = None, + tier: Optional[str] = None, + max_count: Optional[int] = None, + quota: Optional["_models.CommitmentQuota"] = None, + cost: Optional["_models.CommitmentCost"] = None, ) -> None: ... @overload @@ -3151,37 +2952,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CapabilitySettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Extensible agent capability configuration. Carries the Azure resource IDs of the agent storage - dependencies. Modeled as an object so future capability-backed resources can be added without - changing the account or project contract. +class ConnectionAccessKey(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ConnectionAccessKey. - :ivar document_store: Azure resource ID of the document store used by agent runtime state. - :vartype document_store: str - :ivar vector_store: Azure resource ID of the vector store used by agent retrieval and indexing. - :vartype vector_store: str - :ivar blob_store: Azure resource ID of the blob store used by agent file and artifact storage. - :vartype blob_store: str + :ivar access_key_id: + :vartype access_key_id: str + :ivar secret_access_key: + :vartype secret_access_key: str """ - document_store: Optional[str] = rest_field( - name="documentStore", visibility=["read", "create", "update", "delete", "query"] + access_key_id: Optional[str] = rest_field( + name="accessKeyId", visibility=["read", "create", "update", "delete", "query"] ) - """Azure resource ID of the document store used by agent runtime state.""" - vector_store: Optional[str] = rest_field( - name="vectorStore", visibility=["read", "create", "update", "delete", "query"] + secret_access_key: Optional[str] = rest_field( + name="secretAccessKey", visibility=["read", "create", "update", "delete", "query"] ) - """Azure resource ID of the vector store used by agent retrieval and indexing.""" - blob_store: Optional[str] = rest_field(name="blobStore", visibility=["read", "create", "update", "delete", "query"]) - """Azure resource ID of the blob store used by agent file and artifact storage.""" @overload def __init__( self, *, - document_store: Optional[str] = None, - vector_store: Optional[str] = None, - blob_store: Optional[str] = None, + access_key_id: Optional[str] = None, + secret_access_key: Optional[str] = None, ) -> None: ... @overload @@ -3195,43 +2987,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CapacityConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The capacity configuration. +class ConnectionAccountKey(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Account key object for connection credential. - :ivar minimum: The minimum capacity. - :vartype minimum: int - :ivar maximum: The maximum capacity. - :vartype maximum: int - :ivar step: The minimal incremental between allowed values for capacity. - :vartype step: int - :ivar default: The default capacity. - :vartype default: int - :ivar allowed_values: The array of allowed values for capacity. - :vartype allowed_values: list[int] + :ivar key: + :vartype key: str """ - minimum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The minimum capacity.""" - maximum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum capacity.""" - step: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The minimal incremental between allowed values for capacity.""" - default: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The default capacity.""" - allowed_values: Optional[list[int]] = rest_field( - name="allowedValues", visibility=["read", "create", "update", "delete", "query"] - ) - """The array of allowed values for capacity.""" + key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - minimum: Optional[int] = None, - maximum: Optional[int] = None, - step: Optional[int] = None, - default: Optional[int] = None, - allowed_values: Optional[list[int]] = None, + key: Optional[str] = None, ) -> None: ... @overload @@ -3245,21 +3014,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ChannelsBuiltInAuthorizationPolicy(ApplicationAuthorizationPolicy, discriminator="Channels"): - """Represents a built-in authorization policy specific to Azure Bot Service/Channels - authentication. +class ConnectionApiKey(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Api key object for connection credential. - :ivar type: Authorization scheme type. Required. Channels-specific (AzureBotService) - authorization. - :vartype type: str or ~azure.mgmt.cognitiveservices.models.CHANNELS + :ivar key: + :vartype key: str """ - type: Literal[BuiltInAuthorizationScheme.CHANNELS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authorization scheme type. Required. Channels-specific (AzureBotService) authorization.""" + key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, + *, + key: Optional[str] = None, ) -> None: ... @overload @@ -3271,34 +3039,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = BuiltInAuthorizationScheme.CHANNELS # type: ignore -class CheckDomainAvailabilityParameter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Check Domain availability parameter. +class ConnectionManagedIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ConnectionManagedIdentity. - :ivar subdomain_name: The subdomain name to use. Required. - :vartype subdomain_name: str - :ivar type: The Type of the resource. Required. - :vartype type: str - :ivar kind: The kind (type) of cognitive service account. - :vartype kind: str + :ivar client_id: + :vartype client_id: str + :ivar resource_id: + :vartype resource_id: str """ - subdomain_name: str = rest_field(name="subdomainName", visibility=["read", "create", "update", "delete", "query"]) - """The subdomain name to use. Required.""" - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Type of the resource. Required.""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kind (type) of cognitive service account.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) + resource_id: Optional[str] = rest_field( + name="resourceId", visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - subdomain_name: str, - type: str, - kind: Optional[str] = None, + client_id: Optional[str] = None, + resource_id: Optional[str] = None, ) -> None: ... @overload @@ -3312,31 +3074,65 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CheckSkuAvailabilityParameter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Check SKU availability parameter. +class ConnectionOAuth2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ClientId and ClientSecret are required. Other properties are optional depending on each OAuth2 + provider's implementation. - :ivar skus: The SKU of the resource. Required. - :vartype skus: list[str] - :ivar kind: The kind (type) of cognitive service account. Required. - :vartype kind: str - :ivar type: The Type of the resource. Required. - :vartype type: str + :ivar auth_url: Required by Concur connection category. + :vartype auth_url: str + :ivar client_id: Client id in the format of UUID. + :vartype client_id: str + :ivar client_secret: + :vartype client_secret: str + :ivar developer_token: Required by GoogleAdWords connection category. + :vartype developer_token: str + :ivar password: + :vartype password: str + :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, + Xero, Zoho where user needs to get RefreshToken offline. + :vartype refresh_token: str + :ivar tenant_id: Required by QuickBooks and Xero connection categories. + :vartype tenant_id: str + :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' which + requires UsernamePassword. + :vartype username: str """ - skus: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SKU of the resource. Required.""" - kind: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kind (type) of cognitive service account. Required.""" - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Type of the resource. Required.""" + auth_url: Optional[str] = rest_field(name="authUrl", visibility=["read", "create", "update", "delete", "query"]) + """Required by Concur connection category.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) + """Client id in the format of UUID.""" + client_secret: Optional[str] = rest_field( + name="clientSecret", visibility=["read", "create", "update", "delete", "query"] + ) + developer_token: Optional[str] = rest_field( + name="developerToken", visibility=["read", "create", "update", "delete", "query"] + ) + """Required by GoogleAdWords connection category.""" + password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + refresh_token: Optional[str] = rest_field( + name="refreshToken", visibility=["read", "create", "update", "delete", "query"] + ) + """Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho where user + needs to get RefreshToken offline.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """Required by QuickBooks and Xero connection categories.""" + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Concur, ServiceNow auth server AccessToken grant type is 'Password' which requires + UsernamePassword.""" @overload def __init__( self, *, - skus: list[str], - kind: str, - type: str, + auth_url: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + developer_token: Optional[str] = None, + password: Optional[str] = None, + refresh_token: Optional[str] = None, + tenant_id: Optional[str] = None, + username: Optional[str] = None, ) -> None: ... @overload @@ -3350,54 +3146,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ComputeProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Base properties for all compute resource types. The computeType discriminator determines the - concrete property shape. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ClusterComputeProperties, ContainerInstanceComputeProperties +class ConnectionPersonalAccessToken(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ConnectionPersonalAccessToken. - :ivar compute_type: The type of compute resource. Required. Known values are: "Cluster" and - "ContainerInstance". - :vartype compute_type: str or ~azure.mgmt.cognitiveservices.models.ComputeType - :ivar location: The location of the compute resource. Required. - :vartype location: str - :ivar provisioning_state: Provisioning state of the compute resource. Known values are: - "Accepted", "Succeeded", "Failed", "Canceled", "Deleting", "Scaling", "Disabled", "Starting", - "Stopping", "Restarting", and "Stopped". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.ComputeProvisioningState - :ivar errors: Error details for the compute resource. - :vartype errors: list[~azure.mgmt.cognitiveservices.models.ErrorDetail] - :ivar creation_time: Creation time of the compute resource. - :vartype creation_time: ~datetime.datetime + :ivar pat: + :vartype pat: str """ - __mapping__: dict[str, _Model] = {} - compute_type: str = rest_discriminator( - name="computeType", visibility=["read", "create", "update", "delete", "query"] - ) - """The type of compute resource. Required. Known values are: \"Cluster\" and - \"ContainerInstance\".""" - location: str = rest_field(visibility=["read", "create"]) - """The location of the compute resource. Required.""" - provisioning_state: Optional[Union[str, "_models.ComputeProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state of the compute resource. Known values are: \"Accepted\", \"Succeeded\", - \"Failed\", \"Canceled\", \"Deleting\", \"Scaling\", \"Disabled\", \"Starting\", \"Stopping\", - \"Restarting\", and \"Stopped\".""" - errors: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) - """Error details for the compute resource.""" - creation_time: Optional[datetime.datetime] = rest_field(name="creationTime", visibility=["read"], format="rfc3339") - """Creation time of the compute resource.""" + pat: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - compute_type: str, - location: str, + pat: Optional[str] = None, ) -> None: ... @overload @@ -3411,46 +3173,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ClusterComputeProperties( - ComputeProperties, discriminator="Cluster" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties for a Cluster (AKS-backed) compute resource. +class ConnectionPropertiesV2BasicResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Connection base resource schema. - :ivar location: The location of the compute resource. Required. - :vartype location: str - :ivar provisioning_state: Provisioning state of the compute resource. Known values are: - "Accepted", "Succeeded", "Failed", "Canceled", "Deleting", "Scaling", "Disabled", "Starting", - "Stopping", "Restarting", and "Stopped". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.ComputeProvisioningState - :ivar errors: Error details for the compute resource. - :vartype errors: list[~azure.mgmt.cognitiveservices.models.ErrorDetail] - :ivar creation_time: Creation time of the compute resource. - :vartype creation_time: ~datetime.datetime - :ivar compute_type: The type of compute resource. Required. Cluster (AKS-backed) compute type. - :vartype compute_type: str or ~azure.mgmt.cognitiveservices.models.CLUSTER - :ivar pools: Pools attached to this compute cluster. Required. - :vartype pools: list[~azure.mgmt.cognitiveservices.models.Pool] - :ivar subnet_arm_id: ARM ID of the subnet used for compute. - :vartype subnet_arm_id: str + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: Connection property base schema. Required. + :vartype properties: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2 """ - compute_type: Literal[ComputeType.CLUSTER] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute resource. Required. Cluster (AKS-backed) compute type.""" - pools: list["_models.Pool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Pools attached to this compute cluster. Required.""" - subnet_arm_id: Optional[str] = rest_field( - name="subnetArmId", visibility=["read", "create", "update", "delete", "query"] + properties: "_models.ConnectionPropertiesV2" = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """ARM ID of the subnet used for compute.""" + """Connection property base schema. Required.""" @overload def __init__( self, *, - location: str, - pools: list["_models.Pool"], - subnet_arm_id: Optional[str] = None, + properties: "_models.ConnectionPropertiesV2", ) -> None: ... @overload @@ -3462,33 +3212,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.compute_type = ComputeType.CLUSTER # type: ignore -class CommitmentCost(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services account commitment cost. +class ConnectionServicePrincipal(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ConnectionServicePrincipal. - :ivar commitment_meter_id: Commitment meter Id. - :vartype commitment_meter_id: str - :ivar overage_meter_id: Overage meter Id. - :vartype overage_meter_id: str + :ivar client_id: + :vartype client_id: str + :ivar client_secret: + :vartype client_secret: str + :ivar tenant_id: + :vartype tenant_id: str """ - commitment_meter_id: Optional[str] = rest_field( - name="commitmentMeterId", visibility=["read", "create", "update", "delete", "query"] - ) - """Commitment meter Id.""" - overage_meter_id: Optional[str] = rest_field( - name="overageMeterId", visibility=["read", "create", "update", "delete", "query"] + client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) + client_secret: Optional[str] = rest_field( + name="clientSecret", visibility=["read", "create", "update", "delete", "query"] ) - """Overage meter Id.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - commitment_meter_id: Optional[str] = None, - overage_meter_id: Optional[str] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + tenant_id: Optional[str] = None, ) -> None: ... @overload @@ -3502,38 +3251,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CommitmentPeriod(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services account commitment period. +class ConnectionSharedAccessSignature(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ConnectionSharedAccessSignature. - :ivar tier: Commitment period commitment tier. - :vartype tier: str - :ivar count: Commitment period commitment count. - :vartype count: int - :ivar quota: Cognitive Services account commitment quota. - :vartype quota: ~azure.mgmt.cognitiveservices.models.CommitmentQuota - :ivar start_date: Commitment period start date. - :vartype start_date: str - :ivar end_date: Commitment period end date. - :vartype end_date: str + :ivar sas: + :vartype sas: str """ - tier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Commitment period commitment tier.""" - count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Commitment period commitment count.""" - quota: Optional["_models.CommitmentQuota"] = rest_field(visibility=["read"]) - """Cognitive Services account commitment quota.""" - start_date: Optional[str] = rest_field(name="startDate", visibility=["read"]) - """Commitment period start date.""" - end_date: Optional[str] = rest_field(name="endDate", visibility=["read"]) - """Commitment period end date.""" + sas: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - tier: Optional[str] = None, - count: Optional[int] = None, + sas: Optional[str] = None, ) -> None: ... @overload @@ -3547,58 +3278,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CommitmentPlan(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services account commitment plan. +class ConnectionUpdateContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties that the Cognitive services connection will be updated with. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of Cognitive Services account commitment plan. - :vartype properties: ~azure.mgmt.cognitiveservices.models.CommitmentPlanProperties - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar etag: Resource Etag. - :vartype etag: str - :ivar kind: The kind (type) of cognitive service account. - :vartype kind: str - :ivar sku: The resource model definition representing SKU. - :vartype sku: ~azure.mgmt.cognitiveservices.models.Sku + :ivar properties: The properties that the Cognitive services connection will be updated with. + :vartype properties: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2 """ - properties: Optional["_models.CommitmentPlanProperties"] = rest_field( + properties: Optional["_models.ConnectionPropertiesV2"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Properties of Cognitive Services account commitment plan.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) - """Resource tags.""" - location: Optional[str] = rest_field(visibility=["read", "create"]) - """The geo-location where the resource lives.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource Etag.""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kind (type) of cognitive service account.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource model definition representing SKU.""" + """The properties that the Cognitive services connection will be updated with.""" @overload def __init__( self, *, - properties: Optional["_models.CommitmentPlanProperties"] = None, - tags: Optional[dict[str, str]] = None, - location: Optional[str] = None, - kind: Optional[str] = None, - sku: Optional["_models.Sku"] = None, + properties: Optional["_models.ConnectionPropertiesV2"] = None, ) -> None: ... @overload @@ -3612,94 +3308,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CommitmentPlanAccountAssociation(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """The commitment plan association. +class ConnectionUsernamePassword(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ConnectionUsernamePassword. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of Cognitive Services account commitment plan association. - :vartype properties: - ~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociationProperties - :ivar etag: Resource Etag. - :vartype etag: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] + :ivar password: + :vartype password: str + :ivar security_token: Optional, required by connections like SalesForce for extra security in + addition to UsernamePassword. + :vartype security_token: str + :ivar username: + :vartype username: str """ - properties: Optional["_models.CommitmentPlanAccountAssociationProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + security_token: Optional[str] = rest_field( + name="securityToken", visibility=["read", "create", "update", "delete", "query"] ) - """Properties of Cognitive Services account commitment plan association.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource Etag.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) - """Resource tags.""" - - __flattened_items = ["account_id"] - - @overload - def __init__( - self, - *, - properties: Optional["_models.CommitmentPlanAccountAssociationProperties"] = None, - tags: Optional[dict[str, 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: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class CommitmentPlanAccountAssociationProperties( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The commitment plan account association properties. - - :ivar account_id: The Azure resource id of the account. - :vartype account_id: str - """ - - account_id: Optional[str] = rest_field(name="accountId", visibility=["read", "create", "update", "delete", "query"]) - """The Azure resource id of the account.""" + """Optional, required by connections like SalesForce for extra security in addition to + UsernamePassword.""" + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - account_id: Optional[str] = None, + password: Optional[str] = None, + security_token: Optional[str] = None, + username: Optional[str] = None, ) -> None: ... @overload @@ -3713,30 +3348,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CommitmentPlanAssociation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The commitment plan association. +class RaiBlocklistConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure OpenAI blocklist config. - :ivar commitment_plan_id: The Azure resource id of the commitment plan. - :vartype commitment_plan_id: str - :ivar commitment_plan_location: The location of of the commitment plan. - :vartype commitment_plan_location: str + :ivar blocklist_name: Name of ContentFilter. + :vartype blocklist_name: str + :ivar blocking: If blocking would occur. + :vartype blocking: bool """ - commitment_plan_id: Optional[str] = rest_field( - name="commitmentPlanId", visibility=["read", "create", "update", "delete", "query"] - ) - """The Azure resource id of the commitment plan.""" - commitment_plan_location: Optional[str] = rest_field( - name="commitmentPlanLocation", visibility=["read", "create", "update", "delete", "query"] + blocklist_name: Optional[str] = rest_field( + name="blocklistName", visibility=["read", "create", "update", "delete", "query"] ) - """The location of of the commitment plan.""" + """Name of ContentFilter.""" + blocking: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If blocking would occur.""" @overload def __init__( self, *, - commitment_plan_id: Optional[str] = None, - commitment_plan_location: Optional[str] = None, + blocklist_name: Optional[str] = None, + blocking: Optional[bool] = None, ) -> None: ... @overload @@ -3750,75 +3383,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CommitmentPlanProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of Cognitive Services account commitment plan. +class CustomBlocklistConfig(RaiBlocklistConfig): # pylint: disable=docstring-keyword-should-match-keyword-only + """Gets or sets the source to which filter applies. - :ivar provisioning_state: Gets the status of the resource at the time the operation was called. - Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", "Succeeded", and - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.CommitmentPlanProvisioningState - :ivar commitment_plan_guid: Commitment plan guid. - :vartype commitment_plan_guid: str - :ivar hosting_model: Account hosting model. Known values are: "Web", "ConnectedContainer", - "DisconnectedContainer", and "ProvisionedWeb". - :vartype hosting_model: str or ~azure.mgmt.cognitiveservices.models.HostingModel - :ivar plan_type: Commitment plan type. - :vartype plan_type: str - :ivar current: Cognitive Services account commitment period. - :vartype current: ~azure.mgmt.cognitiveservices.models.CommitmentPeriod - :ivar auto_renew: AutoRenew commitment plan. - :vartype auto_renew: bool - :ivar next: Cognitive Services account commitment period. - :vartype next: ~azure.mgmt.cognitiveservices.models.CommitmentPeriod - :ivar last: Cognitive Services account commitment period. - :vartype last: ~azure.mgmt.cognitiveservices.models.CommitmentPeriod - :ivar provisioning_issues: The list of ProvisioningIssue. - :vartype provisioning_issues: list[str] + :ivar blocklist_name: Name of ContentFilter. + :vartype blocklist_name: str + :ivar blocking: If blocking would occur. + :vartype blocking: bool + :ivar source: Content source to apply the Content Filters. Known values are: "Prompt", + "Completion", "PreToolCall", "PostToolCall", "PreRun", and "PostRun". + :vartype source: str or ~azure.mgmt.cognitiveservices.models.RaiPolicyContentSource """ - provisioning_state: Optional[Union[str, "_models.CommitmentPlanProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Gets the status of the resource at the time the operation was called. Known values are: - \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", and - \"Canceled\".""" - commitment_plan_guid: Optional[str] = rest_field( - name="commitmentPlanGuid", visibility=["read", "create", "update", "delete", "query"] - ) - """Commitment plan guid.""" - hosting_model: Optional[Union[str, "_models.HostingModel"]] = rest_field( - name="hostingModel", visibility=["read", "create", "update", "delete", "query"] - ) - """Account hosting model. Known values are: \"Web\", \"ConnectedContainer\", - \"DisconnectedContainer\", and \"ProvisionedWeb\".""" - plan_type: Optional[str] = rest_field(name="planType", visibility=["read", "create", "update", "delete", "query"]) - """Commitment plan type.""" - current: Optional["_models.CommitmentPeriod"] = rest_field( + source: Optional[Union[str, "_models.RaiPolicyContentSource"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Cognitive Services account commitment period.""" - auto_renew: Optional[bool] = rest_field( - name="autoRenew", visibility=["read", "create", "update", "delete", "query"] - ) - """AutoRenew commitment plan.""" - next: Optional["_models.CommitmentPeriod"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Cognitive Services account commitment period.""" - last: Optional["_models.CommitmentPeriod"] = rest_field(visibility=["read"]) - """Cognitive Services account commitment period.""" - provisioning_issues: Optional[list[str]] = rest_field(name="provisioningIssues", visibility=["read"]) - """The list of ProvisioningIssue.""" + """Content source to apply the Content Filters. Known values are: \"Prompt\", \"Completion\", + \"PreToolCall\", \"PostToolCall\", \"PreRun\", and \"PostRun\".""" @overload def __init__( self, *, - commitment_plan_guid: Optional[str] = None, - hosting_model: Optional[Union[str, "_models.HostingModel"]] = None, - plan_type: Optional[str] = None, - current: Optional["_models.CommitmentPeriod"] = None, - auto_renew: Optional[bool] = None, - next: Optional["_models.CommitmentPeriod"] = None, + blocklist_name: Optional[str] = None, + blocking: Optional[bool] = None, + source: Optional[Union[str, "_models.RaiPolicyContentSource"]] = None, ) -> None: ... @overload @@ -3832,26 +3421,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CommitmentQuota(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services account commitment quota. +class CustomKeys(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Custom Keys credential object. - :ivar quantity: Commitment quota quantity. - :vartype quantity: int - :ivar unit: Commitment quota unit. - :vartype unit: str + :ivar keys_property: Dictionary of . + :vartype keys_property: dict[str, str] """ - quantity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Commitment quota quantity.""" - unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Commitment quota unit.""" + keys_property: Optional[dict[str, str]] = rest_field( + name="keys", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="keys" + ) + """Dictionary of .""" @overload def __init__( self, *, - quantity: Optional[int] = None, - unit: Optional[str] = None, + keys_property: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -3865,60 +3451,88 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CommitmentTier(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services account commitment tier. +class CustomKeysConnectionProperties( + ConnectionPropertiesV2, discriminator="CustomKeys" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Category:= CustomKeys AuthType:= CustomKeys (as type discriminator) Credentials:= {CustomKeys} + as CustomKeys Target:= {any value} Use Metadata property bag for ApiVersion and other metadata + fields. - :ivar kind: The kind (type) of cognitive service account. - :vartype kind: str - :ivar sku_name: The name of the SKU. Ex - P3. It is typically a letter+number code. - :vartype sku_name: str - :ivar hosting_model: Account hosting model. Known values are: "Web", "ConnectedContainer", - "DisconnectedContainer", and "ProvisionedWeb". - :vartype hosting_model: str or ~azure.mgmt.cognitiveservices.models.HostingModel - :ivar plan_type: Commitment plan type. - :vartype plan_type: str - :ivar tier: Commitment period commitment tier. - :vartype tier: str - :ivar max_count: Commitment period commitment max count. - :vartype max_count: int - :ivar quota: Cognitive Services account commitment quota. - :vartype quota: ~azure.mgmt.cognitiveservices.models.CommitmentQuota - :ivar cost: Cognitive Services account commitment cost. - :vartype cost: ~azure.mgmt.cognitiveservices.models.CommitmentCost + :ivar category: Category of the connection. Known values are: "PythonFeed", + "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", + "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", + "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", + "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", + "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", + "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", + "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", + "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", + "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", + "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", + "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", + "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", + "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", + "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", + "PowerPlatformEnvironment", and "RemoteA2A". + :vartype category: str or ~azure.mgmt.cognitiveservices.models.ConnectionCategory + :ivar created_by_workspace_arm_id: + :vartype created_by_workspace_arm_id: str + :ivar error: Provides the error message if the connection fails. + :vartype error: str + :ivar expiry_time: + :vartype expiry_time: ~datetime.datetime + :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", + "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". + :vartype group: str or ~azure.mgmt.cognitiveservices.models.ConnectionGroup + :ivar is_shared_to_all: + :vartype is_shared_to_all: bool + :ivar metadata: Store user metadata for this connection. + :vartype metadata: dict[str, str] + :ivar pe_requirement: Specifies how private endpoints are used with this connection: + 'Required', 'NotRequired', or 'NotApplicable'. Known values are: "Required", "NotRequired", and + "NotApplicable". + :vartype pe_requirement: str or ~azure.mgmt.cognitiveservices.models.ManagedPERequirement + :ivar pe_status: Specifies the status of private endpoints for this connection: 'Inactive', + 'Active', or 'NotApplicable'. Known values are: "Inactive", "Active", and "NotApplicable". + :vartype pe_status: str or ~azure.mgmt.cognitiveservices.models.ManagedPEStatus + :ivar shared_user_list: + :vartype shared_user_list: list[str] + :ivar target: The connection URL to be used. + :vartype target: str + :ivar use_workspace_managed_identity: + :vartype use_workspace_managed_identity: bool + :ivar credentials: Custom Keys credential object. + :vartype credentials: ~azure.mgmt.cognitiveservices.models.CustomKeys + :ivar auth_type: Authentication type of the connection target. Required. CUSTOM_KEYS. + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kind (type) of cognitive service account.""" - sku_name: Optional[str] = rest_field(name="skuName", visibility=["read", "create", "update", "delete", "query"]) - """The name of the SKU. Ex - P3. It is typically a letter+number code.""" - hosting_model: Optional[Union[str, "_models.HostingModel"]] = rest_field( - name="hostingModel", visibility=["read", "create", "update", "delete", "query"] - ) - """Account hosting model. Known values are: \"Web\", \"ConnectedContainer\", - \"DisconnectedContainer\", and \"ProvisionedWeb\".""" - plan_type: Optional[str] = rest_field(name="planType", visibility=["read", "create", "update", "delete", "query"]) - """Commitment plan type.""" - tier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Commitment period commitment tier.""" - max_count: Optional[int] = rest_field(name="maxCount", visibility=["read", "create", "update", "delete", "query"]) - """Commitment period commitment max count.""" - quota: Optional["_models.CommitmentQuota"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Cognitive Services account commitment quota.""" - cost: Optional["_models.CommitmentCost"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Cognitive Services account commitment cost.""" + credentials: Optional["_models.CustomKeys"] = rest_field(visibility=["create", "update"]) + """Custom Keys credential object.""" + auth_type: Literal[ConnectionAuthType.CUSTOM_KEYS] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Authentication type of the connection target. Required. CUSTOM_KEYS.""" @overload def __init__( self, *, - kind: Optional[str] = None, - sku_name: Optional[str] = None, - hosting_model: Optional[Union[str, "_models.HostingModel"]] = None, - plan_type: Optional[str] = None, - tier: Optional[str] = None, - max_count: Optional[int] = None, - quota: Optional["_models.CommitmentQuota"] = None, - cost: Optional["_models.CommitmentCost"] = None, + category: Optional[Union[str, "_models.ConnectionCategory"]] = None, + error: Optional[str] = None, + expiry_time: Optional[datetime.datetime] = None, + is_shared_to_all: Optional[bool] = None, + metadata: Optional[dict[str, str]] = None, + pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, + pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, + shared_user_list: Optional[list[str]] = None, + target: Optional[str] = None, + use_workspace_managed_identity: Optional[bool] = None, + credentials: Optional["_models.CustomKeys"] = None, ) -> None: ... @overload @@ -3930,11 +3544,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.auth_type = ConnectionAuthType.CUSTOM_KEYS # type: ignore -class Compute(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services compute resource. Supports polymorphic compute types (Cluster, - ContainerInstance) via the computeType discriminator in properties. +class DefenderForAISetting(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The Defender for AI resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -3947,34 +3561,31 @@ class Compute(ProxyResource): # pylint: disable=docstring-keyword-should-match- :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Polymorphic properties of the compute resource. Use computeType to select - Cluster or ContainerInstance. Required. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ComputeProperties + :ivar properties: The Defender for AI resource properties. + :vartype properties: ~azure.mgmt.cognitiveservices.models.DefenderForAISettingProperties :ivar etag: Resource Etag. :vartype etag: str - :ivar kind: The kind (type) of compute resource. - :vartype kind: str - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cognitiveservices.models.Identity + :ivar tags: Resource tags. + :vartype tags: dict[str, str] """ - properties: "_models.ComputeProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Polymorphic properties of the compute resource. Use computeType to select Cluster or - ContainerInstance. Required.""" + properties: Optional["_models.DefenderForAISettingProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Defender for AI resource properties.""" etag: Optional[str] = rest_field(visibility=["read"]) """Resource Etag.""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kind (type) of compute resource.""" - identity: Optional["_models.Identity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identity for the resource.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) + """Resource tags.""" + + __flattened_items = ["state"] @overload def __init__( self, *, - properties: "_models.ComputeProperties", - kind: Optional[str] = None, - identity: Optional["_models.Identity"] = None, + properties: Optional["_models.DefenderForAISettingProperties"] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -3985,82 +3596,45 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") -class ComputeOperationStatus(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """The status of an async compute operation. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: The properties of the compute operation status. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ComputeOperationStatusProperties - """ - - properties: Optional["_models.ComputeOperationStatusProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties of the compute operation status.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.ComputeOperationStatusProperties"] = 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) + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) -class ComputeOperationStatusProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of a compute operation status. +class DefenderForAISettingProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The Defender for AI resource properties. - :ivar start_time: The start time of the operation. - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time of the operation. - :vartype end_time: ~datetime.datetime - :ivar status: The status of the operation. Known values are: "InProgress", "Succeeded", - "Failed", and "Canceled". - :vartype status: str or ~azure.mgmt.cognitiveservices.models.ComputeOperationStatusType - :ivar error: Error details if the operation failed. - :vartype error: ~azure.mgmt.cognitiveservices.models.ErrorDetail + :ivar state: Defender for AI state on the AI resource. Known values are: "Disabled" and + "Enabled". + :vartype state: str or ~azure.mgmt.cognitiveservices.models.DefenderForAISettingState """ - start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") - """The start time of the operation.""" - end_time: Optional[datetime.datetime] = rest_field(name="endTime", visibility=["read"], format="rfc3339") - """The end time of the operation.""" - status: Optional[Union[str, "_models.ComputeOperationStatusType"]] = rest_field( + state: Optional[Union[str, "_models.DefenderForAISettingState"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The status of the operation. Known values are: \"InProgress\", \"Succeeded\", \"Failed\", and - \"Canceled\".""" - error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error details if the operation failed.""" + """Defender for AI state on the AI resource. Known values are: \"Disabled\" and \"Enabled\".""" @overload def __init__( self, *, - status: Optional[Union[str, "_models.ComputeOperationStatusType"]] = None, - error: Optional["_models.ErrorDetail"] = None, + state: Optional[Union[str, "_models.DefenderForAISettingState"]] = None, ) -> None: ... @overload @@ -4074,28 +3648,48 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConnectionAccessKey(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ConnectionAccessKey. +class Deployment(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services account deployment. - :ivar access_key_id: - :vartype access_key_id: str - :ivar secret_access_key: - :vartype secret_access_key: str + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: Properties of Cognitive Services account deployment. + :vartype properties: ~azure.mgmt.cognitiveservices.models.DeploymentProperties + :ivar sku: The resource model definition representing SKU. + :vartype sku: ~azure.mgmt.cognitiveservices.models.Sku + :ivar etag: Resource Etag. + :vartype etag: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] """ - access_key_id: Optional[str] = rest_field( - name="accessKeyId", visibility=["read", "create", "update", "delete", "query"] - ) - secret_access_key: Optional[str] = rest_field( - name="secretAccessKey", visibility=["read", "create", "update", "delete", "query"] + properties: Optional["_models.DeploymentProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) + """Properties of Cognitive Services account deployment.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource model definition representing SKU.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """Resource Etag.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) + """Resource tags.""" @overload def __init__( self, *, - access_key_id: Optional[str] = None, - secret_access_key: Optional[str] = None, + properties: Optional["_models.DeploymentProperties"] = None, + sku: Optional["_models.Sku"] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -4109,20 +3703,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConnectionAccountKey(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Account key object for connection credential. +class DeploymentCapacitySettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Internal use only. - :ivar key: - :vartype key: str + :ivar designated_capacity: The designated capacity. + :vartype designated_capacity: int + :ivar priority: The priority of this capacity setting. + :vartype priority: int """ - key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + designated_capacity: Optional[int] = rest_field( + name="designatedCapacity", visibility=["read", "create", "update", "delete", "query"] + ) + """The designated capacity.""" + priority: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The priority of this capacity setting.""" @overload def __init__( self, *, - key: Optional[str] = None, + designated_capacity: Optional[int] = None, + priority: Optional[int] = None, ) -> None: ... @overload @@ -4136,2872 +3738,152 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConnectionApiKey(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Api key object for connection credential. - - :ivar key: - :vartype key: str - """ - - key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) +class DeploymentProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of Cognitive Services account deployment. - @overload - def __init__( - self, - *, - key: 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 ConnectionManagedIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ConnectionManagedIdentity. - - :ivar client_id: - :vartype client_id: str - :ivar resource_id: - :vartype resource_id: str - """ - - client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) - resource_id: Optional[str] = rest_field( - name="resourceId", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - client_id: Optional[str] = None, - resource_id: 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 ConnectionOAuth2(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ClientId and ClientSecret are required. Other properties are optional depending on each OAuth2 - provider's implementation. - - :ivar auth_url: Required by Concur connection category. - :vartype auth_url: str - :ivar client_id: Client id in the format of UUID. - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar developer_token: Required by GoogleAdWords connection category. - :vartype developer_token: str - :ivar password: - :vartype password: str - :ivar refresh_token: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, - Xero, Zoho where user needs to get RefreshToken offline. - :vartype refresh_token: str - :ivar tenant_id: Required by QuickBooks and Xero connection categories. - :vartype tenant_id: str - :ivar username: Concur, ServiceNow auth server AccessToken grant type is 'Password' which - requires UsernamePassword. - :vartype username: str - """ - - auth_url: Optional[str] = rest_field(name="authUrl", visibility=["read", "create", "update", "delete", "query"]) - """Required by Concur connection category.""" - client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) - """Client id in the format of UUID.""" - client_secret: Optional[str] = rest_field( - name="clientSecret", visibility=["read", "create", "update", "delete", "query"] - ) - developer_token: Optional[str] = rest_field( - name="developerToken", visibility=["read", "create", "update", "delete", "query"] - ) - """Required by GoogleAdWords connection category.""" - password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - refresh_token: Optional[str] = rest_field( - name="refreshToken", visibility=["read", "create", "update", "delete", "query"] - ) - """Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho where user - needs to get RefreshToken offline.""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - """Required by QuickBooks and Xero connection categories.""" - username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Concur, ServiceNow auth server AccessToken grant type is 'Password' which requires - UsernamePassword.""" - - @overload - def __init__( - self, - *, - auth_url: Optional[str] = None, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - developer_token: Optional[str] = None, - password: Optional[str] = None, - refresh_token: Optional[str] = None, - tenant_id: Optional[str] = None, - username: 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 ConnectionPersonalAccessToken(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ConnectionPersonalAccessToken. - - :ivar pat: - :vartype pat: str - """ - - pat: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - pat: 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 ConnectionPropertiesV2BasicResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Connection base resource schema. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Connection property base schema. Required. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2 - """ - - properties: "_models.ConnectionPropertiesV2" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Connection property base schema. Required.""" - - @overload - def __init__( - self, - *, - properties: "_models.ConnectionPropertiesV2", - ) -> 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 ConnectionServicePrincipal(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ConnectionServicePrincipal. - - :ivar client_id: - :vartype client_id: str - :ivar client_secret: - :vartype client_secret: str - :ivar tenant_id: - :vartype tenant_id: str - """ - - client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) - client_secret: Optional[str] = rest_field( - name="clientSecret", visibility=["read", "create", "update", "delete", "query"] - ) - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - tenant_id: 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 ConnectionSharedAccessSignature(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ConnectionSharedAccessSignature. - - :ivar sas: - :vartype sas: str - """ - - sas: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - sas: 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 ConnectionUpdateContent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties that the Cognitive services connection will be updated with. - - :ivar properties: The properties that the Cognitive services connection will be updated with. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2 - """ - - properties: Optional["_models.ConnectionPropertiesV2"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties that the Cognitive services connection will be updated with.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.ConnectionPropertiesV2"] = 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 ConnectionUsernamePassword(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ConnectionUsernamePassword. - - :ivar password: - :vartype password: str - :ivar security_token: Optional, required by connections like SalesForce for extra security in - addition to UsernamePassword. - :vartype security_token: str - :ivar username: - :vartype username: str - """ - - password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - security_token: Optional[str] = rest_field( - name="securityToken", visibility=["read", "create", "update", "delete", "query"] - ) - """Optional, required by connections like SalesForce for extra security in addition to - UsernamePassword.""" - username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - password: Optional[str] = None, - security_token: Optional[str] = None, - username: 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 ConnectivityEndpoints(_Model): - """Network connectivity endpoints for a Container Instance compute. - - :ivar public_ip_address: The public IP address of the compute instance. - :vartype public_ip_address: str - :ivar ssh_port: The SSH port for the compute instance. - :vartype ssh_port: int - """ - - public_ip_address: Optional[str] = rest_field(name="publicIpAddress", visibility=["read"]) - """The public IP address of the compute instance.""" - ssh_port: Optional[int] = rest_field(name="sshPort", visibility=["read"]) - """The SSH port for the compute instance.""" - - -class ContainerInstanceComputeProperties( - ComputeProperties, discriminator="ContainerInstance" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties for a Container Instance compute resource. - - :ivar location: The location of the compute resource. Required. - :vartype location: str - :ivar provisioning_state: Provisioning state of the compute resource. Known values are: - "Accepted", "Succeeded", "Failed", "Canceled", "Deleting", "Scaling", "Disabled", "Starting", - "Stopping", "Restarting", and "Stopped". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.ComputeProvisioningState - :ivar errors: Error details for the compute resource. - :vartype errors: list[~azure.mgmt.cognitiveservices.models.ErrorDetail] - :ivar creation_time: Creation time of the compute resource. - :vartype creation_time: ~datetime.datetime - :ivar compute_type: The type of compute resource. Required. Container Instance compute type. - :vartype compute_type: str or ~azure.mgmt.cognitiveservices.models.CONTAINER_INSTANCE - :ivar target_cluster_id: ARM resource ID of the parent cluster that hosts this container - instance. Required. - :vartype target_cluster_id: str - :ivar image_link: Container image URI (e.g., MCR or ACR image path) for the container instance. - Required. - :vartype image_link: str - :ivar idle_time_before_shutdown: ISO 8601 duration before the idle instance is automatically - shut down (e.g., 'PT30M'). - :vartype idle_time_before_shutdown: str - :ivar ssh_settings: SSH configuration for remote access to the container instance. - :vartype ssh_settings: ~azure.mgmt.cognitiveservices.models.SshSettings - :ivar connectivity_endpoints: Network connectivity endpoints assigned to the container - instance. - :vartype connectivity_endpoints: ~azure.mgmt.cognitiveservices.models.ConnectivityEndpoints - """ - - compute_type: Literal[ComputeType.CONTAINER_INSTANCE] = rest_discriminator(name="computeType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of compute resource. Required. Container Instance compute type.""" - target_cluster_id: str = rest_field( - name="targetClusterId", visibility=["read", "create", "update", "delete", "query"] - ) - """ARM resource ID of the parent cluster that hosts this container instance. Required.""" - image_link: str = rest_field(name="imageLink", visibility=["read", "create", "update", "delete", "query"]) - """Container image URI (e.g., MCR or ACR image path) for the container instance. Required.""" - idle_time_before_shutdown: Optional[str] = rest_field( - name="idleTimeBeforeShutdown", visibility=["read", "create", "update", "delete", "query"] - ) - """ISO 8601 duration before the idle instance is automatically shut down (e.g., 'PT30M').""" - ssh_settings: Optional["_models.SshSettings"] = rest_field( - name="sshSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """SSH configuration for remote access to the container instance.""" - connectivity_endpoints: Optional["_models.ConnectivityEndpoints"] = rest_field( - name="connectivityEndpoints", visibility=["read"] - ) - """Network connectivity endpoints assigned to the container instance.""" - - @overload - def __init__( - self, - *, - location: str, - target_cluster_id: str, - image_link: str, - idle_time_before_shutdown: Optional[str] = None, - ssh_settings: Optional["_models.SshSettings"] = 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.compute_type = ComputeType.CONTAINER_INSTANCE # type: ignore - - -class CostControl(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """A cost control owned by a Cognitive Services account. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.cognitiveservices.models.CostControlProperties - :ivar etag: The entity tag used for optimistic concurrency. - :vartype etag: str - """ - - properties: Optional["_models.CostControlProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The resource-specific properties for this resource.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """The entity tag used for optimistic concurrency.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.CostControlProperties"] = 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 CostControlConnections(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Defines account-level connections used to publish cost-control telemetry and events. - Application Insights is optional and may be removed while policies remain attached. Event Grid - is required for alerts; supplied connection references must still be valid. - - :ivar app_insights_connection_id: Gets or sets the full resource ID of the optional Application - Insights connection. - :vartype app_insights_connection_id: str - :ivar event_grid_connection_id: The full resource ID of the Event Grid connection used for cost - control alerts. This connection must be configured when an attached cost control contains an - alert threshold action and cannot be removed while such an action remains attached. - :vartype event_grid_connection_id: str - """ - - app_insights_connection_id: Optional[str] = rest_field( - name="appInsightsConnectionId", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the full resource ID of the optional Application Insights connection.""" - event_grid_connection_id: Optional[str] = rest_field( - name="eventGridConnectionId", visibility=["read", "create", "update", "delete", "query"] - ) - """The full resource ID of the Event Grid connection used for cost control alerts. This connection - must be configured when an attached cost control contains an alert threshold action and cannot - be removed while such an action remains attached.""" - - @overload - def __init__( - self, - *, - app_insights_connection_id: Optional[str] = None, - event_grid_connection_id: 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 CostControlDimension(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A request dimension used to partition cost control consumption. - - :ivar type: The kind of request dimension. Required. Known values are: "Agent", "Identity", - "Session", "Project", "Account", and "Custom". - :vartype type: str or ~azure.mgmt.cognitiveservices.models.CostControlDimensionType - :ivar attribute: Gets or sets the attribute path retained for legacy Custom counters. Authored - rules cannot select Custom; built-in dimensions must omit this property. - :vartype attribute: str - """ - - type: Union[str, "_models.CostControlDimensionType"] = rest_field(visibility=["read", "create", "update"]) - """The kind of request dimension. Required. Known values are: \"Agent\", \"Identity\", - \"Session\", \"Project\", \"Account\", and \"Custom\".""" - attribute: Optional[str] = rest_field(visibility=["read"]) - """Gets or sets the attribute path retained for legacy Custom counters. Authored rules cannot - select Custom; built-in dimensions must omit this property.""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.CostControlDimensionType"], - ) -> 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 CostControlMatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Gets or sets optional match arrays keyed by ``agentResourceIds``, ``identityObjectIds``, - ``sessionIds``, or ``projectIds``. Each array contains 1 to 20 non-empty values. Agent resource - IDs use - /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}. - Legacy dotted identity, session, and project keys remain accepted, but cannot be combined with - their canonical key. - - :ivar agent_resource_ids: Agent resource IDs use - /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}. - :vartype agent_resource_ids: list[str] - :ivar identity_object_ids: The authenticated principal object IDs to match. - :vartype identity_object_ids: list[str] - :ivar session_ids: The Foundry session IDs to match. - :vartype session_ids: list[str] - :ivar project_ids: The Foundry project resource IDs to match. - :vartype project_ids: list[str] - """ - - agent_resource_ids: Optional[list[str]] = rest_field( - name="agentResourceIds", visibility=["read", "create", "update", "delete", "query"] - ) - """Agent resource IDs use - /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}.""" - identity_object_ids: Optional[list[str]] = rest_field( - name="identityObjectIds", visibility=["read", "create", "update", "delete", "query"] - ) - """The authenticated principal object IDs to match.""" - session_ids: Optional[list[str]] = rest_field( - name="sessionIds", visibility=["read", "create", "update", "delete", "query"] - ) - """The Foundry session IDs to match.""" - project_ids: Optional[list[str]] = rest_field( - name="projectIds", visibility=["read", "create", "update", "delete", "query"] - ) - """The Foundry project resource IDs to match.""" - - @overload - def __init__( - self, - *, - agent_resource_ids: Optional[list[str]] = None, - identity_object_ids: Optional[list[str]] = None, - session_ids: Optional[list[str]] = None, - project_ids: Optional[list[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 CostControlPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The request used to update a cost control. - - :ivar properties: The cost control properties to update. - :vartype properties: ~azure.mgmt.cognitiveservices.models.CostControlPatchProperties - """ - - properties: Optional["_models.CostControlPatchProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The cost control properties to update.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.CostControlPatchProperties"] = 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 CostControlPatchProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties that can be changed on a cost control. - - :ivar display_name: An optional human-readable name for the cost control. Set this property to - null to clear it. - :vartype display_name: str - :ivar rules: The complete replacement set of cost control rules. - :vartype rules: list[~azure.mgmt.cognitiveservices.models.CostControlRule] - """ - - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """An optional human-readable name for the cost control. Set this property to null to clear it.""" - rules: Optional[list["_models.CostControlRule"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The complete replacement set of cost control rules.""" - - @overload - def __init__( - self, - *, - display_name: Optional[str] = None, - rules: Optional[list["_models.CostControlRule"]] = 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 CostControlProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The customer-authored settings of a cost control. - - :ivar display_name: An optional human-readable name for the cost control. - :vartype display_name: str - :ivar rules: The rules enforced by the cost control. Required. - :vartype rules: list[~azure.mgmt.cognitiveservices.models.CostControlRule] - """ - - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """An optional human-readable name for the cost control.""" - rules: list["_models.CostControlRule"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The rules enforced by the cost control. Required.""" - - @overload - def __init__( - self, - *, - rules: list["_models.CostControlRule"], - display_name: 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 CostControlRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A cost limit and the population to which it applies. - - :ivar name: The stable rule identifier, unique within the cost control without regard to case. - Required. - :vartype name: str - :ivar counter_key: Gets or sets the single built-in dimension used to partition consumption. - Custom dimensions are retained only for legacy reads and metadata-only updates. Legacy - singleton arrays are accepted on read; serialization always emits an object. To track another - field, create another rule. Required. - :vartype counter_key: ~azure.mgmt.cognitiveservices.models.CostControlDimension - :ivar unit: The unit used for the cost control amount and absolute thresholds. Required. "Usd" - :vartype unit: str or ~azure.mgmt.cognitiveservices.models.CostControlUnit - :ivar amount: The maximum consumption allowed by this rule, expressed in the selected unit. - Required. - :vartype amount: float - :ivar period: Gets or sets the calendar-aligned UTC renewal period. Authored rules support Day, - Week, or Month. This field is required for recurring rules and must be omitted for - non-recurring rules. Legacy stored minute, hour, and year periods are preserved when reading - definitions. Known values are: "Minute", "Hour", "Day", "Week", "Month", and "Year". - :vartype period: str or ~azure.mgmt.cognitiveservices.models.CostControlPeriod - :ivar recurring: Whether the cost control renews. The default is true. - :vartype recurring: bool - :ivar match: Gets or sets optional match arrays keyed by ``agentResourceIds``, - ``identityObjectIds``, ``sessionIds``, or ``projectIds``. Each array contains 1 to 20 non-empty - values. Agent resource IDs use - /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}. - Legacy dotted identity, session, and project keys remain accepted, but cannot be combined with - their canonical key. - :vartype match: ~azure.mgmt.cognitiveservices.models.CostControlMatch - :ivar thresholds: Gets or sets optional thresholds. Omitted or empty thresholds track usage - without explicit actions. Authored thresholds must explicitly specify Alert or Block; Audit is - retained for legacy reads. - :vartype thresholds: list[~azure.mgmt.cognitiveservices.models.CostControlThreshold] - """ - - name: str = rest_field(visibility=["read", "create", "update"]) - """The stable rule identifier, unique within the cost control without regard to case. Required.""" - counter_key: "_models.CostControlDimension" = rest_field( - name="counterKey", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the single built-in dimension used to partition consumption. Custom dimensions are - retained only for legacy reads and metadata-only updates. Legacy singleton arrays are accepted - on read; serialization always emits an object. To track another field, create another rule. - Required.""" - unit: Union[str, "_models.CostControlUnit"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unit used for the cost control amount and absolute thresholds. Required. \"Usd\"""" - amount: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The maximum consumption allowed by this rule, expressed in the selected unit. Required.""" - period: Optional[Union[str, "_models.CostControlPeriod"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the calendar-aligned UTC renewal period. Authored rules support Day, Week, or - Month. This field is required for recurring rules and must be omitted for non-recurring rules. - Legacy stored minute, hour, and year periods are preserved when reading definitions. Known - values are: \"Minute\", \"Hour\", \"Day\", \"Week\", \"Month\", and \"Year\".""" - recurring: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the cost control renews. The default is true.""" - match: Optional["_models.CostControlMatch"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets optional match arrays keyed by ``agentResourceIds``, ``identityObjectIds``, - ``sessionIds``, or ``projectIds``. Each array contains 1 to 20 non-empty values. Agent resource - IDs use - /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}. - Legacy dotted identity, session, and project keys remain accepted, but cannot be combined with - their canonical key.""" - thresholds: Optional[list["_models.CostControlThreshold"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets optional thresholds. Omitted or empty thresholds track usage without explicit - actions. Authored thresholds must explicitly specify Alert or Block; Audit is retained for - legacy reads.""" - - @overload - def __init__( - self, - *, - name: str, - counter_key: "_models.CostControlDimension", - unit: Union[str, "_models.CostControlUnit"], - amount: float, - period: Optional[Union[str, "_models.CostControlPeriod"]] = None, - recurring: Optional[bool] = None, - match: Optional["_models.CostControlMatch"] = None, - thresholds: Optional[list["_models.CostControlThreshold"]] = 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 CostControlThreshold(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """An action evaluated when cost control consumption reaches a threshold. - - :ivar type: How the threshold value is interpreted. Required. Known values are: "Percentage" - and "Absolute". - :vartype type: str or ~azure.mgmt.cognitiveservices.models.CostControlThresholdType - :ivar value: Gets or sets the threshold value. Legacy Audit definitions retain their stored - values; new thresholds support only Alert or Block. Required. - :vartype value: float - :ivar action: Gets or sets the threshold action. Authored thresholds must explicitly specify - Alert or Block. Legacy stored definitions with omitted actions continue to read as Audit. - Required. Known values are: "Audit", "Alert", and "Block". - :vartype action: str or ~azure.mgmt.cognitiveservices.models.CostControlThresholdAction - """ - - type: Union[str, "_models.CostControlThresholdType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the threshold value is interpreted. Required. Known values are: \"Percentage\" and - \"Absolute\".""" - value: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Gets or sets the threshold value. Legacy Audit definitions retain their stored values; new - thresholds support only Alert or Block. Required.""" - action: Union[str, "_models.CostControlThresholdAction"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the threshold action. Authored thresholds must explicitly specify Alert or Block. - Legacy stored definitions with omitted actions continue to read as Audit. Required. Known - values are: \"Audit\", \"Alert\", and \"Block\".""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.CostControlThresholdType"], - value: float, - action: Union[str, "_models.CostControlThresholdAction"], - ) -> 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 RaiBlocklistConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure OpenAI blocklist config. - - :ivar blocklist_name: Name of ContentFilter. - :vartype blocklist_name: str - :ivar blocking: If blocking would occur. - :vartype blocking: bool - """ - - blocklist_name: Optional[str] = rest_field( - name="blocklistName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of ContentFilter.""" - blocking: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """If blocking would occur.""" - - @overload - def __init__( - self, - *, - blocklist_name: Optional[str] = None, - blocking: Optional[bool] = 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 CustomBlocklistConfig(RaiBlocklistConfig): # pylint: disable=docstring-keyword-should-match-keyword-only - """Gets or sets the source to which filter applies. - - :ivar blocklist_name: Name of ContentFilter. - :vartype blocklist_name: str - :ivar blocking: If blocking would occur. - :vartype blocking: bool - :ivar source: Content source to apply the Content Filters. Known values are: "Prompt", - "Completion", "PreToolCall", "PostToolCall", "PreRun", and "PostRun". - :vartype source: str or ~azure.mgmt.cognitiveservices.models.RaiPolicyContentSource - """ - - source: Optional[Union[str, "_models.RaiPolicyContentSource"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Content source to apply the Content Filters. Known values are: \"Prompt\", \"Completion\", - \"PreToolCall\", \"PostToolCall\", \"PreRun\", and \"PostRun\".""" - - @overload - def __init__( - self, - *, - blocklist_name: Optional[str] = None, - blocking: Optional[bool] = None, - source: Optional[Union[str, "_models.RaiPolicyContentSource"]] = 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 CustomKeys(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Custom Keys credential object. - - :ivar keys_property: Dictionary of . - :vartype keys_property: dict[str, str] - """ - - keys_property: Optional[dict[str, str]] = rest_field( - name="keys", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="keys" - ) - """Dictionary of .""" - - @overload - def __init__( - self, - *, - keys_property: Optional[dict[str, 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 CustomKeysConnectionProperties( - ConnectionPropertiesV2, discriminator="CustomKeys" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Category:= CustomKeys AuthType:= CustomKeys (as type discriminator) Credentials:= {CustomKeys} - as CustomKeys Target:= {any value} Use Metadata property bag for ApiVersion and other metadata - fields. - - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or ~azure.mgmt.cognitiveservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: Provides the error message if the connection fails. - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.mgmt.cognitiveservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Specifies how private endpoints are used with this connection: - 'Required', 'NotRequired', or 'NotApplicable'. Known values are: "Required", "NotRequired", and - "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.cognitiveservices.models.ManagedPERequirement - :ivar pe_status: Specifies the status of private endpoints for this connection: 'Inactive', - 'Active', or 'NotApplicable'. Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.cognitiveservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: The connection URL to be used. - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: Custom Keys credential object. - :vartype credentials: ~azure.mgmt.cognitiveservices.models.CustomKeys - :ivar auth_type: Authentication type of the connection target. Required. CUSTOM_KEYS. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.CUSTOM_KEYS - """ - - credentials: Optional["_models.CustomKeys"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Custom Keys credential object.""" - auth_type: Literal[ConnectionAuthType.CUSTOM_KEYS] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. CUSTOM_KEYS.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.CustomKeys"] = 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.auth_type = ConnectionAuthType.CUSTOM_KEYS # type: ignore - - -class DefenderForAISetting(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """The Defender for AI resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: The Defender for AI resource properties. - :vartype properties: ~azure.mgmt.cognitiveservices.models.DefenderForAISettingProperties - :ivar etag: Resource Etag. - :vartype etag: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - properties: Optional["_models.DefenderForAISettingProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The Defender for AI resource properties.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource Etag.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) - """Resource tags.""" - - __flattened_items = ["state"] - - @overload - def __init__( - self, - *, - properties: Optional["_models.DefenderForAISettingProperties"] = None, - tags: Optional[dict[str, 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: - _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} - super().__init__(*args, **kwargs) - for k, v in _flattened_input.items(): - setattr(self, k, v) - - def __getattr__(self, name: str) -> Any: - if name in self.__flattened_items: - if self.properties is None: - return None - return getattr(self.properties, name) - raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") - - def __setattr__(self, key: str, value: Any) -> None: - if key in self.__flattened_items: - if self.properties is None: - self.properties = self._attr_to_rest_field["properties"]._class_type() - setattr(self.properties, key, value) - else: - super().__setattr__(key, value) - - -class DefenderForAISettingProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The Defender for AI resource properties. - - :ivar state: Defender for AI state on the AI resource. Known values are: "Disabled" and - "Enabled". - :vartype state: str or ~azure.mgmt.cognitiveservices.models.DefenderForAISettingState - """ - - state: Optional[Union[str, "_models.DefenderForAISettingState"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Defender for AI state on the AI resource. Known values are: \"Disabled\" and \"Enabled\".""" - - @overload - def __init__( - self, - *, - state: Optional[Union[str, "_models.DefenderForAISettingState"]] = 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 Deployment(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services account deployment. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of Cognitive Services account deployment. - :vartype properties: ~azure.mgmt.cognitiveservices.models.DeploymentProperties - :ivar sku: The resource model definition representing SKU. - :vartype sku: ~azure.mgmt.cognitiveservices.models.Sku - :ivar etag: Resource Etag. - :vartype etag: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - properties: Optional["_models.DeploymentProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of Cognitive Services account deployment.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource model definition representing SKU.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource Etag.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) - """Resource tags.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.DeploymentProperties"] = None, - sku: Optional["_models.Sku"] = None, - tags: Optional[dict[str, 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 DeploymentCapacitySettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Internal use only. - - :ivar designated_capacity: The designated capacity. - :vartype designated_capacity: int - :ivar priority: The priority of this capacity setting. - :vartype priority: int - """ - - designated_capacity: Optional[int] = rest_field( - name="designatedCapacity", visibility=["read", "create", "update", "delete", "query"] - ) - """The designated capacity.""" - priority: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The priority of this capacity setting.""" - - @overload - def __init__( - self, - *, - designated_capacity: Optional[int] = None, - priority: Optional[int] = 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 DeploymentPolicyEvaluationResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Policy evaluation result for a single deployment. - - :ivar evaluation_outcome: The evaluation outcome. Known values are: "Compliant", - "NonCompliant", and "Error". - :vartype evaluation_outcome: str or - ~azure.mgmt.cognitiveservices.models.PolicyEvaluationOutcome - :ivar error_message: Error message if the evaluation outcome is Error. - :vartype error_message: str - :ivar non_compliant_assignments: Details of non-compliant policy assignments. - :vartype non_compliant_assignments: - list[~azure.mgmt.cognitiveservices.models.PolicyAssignmentEvaluationDetails] - """ - - evaluation_outcome: Optional[Union[str, "_models.PolicyEvaluationOutcome"]] = rest_field( - name="evaluationOutcome", visibility=["read", "create", "update", "delete", "query"] - ) - """The evaluation outcome. Known values are: \"Compliant\", \"NonCompliant\", and \"Error\".""" - error_message: Optional[str] = rest_field( - name="errorMessage", visibility=["read", "create", "update", "delete", "query"] - ) - """Error message if the evaluation outcome is Error.""" - non_compliant_assignments: Optional[list["_models.PolicyAssignmentEvaluationDetails"]] = rest_field( - name="nonCompliantAssignments", visibility=["read", "create", "update", "delete", "query"] - ) - """Details of non-compliant policy assignments.""" - - @overload - def __init__( - self, - *, - evaluation_outcome: Optional[Union[str, "_models.PolicyEvaluationOutcome"]] = None, - error_message: Optional[str] = None, - non_compliant_assignments: Optional[list["_models.PolicyAssignmentEvaluationDetails"]] = 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 DeploymentProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of Cognitive Services account deployment. - - :ivar provisioning_state: Gets the status of the resource at the time the operation was called. - Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", "Succeeded", - "Disabled", and "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.DeploymentProvisioningState - :ivar model: Properties of Cognitive Services account deployment model. - :vartype model: ~azure.mgmt.cognitiveservices.models.DeploymentModel - :ivar context_cache_container_id: The resource ID of the context cache container associated - with this deployment. - :vartype context_cache_container_id: str - :ivar speculative_decoding: Speculative decoding settings for the deployment. This - configuration applies to Fireworks model formats. - :vartype speculative_decoding: - ~azure.mgmt.cognitiveservices.models.DeploymentSpeculativeDecoding - :ivar scale_settings: Properties of Cognitive Services account deployment model. (Deprecated, - please use Deployment.sku instead.). - :vartype scale_settings: ~azure.mgmt.cognitiveservices.models.DeploymentScaleSettings - :ivar capabilities: The capabilities. - :vartype capabilities: dict[str, str] - :ivar rai_policy_name: The name of RAI policy. - :vartype rai_policy_name: str - :ivar call_rate_limit: The call rate limit Cognitive Services account. - :vartype call_rate_limit: ~azure.mgmt.cognitiveservices.models.CallRateLimit - :ivar rate_limits: - :vartype rate_limits: list[~azure.mgmt.cognitiveservices.models.ThrottlingRule] - :ivar version_upgrade_option: Deployment model version upgrade option. Known values are: - "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", and "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.cognitiveservices.models.DeploymentModelVersionUpgradeOption - :ivar dynamic_throttling_enabled: If the dynamic throttling is enabled. - :vartype dynamic_throttling_enabled: bool - :ivar current_capacity: The current capacity. - :vartype current_capacity: int - :ivar capacity_settings: Internal use only. - :vartype capacity_settings: ~azure.mgmt.cognitiveservices.models.DeploymentCapacitySettings - :ivar parent_deployment_name: The name of parent deployment. - :vartype parent_deployment_name: str - :ivar spillover_deployment_name: Specifies the deployment name that should serve requests when - the request would have otherwise been throttled due to reaching current deployment throughput - limit. - :vartype spillover_deployment_name: str - :ivar service_tier: The service tier for the deployment. Determines the pricing and performance - level for request processing. Use 'Default' for standard pricing or 'Priority' for - higher-priority processing with premium pricing. Note: Pause operations are only supported on - Standard, DataZoneStandard, and GlobalStandard SKUs. Known values are: "Default" and - "Priority". - :vartype service_tier: str or ~azure.mgmt.cognitiveservices.models.ServiceTier - :ivar deployment_state: The state of the deployment. Controls whether the deployment is - accepting inference requests. Use 'Running' for active deployments that process requests, or - 'Paused' to temporarily stop inference while preserving the deployment configuration. Known - values are: "Running" and "Paused". - :vartype deployment_state: str or ~azure.mgmt.cognitiveservices.models.DeploymentState - :ivar routing: Routing configuration for the model-router deployment. This property is only - applicable when the deployed model is 'model-router' version 2025-11-18 or later. Allows you to - select the models subset for routing and the routing mode (balanced, quality, cost) for routing - across all supported models or the model subset. - :vartype routing: ~azure.mgmt.cognitiveservices.models.DeploymentRouting - :ivar cost_control_ids: The full resource IDs of cost controls directly attached to this - deployment. At the moment the service only supports a single cost control. This will be - expanded in future API versions. - :vartype cost_control_ids: list[str] - """ - - provisioning_state: Optional[Union[str, "_models.DeploymentProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Gets the status of the resource at the time the operation was called. Known values are: - \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", \"Disabled\", - and \"Canceled\".""" - model: Optional["_models.DeploymentModel"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Properties of Cognitive Services account deployment model.""" - context_cache_container_id: Optional[str] = rest_field( - name="contextCacheContainerId", visibility=["read", "create", "update", "delete", "query"] - ) - """The resource ID of the context cache container associated with this deployment.""" - speculative_decoding: Optional["_models.DeploymentSpeculativeDecoding"] = rest_field( - name="speculativeDecoding", visibility=["read", "create", "update", "delete", "query"] - ) - """Speculative decoding settings for the deployment. This configuration applies to Fireworks model - formats.""" - scale_settings: Optional["_models.DeploymentScaleSettings"] = rest_field( - name="scaleSettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of Cognitive Services account deployment model. (Deprecated, please use - Deployment.sku instead.).""" - capabilities: Optional[dict[str, str]] = rest_field(visibility=["read"]) - """The capabilities.""" - rai_policy_name: Optional[str] = rest_field( - name="raiPolicyName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of RAI policy.""" - call_rate_limit: Optional["_models.CallRateLimit"] = rest_field(name="callRateLimit", visibility=["read"]) - """The call rate limit Cognitive Services account.""" - rate_limits: Optional[list["_models.ThrottlingRule"]] = rest_field(name="rateLimits", visibility=["read"]) - version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = rest_field( - name="versionUpgradeOption", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment model version upgrade option. Known values are: \"OnceNewDefaultVersionAvailable\", - \"OnceCurrentVersionExpired\", and \"NoAutoUpgrade\".""" - dynamic_throttling_enabled: Optional[bool] = rest_field(name="dynamicThrottlingEnabled", visibility=["read"]) - """If the dynamic throttling is enabled.""" - current_capacity: Optional[int] = rest_field( - name="currentCapacity", visibility=["read", "create", "update", "delete", "query"] - ) - """The current capacity.""" - capacity_settings: Optional["_models.DeploymentCapacitySettings"] = rest_field( - name="capacitySettings", visibility=["read", "create", "update", "delete", "query"] - ) - """Internal use only.""" - parent_deployment_name: Optional[str] = rest_field( - name="parentDeploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of parent deployment.""" - spillover_deployment_name: Optional[str] = rest_field( - name="spilloverDeploymentName", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies the deployment name that should serve requests when the request would have otherwise - been throttled due to reaching current deployment throughput limit.""" - service_tier: Optional[Union[str, "_models.ServiceTier"]] = rest_field( - name="serviceTier", visibility=["read", "create", "update", "delete", "query"] - ) - """The service tier for the deployment. Determines the pricing and performance level for request - processing. Use 'Default' for standard pricing or 'Priority' for higher-priority processing - with premium pricing. Note: Pause operations are only supported on Standard, DataZoneStandard, - and GlobalStandard SKUs. Known values are: \"Default\" and \"Priority\".""" - deployment_state: Optional[Union[str, "_models.DeploymentState"]] = rest_field( - name="deploymentState", visibility=["read", "create", "update", "delete", "query"] - ) - """The state of the deployment. Controls whether the deployment is accepting inference requests. - Use 'Running' for active deployments that process requests, or 'Paused' to temporarily stop - inference while preserving the deployment configuration. Known values are: \"Running\" and - \"Paused\".""" - routing: Optional["_models.DeploymentRouting"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Routing configuration for the model-router deployment. This property is only applicable when - the deployed model is 'model-router' version 2025-11-18 or later. Allows you to select the - models subset for routing and the routing mode (balanced, quality, cost) for routing across all - supported models or the model subset.""" - cost_control_ids: Optional[list[str]] = rest_field( - name="costControlIds", visibility=["read", "create", "update", "delete", "query"] - ) - """The full resource IDs of cost controls directly attached to this deployment. At the moment the - service only supports a single cost control. This will be expanded in future API versions.""" - - @overload - def __init__( - self, - *, - model: Optional["_models.DeploymentModel"] = None, - context_cache_container_id: Optional[str] = None, - speculative_decoding: Optional["_models.DeploymentSpeculativeDecoding"] = None, - scale_settings: Optional["_models.DeploymentScaleSettings"] = None, - rai_policy_name: Optional[str] = None, - version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = None, - current_capacity: Optional[int] = None, - capacity_settings: Optional["_models.DeploymentCapacitySettings"] = None, - parent_deployment_name: Optional[str] = None, - spillover_deployment_name: Optional[str] = None, - service_tier: Optional[Union[str, "_models.ServiceTier"]] = None, - deployment_state: Optional[Union[str, "_models.DeploymentState"]] = None, - routing: Optional["_models.DeploymentRouting"] = None, - cost_control_ids: Optional[list[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 DeploymentRouting(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Routing configuration for the model-router deployment. Specifies how requests are routed across - multiple models. - - :ivar mode: The model-router routing mode that determines how requests are distributed across - models. Known values are: "cost", "balanced", and "quality". - :vartype mode: str or ~azure.mgmt.cognitiveservices.models.RoutingMode - :ivar models: Optional. The list of model-router supported models that the model router can use - to route requests across. If not specified, the model router will route to all available models - specified in the model-router version. - :vartype models: list[~azure.mgmt.cognitiveservices.models.DeploymentModel] - """ - - mode: Optional[Union[str, "_models.RoutingMode"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The model-router routing mode that determines how requests are distributed across models. Known - values are: \"cost\", \"balanced\", and \"quality\".""" - models: Optional[list["_models.DeploymentModel"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Optional. The list of model-router supported models that the model router can use to route - requests across. If not specified, the model router will route to all available models - specified in the model-router version.""" - - @overload - def __init__( - self, - *, - mode: Optional[Union[str, "_models.RoutingMode"]] = None, - models: Optional[list["_models.DeploymentModel"]] = 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 DeploymentScaleSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of Cognitive Services account deployment model. (Deprecated, please use - Deployment.sku instead.). - - :ivar scale_type: Deployment scale type. Known values are: "Standard" and "Manual". - :vartype scale_type: str or ~azure.mgmt.cognitiveservices.models.DeploymentScaleType - :ivar capacity: Deployment capacity. - :vartype capacity: int - :ivar active_capacity: Deployment active capacity. This value might be different from - ``capacity`` if customer recently updated ``capacity``. - :vartype active_capacity: int - """ - - scale_type: Optional[Union[str, "_models.DeploymentScaleType"]] = rest_field( - name="scaleType", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment scale type. Known values are: \"Standard\" and \"Manual\".""" - capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Deployment capacity.""" - active_capacity: Optional[int] = rest_field(name="activeCapacity", visibility=["read"]) - """Deployment active capacity. This value might be different from ``capacity`` if customer - recently updated ``capacity``.""" - - @overload - def __init__( - self, - *, - scale_type: Optional[Union[str, "_models.DeploymentScaleType"]] = None, - capacity: Optional[int] = 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 DeploymentSizeCapacity(_Model): - """Capacity information for a specific deployment size. - - :ivar model_instance_accelerator_count: The number of accelerators required per model instance. - :vartype model_instance_accelerator_count: int - :ivar total_available_capacity: The total available capacity for this deployment size. - :vartype total_available_capacity: int - :ivar largest_deployment_capacity: The largest contiguous deployment capacity available for - this deployment size. - :vartype largest_deployment_capacity: int - """ - - model_instance_accelerator_count: Optional[int] = rest_field( - name="modelInstanceAcceleratorCount", visibility=["read"] - ) - """The number of accelerators required per model instance.""" - total_available_capacity: Optional[int] = rest_field(name="totalAvailableCapacity", visibility=["read"]) - """The total available capacity for this deployment size.""" - largest_deployment_capacity: Optional[int] = rest_field(name="largestDeploymentCapacity", visibility=["read"]) - """The largest contiguous deployment capacity available for this deployment size.""" - - -class DeploymentSpeculativeDecoding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Speculative decoding settings for a deployment. - - :ivar draft_model: Draft model used to generate speculative decoding tokens. Required. - :vartype draft_model: ~azure.mgmt.cognitiveservices.models.DeploymentModel - :ivar draft_token_count: The number of draft tokens attempted per speculation step. - :vartype draft_token_count: int - """ - - draft_model: "_models.DeploymentModel" = rest_field( - name="draftModel", visibility=["read", "create", "update", "delete", "query"] - ) - """Draft model used to generate speculative decoding tokens. Required.""" - draft_token_count: Optional[int] = rest_field( - name="draftTokenCount", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of draft tokens attempted per speculation step.""" - - @overload - def __init__( - self, - *, - draft_model: "_models.DeploymentModel", - draft_token_count: Optional[int] = 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 DomainAvailability(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Domain availability. - - :ivar is_subdomain_available: Indicates the given SKU is available or not. - :vartype is_subdomain_available: bool - :ivar reason: Reason why the SKU is not available. - :vartype reason: str - :ivar subdomain_name: The subdomain name to use. - :vartype subdomain_name: str - :ivar type: The Type of the resource. - :vartype type: str - :ivar kind: The kind (type) of cognitive service account. - :vartype kind: str - """ - - is_subdomain_available: Optional[bool] = rest_field( - name="isSubdomainAvailable", visibility=["read", "create", "update", "delete", "query"] - ) - """Indicates the given SKU is available or not.""" - reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Reason why the SKU is not available.""" - subdomain_name: Optional[str] = rest_field( - name="subdomainName", visibility=["read", "create", "update", "delete", "query"] - ) - """The subdomain name to use.""" - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Type of the resource.""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kind (type) of cognitive service account.""" - - @overload - def __init__( - self, - *, - is_subdomain_available: Optional[bool] = None, - reason: Optional[str] = None, - subdomain_name: Optional[str] = None, - type: Optional[str] = None, - kind: 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 Encryption(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties to configure Encryption. - - :ivar key_vault_properties: Properties of KeyVault. - :vartype key_vault_properties: ~azure.mgmt.cognitiveservices.models.KeyVaultProperties - :ivar key_source: Enumerates the possible value of keySource for Encryption. Known values are: - "Microsoft.CognitiveServices" and "Microsoft.KeyVault". - :vartype key_source: str or ~azure.mgmt.cognitiveservices.models.KeySource - """ - - key_vault_properties: Optional["_models.KeyVaultProperties"] = rest_field( - name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of KeyVault.""" - key_source: Optional[Union[str, "_models.KeySource"]] = rest_field( - name="keySource", visibility=["read", "create", "update", "delete", "query"] - ) - """Enumerates the possible value of keySource for Encryption. Known values are: - \"Microsoft.CognitiveServices\" and \"Microsoft.KeyVault\".""" - - @overload - def __init__( - self, - *, - key_vault_properties: Optional["_models.KeyVaultProperties"] = None, - key_source: Optional[Union[str, "_models.KeySource"]] = 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 EncryptionScope(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services EncryptionScope. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of Cognitive Services EncryptionScope. - :vartype properties: ~azure.mgmt.cognitiveservices.models.EncryptionScopeProperties - :ivar etag: Resource Etag. - :vartype etag: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - properties: Optional["_models.EncryptionScopeProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of Cognitive Services EncryptionScope.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource Etag.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) - """Resource tags.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.EncryptionScopeProperties"] = None, - tags: Optional[dict[str, 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 EncryptionScopeProperties(Encryption): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties to EncryptionScope. - - :ivar key_vault_properties: Properties of KeyVault. - :vartype key_vault_properties: ~azure.mgmt.cognitiveservices.models.KeyVaultProperties - :ivar key_source: Enumerates the possible value of keySource for Encryption. Known values are: - "Microsoft.CognitiveServices" and "Microsoft.KeyVault". - :vartype key_source: str or ~azure.mgmt.cognitiveservices.models.KeySource - :ivar provisioning_state: Gets the status of the resource at the time the operation was called. - Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", "Succeeded", and - "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.EncryptionScopeProvisioningState - :ivar state: The encryptionScope state. Known values are: "Disabled" and "Enabled". - :vartype state: str or ~azure.mgmt.cognitiveservices.models.EncryptionScopeState - """ - - provisioning_state: Optional[Union[str, "_models.EncryptionScopeProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Gets the status of the resource at the time the operation was called. Known values are: - \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", and - \"Canceled\".""" - state: Optional[Union[str, "_models.EncryptionScopeState"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The encryptionScope state. Known values are: \"Disabled\" and \"Enabled\".""" - - @overload - def __init__( - self, - *, - key_vault_properties: Optional["_models.KeyVaultProperties"] = None, - key_source: Optional[Union[str, "_models.KeySource"]] = None, - state: Optional[Union[str, "_models.EncryptionScopeState"]] = 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 ErrorAdditionalInfo(_Model): - """The resource management error additional info. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - type: Optional[str] = rest_field(visibility=["read"]) - """The additional info type.""" - info: Optional[Any] = rest_field(visibility=["read"]) - """The additional info.""" - - -class ErrorDetail(_Model): - """The error detail. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.cognitiveservices.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.cognitiveservices.models.ErrorAdditionalInfo] - """ - - code: Optional[str] = rest_field(visibility=["read"]) - """The error code.""" - message: Optional[str] = rest_field(visibility=["read"]) - """The error message.""" - target: Optional[str] = rest_field(visibility=["read"]) - """The error target.""" - details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) - """The error details.""" - additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( - name="additionalInfo", visibility=["read"] - ) - """The error additional info.""" - - -class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Error response. - - :ivar error: The error object. - :vartype error: ~azure.mgmt.cognitiveservices.models.ErrorDetail - """ - - error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error object.""" - - @overload - def __init__( - self, - *, - error: Optional["_models.ErrorDetail"] = 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 EvaluateDeploymentPoliciesDeployment(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A hypothetical deployment definition used for policy dry-run evaluation. - - :ivar name: The name of the hypothetical deployment. Required. - :vartype name: str - :ivar properties: Properties of the hypothetical deployment. Required. - :vartype properties: - ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesDeploymentProperties - """ - - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the hypothetical deployment. Required.""" - properties: "_models.EvaluateDeploymentPoliciesDeploymentProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of the hypothetical deployment. Required.""" - - @overload - def __init__( - self, - *, - name: str, - properties: "_models.EvaluateDeploymentPoliciesDeploymentProperties", - ) -> 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 EvaluateDeploymentPoliciesDeploymentProperties( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Properties of a hypothetical deployment for policy evaluation. - - :ivar model: The model to evaluate. Required. - :vartype model: ~azure.mgmt.cognitiveservices.models.DeploymentModel - :ivar rai_policy_name: The name of the RAI policy to evaluate. - :vartype rai_policy_name: str - """ - - model: "_models.DeploymentModel" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model to evaluate. Required.""" - rai_policy_name: Optional[str] = rest_field( - name="raiPolicyName", visibility=["read", "create", "update", "delete", "query"] - ) - """The name of the RAI policy to evaluate.""" - - @overload - def __init__( - self, - *, - model: "_models.DeploymentModel", - rai_policy_name: 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 EvaluateDeploymentPoliciesRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Request body for the evaluateDeploymentPolicies action. - - :ivar deployments: The list of hypothetical deployments to evaluate against Azure Policy. - Required. - :vartype deployments: - list[~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesDeployment] - """ - - deployments: list["_models.EvaluateDeploymentPoliciesDeployment"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The list of hypothetical deployments to evaluate against Azure Policy. Required.""" - - @overload - def __init__( - self, - *, - deployments: list["_models.EvaluateDeploymentPoliciesDeployment"], - ) -> 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 EvaluateDeploymentPoliciesResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Response body for the evaluateDeploymentPolicies action. - - :ivar results: Per-deployment policy evaluation results, keyed by deployment name. - :vartype results: dict[str, - ~azure.mgmt.cognitiveservices.models.DeploymentPolicyEvaluationResult] - """ - - results: Optional[dict[str, "_models.DeploymentPolicyEvaluationResult"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Per-deployment policy evaluation results, keyed by deployment name.""" - - @overload - def __init__( - self, - *, - results: Optional[dict[str, "_models.DeploymentPolicyEvaluationResult"]] = 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 FoundryAutoUpgrade(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents the foundry auto-upgrade configuration for a Cognitive Services account. Customers - can opt out of auto-upgrade by setting mode to Disabled. - - :ivar mode: Gets or sets the auto-upgrade mode. Known values are: "Enabled" and "Disabled". - :vartype mode: str or ~azure.mgmt.cognitiveservices.models.FoundryAutoUpgradeMode - :ivar planned_by_microsoft: Gets or sets a value indicating whether the auto-upgrade is planned - by Microsoft. - :vartype planned_by_microsoft: bool - :ivar status_reason: Gets or sets the status reason for the auto-upgrade configuration. - :vartype status_reason: str - :ivar scheduled_at: Gets or sets the scheduled time for the auto-upgrade. - :vartype scheduled_at: ~datetime.datetime - """ - - mode: Optional[Union[str, "_models.FoundryAutoUpgradeMode"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the auto-upgrade mode. Known values are: \"Enabled\" and \"Disabled\".""" - planned_by_microsoft: Optional[bool] = rest_field( - name="plannedByMicrosoft", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets a value indicating whether the auto-upgrade is planned by Microsoft.""" - status_reason: Optional[str] = rest_field( - name="statusReason", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the status reason for the auto-upgrade configuration.""" - scheduled_at: Optional[datetime.datetime] = rest_field( - name="scheduledAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Gets or sets the scheduled time for the auto-upgrade.""" - - @overload - def __init__( - self, - *, - mode: Optional[Union[str, "_models.FoundryAutoUpgradeMode"]] = None, - planned_by_microsoft: Optional[bool] = None, - status_reason: Optional[str] = None, - scheduled_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 OutboundRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Outbound Rule for the managed network of a cognitive services account. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule - - :ivar category: Category of a managed network Outbound Rule of a cognitive services account. - Known values are: "Required", "Recommended", "UserDefined", and "Dependency". - :vartype category: str or ~azure.mgmt.cognitiveservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a cognitive services account. Known - values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". - :vartype status: str or ~azure.mgmt.cognitiveservices.models.RuleStatus - :ivar type: Type of a managed network Outbound Rule of a cognitive services account. Required. - Known values are: "FQDN", "PrivateEndpoint", and "ServiceTag". - :vartype type: str or ~azure.mgmt.cognitiveservices.models.RuleType - :ivar error_information: Error information about an outbound rule of a cognitive services - account if RuleStatus is failed. - :vartype error_information: str - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - """ - - __mapping__: dict[str, _Model] = {} - category: Optional[Union[str, "_models.RuleCategory"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Category of a managed network Outbound Rule of a cognitive services account. Known values are: - \"Required\", \"Recommended\", \"UserDefined\", and \"Dependency\".""" - status: Optional[Union[str, "_models.RuleStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of a managed network Outbound Rule of a cognitive services account. Known values are: - \"Inactive\", \"Active\", \"Provisioning\", \"Deleting\", and \"Failed\".""" - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Type of a managed network Outbound Rule of a cognitive services account. Required. Known values - are: \"FQDN\", \"PrivateEndpoint\", and \"ServiceTag\".""" - error_information: Optional[str] = rest_field(name="errorInformation", visibility=["read"]) - """Error information about an outbound rule of a cognitive services account if RuleStatus is - failed.""" - parent_rule_names: Optional[list[str]] = rest_field(name="parentRuleNames", visibility=["read"]) - - @overload - def __init__( - self, - *, - type: str, - category: Optional[Union[str, "_models.RuleCategory"]] = None, - status: Optional[Union[str, "_models.RuleStatus"]] = 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 FqdnOutboundRule( - OutboundRule, discriminator="FQDN" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """FQDN Outbound Rule for the managed network of a cognitive services account. - - :ivar category: Category of a managed network Outbound Rule of a cognitive services account. - Known values are: "Required", "Recommended", "UserDefined", and "Dependency". - :vartype category: str or ~azure.mgmt.cognitiveservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a cognitive services account. Known - values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". - :vartype status: str or ~azure.mgmt.cognitiveservices.models.RuleStatus - :ivar error_information: Error information about an outbound rule of a cognitive services - account if RuleStatus is failed. - :vartype error_information: str - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar destination: - :vartype destination: str - :ivar type: Type of a managed network Outbound Rule of a cognitive services account. Required. - FQDN. - :vartype type: str or ~azure.mgmt.cognitiveservices.models.FQDN - """ - - destination: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Literal[RuleType.FQDN] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of a managed network Outbound Rule of a cognitive services account. Required. FQDN.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.RuleCategory"]] = None, - status: Optional[Union[str, "_models.RuleStatus"]] = None, - destination: 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.type = RuleType.FQDN # type: ignore - - -class GatedModelAccessProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Gated model access configuration for a managed compute deployment. - - :ivar connection_id: The fully qualified Azure resource ID of the project connection used to - authorize access to a gated model during deployment creation. Required. - :vartype connection_id: str - """ - - connection_id: str = rest_field(name="connectionId", visibility=["read", "create", "update", "delete", "query"]) - """The fully qualified Azure resource ID of the project connection used to authorize access to a - gated model during deployment creation. Required.""" - - @overload - def __init__( - self, - *, - connection_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 HostedAgentDeployment( - AgentDeploymentProperties, discriminator="Hosted" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a hosted agent deployment where the underlying infrastructure is owned by the - platform. - - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar display_name: Gets or sets the display name of the deployment. - :vartype display_name: str - :ivar deployment_id: Gets or sets the unique identifier of the deployment. - :vartype deployment_id: str - :ivar state: Gets or sets the current operational state of the deployment (and, intrinsically, - of the comprising agents). Known values are: "Starting", "Running", "Stopping", "Stopped", - "Failed", "Deleting", "Deleted", and "Updating". - :vartype state: str or ~azure.mgmt.cognitiveservices.models.AgentDeploymentState - :ivar protocols: Gets or sets the supported protocol types and versions exposed by this - deployment. - :vartype protocols: list[~azure.mgmt.cognitiveservices.models.AgentProtocolVersion] - :ivar agents: Returns a flat list of agent:version deployed in this deployment. - :vartype agents: list[~azure.mgmt.cognitiveservices.models.VersionedAgentReference] - :ivar provisioning_state: Gets or sets the provisioning state of the agent deployment. Known - values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.AgentDeploymentProvisioningState - :ivar min_replicas: Gets or sets the minimum number of replicas for this hosted deployment. - :vartype min_replicas: int - :ivar max_replicas: Gets or sets the maximum number of replicas for this hosted deployment. - :vartype max_replicas: int - :ivar deployment_type: Gets or sets the type of deployment for the agent. Required. The - underlying infra is owned by the platform. - :vartype deployment_type: str or ~azure.mgmt.cognitiveservices.models.HOSTED - """ - - min_replicas: Optional[int] = rest_field( - name="minReplicas", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the minimum number of replicas for this hosted deployment.""" - max_replicas: Optional[int] = rest_field( - name="maxReplicas", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets or sets the maximum number of replicas for this hosted deployment.""" - deployment_type: Literal[AgentDeploymentType.HOSTED] = rest_discriminator(name="deploymentType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Gets or sets the type of deployment for the agent. Required. The underlying infra is owned by - the platform.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - display_name: Optional[str] = None, - deployment_id: Optional[str] = None, - state: Optional[Union[str, "_models.AgentDeploymentState"]] = None, - protocols: Optional[list["_models.AgentProtocolVersion"]] = None, - agents: Optional[list["_models.VersionedAgentReference"]] = None, - min_replicas: Optional[int] = None, - max_replicas: Optional[int] = 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.deployment_type = AgentDeploymentType.HOSTED # type: ignore - - -class Identity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Identity for the resource. - - :ivar type: The identity type. Known values are: "None", "SystemAssigned", "UserAssigned", and - "SystemAssigned, UserAssigned". - :vartype type: str or ~azure.mgmt.cognitiveservices.models.ResourceIdentityType - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar user_assigned_identities: The list of user assigned identities associated with the - resource. The user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.cognitiveservices.models.UserAssignedIdentity] - """ - - type: Optional[Union[str, "_models.ResourceIdentityType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The identity type. Known values are: \"None\", \"SystemAssigned\", \"UserAssigned\", and - \"SystemAssigned, UserAssigned\".""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) - """The tenant ID of resource.""" - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The principal ID of resource identity.""" - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( - name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of user assigned identities associated with the resource. The user identity dictionary - key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.""" - - @overload - def __init__( - self, - *, - type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, - user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = 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 IpRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A rule governing the accessibility from a specific ip address or ip range. - - :ivar value: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) - or '124.56.78.0/24' (all addresses that start with 124.56.78). Required. - :vartype value: str - """ - - value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or - '124.56.78.0/24' (all addresses that start with 124.56.78). Required.""" - - @overload - def __init__( - self, - *, - value: 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 KeyVaultProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties to configure keyVault Properties. - - :ivar key_name: Name of the Key from KeyVault. - :vartype key_name: str - :ivar key_version: Version of the Key from KeyVault. - :vartype key_version: str - :ivar key_vault_uri: Uri of KeyVault. - :vartype key_vault_uri: str - :ivar identity_client_id: - :vartype identity_client_id: str - """ - - key_name: Optional[str] = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"]) - """Name of the Key from KeyVault.""" - key_version: Optional[str] = rest_field( - name="keyVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Version of the Key from KeyVault.""" - key_vault_uri: Optional[str] = rest_field( - name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"] - ) - """Uri of KeyVault.""" - identity_client_id: Optional[str] = rest_field( - name="identityClientId", visibility=["read", "create", "update", "delete", "query"] - ) - - @overload - def __init__( - self, - *, - key_name: Optional[str] = None, - key_version: Optional[str] = None, - key_vault_uri: Optional[str] = None, - identity_client_id: 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 ManagedAgentDeployment( - AgentDeploymentProperties, discriminator="Managed" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Represents a managed agent deployment where the underlying infrastructure is managed by the - platform in the deployer's subscription. - - :ivar description: The asset description text. - :vartype description: str - :ivar tags: Tag dictionary. Tags can be added, removed, and updated. - :vartype tags: dict[str, str] - :ivar display_name: Gets or sets the display name of the deployment. - :vartype display_name: str - :ivar deployment_id: Gets or sets the unique identifier of the deployment. - :vartype deployment_id: str - :ivar state: Gets or sets the current operational state of the deployment (and, intrinsically, - of the comprising agents). Known values are: "Starting", "Running", "Stopping", "Stopped", - "Failed", "Deleting", "Deleted", and "Updating". - :vartype state: str or ~azure.mgmt.cognitiveservices.models.AgentDeploymentState - :ivar protocols: Gets or sets the supported protocol types and versions exposed by this - deployment. - :vartype protocols: list[~azure.mgmt.cognitiveservices.models.AgentProtocolVersion] - :ivar agents: Returns a flat list of agent:version deployed in this deployment. - :vartype agents: list[~azure.mgmt.cognitiveservices.models.VersionedAgentReference] - :ivar provisioning_state: Gets or sets the provisioning state of the agent deployment. Known - values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.AgentDeploymentProvisioningState - :ivar deployment_type: Gets or sets the type of deployment for the agent. Required. The - underlying infra is managed by the platform in the deployer's subscription. - :vartype deployment_type: str or ~azure.mgmt.cognitiveservices.models.MANAGED - """ - - deployment_type: Literal[AgentDeploymentType.MANAGED] = rest_discriminator(name="deploymentType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Gets or sets the type of deployment for the agent. Required. The underlying infra is managed by - the platform in the deployer's subscription.""" - - @overload - def __init__( - self, - *, - description: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - display_name: Optional[str] = None, - deployment_id: Optional[str] = None, - state: Optional[Union[str, "_models.AgentDeploymentState"]] = None, - protocols: Optional[list["_models.AgentProtocolVersion"]] = None, - agents: Optional[list["_models.VersionedAgentReference"]] = 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.deployment_type = AgentDeploymentType.MANAGED # type: ignore - - -class ManagedClusterAgentHostingConfiguration( - AgentHostingConfiguration, discriminator="ManagedCluster" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """Configuration for hosting Foundry agents on an Azure Kubernetes Service managed cluster. - - :ivar name: Unique name of the hosting configuration within the Foundry account. Required. - :vartype name: str - :ivar hosting_type: Type of infrastructure used to host Foundry agents. Required. Agents are - hosted on an Azure Kubernetes Service managed cluster. - :vartype hosting_type: str or ~azure.mgmt.cognitiveservices.models.MANAGED_CLUSTER - :ivar hosting_management_identity_resource_id: Azure resource ID of the user-assigned managed - identity used by the Foundry resource provider to manage the hosting configuration. The - identity must be assigned to the Foundry account in identity.userAssignedIdentities. Required. - :vartype hosting_management_identity_resource_id: str - :ivar workload_identity_resource_id: Azure resource ID of the separate user-assigned managed - identity federated to service accounts on the AKS cluster. Hosted agents use this identity to - access the Azure Storage blob data plane. Required. - :vartype workload_identity_resource_id: str - :ivar cluster_resource_id: Azure resource ID of the customer-owned AKS managed cluster that - runs the hosted agent workloads. Required. - :vartype cluster_resource_id: str - :ivar storage_account_resource_id: Azure resource ID of the customer-owned storage account used - by the hosted agents. The storage account must be in the same subscription and region as the - AKS cluster, and its data-plane endpoint must be reachable from the workload network. Required. - :vartype storage_account_resource_id: str - """ - - hosting_type: Literal[AgentHostingType.MANAGED_CLUSTER] = rest_discriminator(name="hostingType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of infrastructure used to host Foundry agents. Required. Agents are hosted on an Azure - Kubernetes Service managed cluster.""" - hosting_management_identity_resource_id: str = rest_field( - name="hostingManagementIdentityResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure resource ID of the user-assigned managed identity used by the Foundry resource provider - to manage the hosting configuration. The identity must be assigned to the Foundry account in - identity.userAssignedIdentities. Required.""" - workload_identity_resource_id: str = rest_field( - name="workloadIdentityResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure resource ID of the separate user-assigned managed identity federated to service accounts - on the AKS cluster. Hosted agents use this identity to access the Azure Storage blob data - plane. Required.""" - cluster_resource_id: str = rest_field( - name="clusterResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure resource ID of the customer-owned AKS managed cluster that runs the hosted agent - workloads. Required.""" - storage_account_resource_id: str = rest_field( - name="storageAccountResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Azure resource ID of the customer-owned storage account used by the hosted agents. The storage - account must be in the same subscription and region as the AKS cluster, and its data-plane - endpoint must be reachable from the workload network. Required.""" - - @overload - def __init__( - self, - *, - name: str, - hosting_management_identity_resource_id: str, - workload_identity_resource_id: str, - cluster_resource_id: str, - storage_account_resource_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) - self.hosting_type = AgentHostingType.MANAGED_CLUSTER # type: ignore - - -class ManagedComputeCapacity(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Managed compute capacity information for Cognitive Services managed compute deployments. - Provides available accelerator capacity per type and region at the subscription level. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of the managed compute capacity resource. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ManagedComputeCapacityProperties + :ivar provisioning_state: Gets the status of the resource at the time the operation was called. + Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", "Succeeded", + "Disabled", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.DeploymentProvisioningState + :ivar model: Properties of Cognitive Services account deployment model. + :vartype model: ~azure.mgmt.cognitiveservices.models.DeploymentModel + :ivar context_cache_container_id: The resource ID of the context cache container associated + with this deployment. + :vartype context_cache_container_id: str + :ivar scale_settings: Properties of Cognitive Services account deployment model. (Deprecated, + please use Deployment.sku instead.). + :vartype scale_settings: ~azure.mgmt.cognitiveservices.models.DeploymentScaleSettings + :ivar capabilities: The capabilities. + :vartype capabilities: dict[str, str] + :ivar rai_policy_name: The name of RAI policy. + :vartype rai_policy_name: str + :ivar call_rate_limit: The call rate limit Cognitive Services account. + :vartype call_rate_limit: ~azure.mgmt.cognitiveservices.models.CallRateLimit + :ivar rate_limits: + :vartype rate_limits: list[~azure.mgmt.cognitiveservices.models.ThrottlingRule] + :ivar version_upgrade_option: Deployment model version upgrade option. Known values are: + "OnceNewDefaultVersionAvailable", "OnceCurrentVersionExpired", and "NoAutoUpgrade". + :vartype version_upgrade_option: str or + ~azure.mgmt.cognitiveservices.models.DeploymentModelVersionUpgradeOption + :ivar dynamic_throttling_enabled: If the dynamic throttling is enabled. + :vartype dynamic_throttling_enabled: bool + :ivar current_capacity: The current capacity. + :vartype current_capacity: int + :ivar capacity_settings: Internal use only. + :vartype capacity_settings: ~azure.mgmt.cognitiveservices.models.DeploymentCapacitySettings + :ivar parent_deployment_name: The name of parent deployment. + :vartype parent_deployment_name: str + :ivar spillover_deployment_name: Specifies the deployment name that should serve requests when + the request would have otherwise been throttled due to reaching current deployment throughput + limit. + :vartype spillover_deployment_name: str + :ivar service_tier: The service tier for the deployment. Determines the pricing and performance + level for request processing. Use 'Default' for standard pricing or 'Priority' for + higher-priority processing with premium pricing. Note: Pause operations are only supported on + Standard, DataZoneStandard, and GlobalStandard SKUs. Known values are: "Default" and + "Priority". + :vartype service_tier: str or ~azure.mgmt.cognitiveservices.models.ServiceTier + :ivar deployment_state: The state of the deployment. Controls whether the deployment is + accepting inference requests. Use 'Running' for active deployments that process requests, or + 'Paused' to temporarily stop inference while preserving the deployment configuration. Known + values are: "Running" and "Paused". + :vartype deployment_state: str or ~azure.mgmt.cognitiveservices.models.DeploymentState + :ivar routing: Routing configuration for the model-router deployment. This property is only + applicable when the deployed model is 'model-router' version 2025-11-18 or later. Allows you to + select the models subset for routing and the routing mode (balanced, quality, cost) for routing + across all supported models or the model subset. + :vartype routing: ~azure.mgmt.cognitiveservices.models.DeploymentRouting """ - properties: Optional["_models.ManagedComputeCapacityProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + provisioning_state: Optional[Union[str, "_models.DeploymentProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] ) - """Properties of the managed compute capacity resource.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.ManagedComputeCapacityProperties"] = 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 ManagedComputeCapacityProperties(_Model): - """Properties of a managed compute capacity resource. - - :ivar accelerator_type: The type of accelerator (e.g., Azure.A100, Azure.H100). - :vartype accelerator_type: str - :ivar available_accelerators: The number of available accelerators in the region. - :vartype available_accelerators: int - :ivar deployment_size_capacities: Capacity information broken down by deployment size. - :vartype deployment_size_capacities: - list[~azure.mgmt.cognitiveservices.models.DeploymentSizeCapacity] - """ - - accelerator_type: Optional[str] = rest_field(name="acceleratorType", visibility=["read"]) - """The type of accelerator (e.g., Azure.A100, Azure.H100).""" - available_accelerators: Optional[int] = rest_field(name="availableAccelerators", visibility=["read"]) - """The number of available accelerators in the region.""" - deployment_size_capacities: Optional[list["_models.DeploymentSizeCapacity"]] = rest_field( - name="deploymentSizeCapacities", visibility=["read"] + """Gets the status of the resource at the time the operation was called. Known values are: + \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", \"Disabled\", + and \"Canceled\".""" + model: Optional["_models.DeploymentModel"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Properties of Cognitive Services account deployment model.""" + context_cache_container_id: Optional[str] = rest_field( + name="contextCacheContainerId", visibility=["read", "create", "update", "delete", "query"] ) - """Capacity information broken down by deployment size.""" - - -class ManagedComputeDeployment(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services account managed compute deployment, backed by managed compute (GPU) - resources. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of the Cognitive Services managed compute deployment. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentProperties - :ivar sku: The resource model definition representing SKU. - :vartype sku: ~azure.mgmt.cognitiveservices.models.Sku - :ivar etag: Resource Etag. - :vartype etag: str - """ - - properties: Optional["_models.ManagedComputeDeploymentProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """The resource ID of the context cache container associated with this deployment.""" + scale_settings: Optional["_models.DeploymentScaleSettings"] = rest_field( + name="scaleSettings", visibility=["read", "create", "update", "delete", "query"] ) - """Properties of the Cognitive Services managed compute deployment.""" - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource model definition representing SKU.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource Etag.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.ManagedComputeDeploymentProperties"] = None, - sku: Optional["_models.Sku"] = 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 ManagedComputeDeploymentInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Deployment detail within a managed compute usage entry. - - :ivar deployment_id: Full ARM resource ID of the deployment. - :vartype deployment_id: str - :ivar project_id: Full ARM resource ID of the account/project. - :vartype project_id: str - :ivar model_id: Model name (e.g., 'azureml://registries//models//versions/gpt-4o'). - :vartype model_id: str - :ivar accelerator_count: Number of GPUs consumed by this deployment. - :vartype accelerator_count: int - :ivar instance_count: Number of instances for this deployment. - :vartype instance_count: int - """ - - deployment_id: Optional[str] = rest_field( - name="deploymentId", visibility=["read", "create", "update", "delete", "query"] + """Properties of Cognitive Services account deployment model. (Deprecated, please use + Deployment.sku instead.).""" + capabilities: Optional[dict[str, str]] = rest_field(visibility=["read"]) + """The capabilities.""" + rai_policy_name: Optional[str] = rest_field( + name="raiPolicyName", visibility=["read", "create", "update", "delete", "query"] ) - """Full ARM resource ID of the deployment.""" - project_id: Optional[str] = rest_field(name="projectId", visibility=["read", "create", "update", "delete", "query"]) - """Full ARM resource ID of the account/project.""" - model_id: Optional[str] = rest_field(name="modelId", visibility=["read", "create", "update", "delete", "query"]) - """Model name (e.g., 'azureml://registries//models//versions/gpt-4o').""" - accelerator_count: Optional[int] = rest_field( - name="acceleratorCount", visibility=["read", "create", "update", "delete", "query"] + """The name of RAI policy.""" + call_rate_limit: Optional["_models.CallRateLimit"] = rest_field(name="callRateLimit", visibility=["read"]) + """The call rate limit Cognitive Services account.""" + rate_limits: Optional[list["_models.ThrottlingRule"]] = rest_field(name="rateLimits", visibility=["read"]) + version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = rest_field( + name="versionUpgradeOption", visibility=["read", "create", "update", "delete", "query"] ) - """Number of GPUs consumed by this deployment.""" - instance_count: Optional[int] = rest_field( - name="instanceCount", visibility=["read", "create", "update", "delete", "query"] + """Deployment model version upgrade option. Known values are: \"OnceNewDefaultVersionAvailable\", + \"OnceCurrentVersionExpired\", and \"NoAutoUpgrade\".""" + dynamic_throttling_enabled: Optional[bool] = rest_field(name="dynamicThrottlingEnabled", visibility=["read"]) + """If the dynamic throttling is enabled.""" + current_capacity: Optional[int] = rest_field( + name="currentCapacity", visibility=["read", "create", "update", "delete", "query"] ) - """Number of instances for this deployment.""" - - @overload - def __init__( - self, - *, - deployment_id: Optional[str] = None, - project_id: Optional[str] = None, - model_id: Optional[str] = None, - accelerator_count: Optional[int] = None, - instance_count: Optional[int] = 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 ManagedComputeDeploymentProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a Cognitive Services managed compute deployment. - - :ivar model: AzureML Registry model asset URI. Required on creation; immutable after creation. - Example: azureml://registries/{registry}/models/{model}/versions/{version}. Required. - :vartype model: str - :ivar deployment_template: Deployment template identifier. Optional on creation. Accepts an - AzureML Registry deployment template URI or a project-scoped deployment template path for - VmManagedCompute. Examples: - azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}, - projects/{project}/deploymentTemplates/{template}/versions/{version}. - :vartype deployment_template: str - :ivar accelerator_type: Accelerator type (e.g., H100_80GB). Optional on creation; immutable - after creation. - :vartype accelerator_type: str - :ivar version_upgrade_option: Template auto-upgrade policy. Defaults to - OnceNewDefaultVersionAvailable. Known values are: "OnceNewDefaultVersionAvailable", - "OnceCurrentVersionExpired", and "NoAutoUpgrade". - :vartype version_upgrade_option: str or - ~azure.mgmt.cognitiveservices.models.DeploymentModelVersionUpgradeOption - :ivar gated_model_access: Configuration used to authorize access to a gated model during - deployment creation. - :vartype gated_model_access: ~azure.mgmt.cognitiveservices.models.GatedModelAccessProperties - :ivar capabilities: Deployment capabilities represented as key-value pairs. Example: { - assetsV2: "true" }. - :vartype capabilities: dict[str, str] - :ivar compute_id: Foundry compute ARM resource ID for VM-backed managed compute deployments. - Required when sku.name is VmManagedCompute; immutable after creation. - :vartype compute_id: str - :ivar priority: Scheduling priority for VM-backed managed compute deployments. Immutable after - creation. - :vartype priority: str - :ivar accelerators_per_instance: Read-only. Number of accelerators (GPUs) consumed by each - model instance, sourced from the deployment template. - :vartype accelerators_per_instance: int - :ivar total_accelerators: Read-only. Total accelerators allocated: sku.capacity (instances) x - acceleratorsPerInstance. - :vartype total_accelerators: int - :ivar provisioning_state: Read-only. Current provisioning state. Known values are: "Accepted", - "Creating", "Deleting", "Moving", "Failed", "Succeeded", "Canceled", "ResolvingDNS", and - "ExtensionUnreachable". - :vartype provisioning_state: str or ~azure.mgmt.cognitiveservices.models.ProvisioningState - :ivar provisioning_details: Read-only. Status message and timestamp from the last provisioning - operation. - :vartype provisioning_details: - ~azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentProvisioningDetails - :ivar routes: Read-only. Inference route paths relative to the account endpoint. Populated when - provisioningState is Succeeded. - :vartype routes: ~azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentRoutes - """ - - model: str = rest_field(visibility=["read", "create"]) - """AzureML Registry model asset URI. Required on creation; immutable after creation. Example: - azureml://registries/{registry}/models/{model}/versions/{version}. Required.""" - deployment_template: Optional[str] = rest_field(name="deploymentTemplate", visibility=["read", "create"]) - """Deployment template identifier. Optional on creation. Accepts an AzureML Registry deployment - template URI or a project-scoped deployment template path for VmManagedCompute. Examples: - azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}, - projects/{project}/deploymentTemplates/{template}/versions/{version}.""" - accelerator_type: Optional[str] = rest_field(name="acceleratorType", visibility=["read", "create"]) - """Accelerator type (e.g., H100_80GB). Optional on creation; immutable after creation.""" - version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = rest_field( - name="versionUpgradeOption", visibility=["read", "create"] + """The current capacity.""" + capacity_settings: Optional["_models.DeploymentCapacitySettings"] = rest_field( + name="capacitySettings", visibility=["read", "create", "update", "delete", "query"] ) - """Template auto-upgrade policy. Defaults to OnceNewDefaultVersionAvailable. Known values are: - \"OnceNewDefaultVersionAvailable\", \"OnceCurrentVersionExpired\", and \"NoAutoUpgrade\".""" - gated_model_access: Optional["_models.GatedModelAccessProperties"] = rest_field( - name="gatedModelAccess", visibility=["read", "create"] + """Internal use only.""" + parent_deployment_name: Optional[str] = rest_field( + name="parentDeploymentName", visibility=["read", "create", "update", "delete", "query"] ) - """Configuration used to authorize access to a gated model during deployment creation.""" - capabilities: Optional[dict[str, str]] = rest_field(visibility=["read"]) - """Deployment capabilities represented as key-value pairs. Example: { assetsV2: \"true\" }.""" - compute_id: Optional[str] = rest_field(name="computeId", visibility=["read", "create"]) - """Foundry compute ARM resource ID for VM-backed managed compute deployments. Required when - sku.name is VmManagedCompute; immutable after creation.""" - priority: Optional[str] = rest_field(visibility=["read", "create"]) - """Scheduling priority for VM-backed managed compute deployments. Immutable after creation.""" - accelerators_per_instance: Optional[int] = rest_field(name="acceleratorsPerInstance", visibility=["read"]) - """Read-only. Number of accelerators (GPUs) consumed by each model instance, sourced from the - deployment template.""" - total_accelerators: Optional[int] = rest_field(name="totalAccelerators", visibility=["read"]) - """Read-only. Total accelerators allocated: sku.capacity (instances) x acceleratorsPerInstance.""" - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] + """The name of parent deployment.""" + spillover_deployment_name: Optional[str] = rest_field( + name="spilloverDeploymentName", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the deployment name that should serve requests when the request would have otherwise + been throttled due to reaching current deployment throughput limit.""" + service_tier: Optional[Union[str, "_models.ServiceTier"]] = rest_field( + name="serviceTier", visibility=["read", "create", "update", "delete", "query"] ) - """Read-only. Current provisioning state. Known values are: \"Accepted\", \"Creating\", - \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", \"Canceled\", \"ResolvingDNS\", and - \"ExtensionUnreachable\".""" - provisioning_details: Optional["_models.ManagedComputeDeploymentProvisioningDetails"] = rest_field( - name="provisioningDetails", visibility=["read"] + """The service tier for the deployment. Determines the pricing and performance level for request + processing. Use 'Default' for standard pricing or 'Priority' for higher-priority processing + with premium pricing. Note: Pause operations are only supported on Standard, DataZoneStandard, + and GlobalStandard SKUs. Known values are: \"Default\" and \"Priority\".""" + deployment_state: Optional[Union[str, "_models.DeploymentState"]] = rest_field( + name="deploymentState", visibility=["read", "create", "update", "delete", "query"] ) - """Read-only. Status message and timestamp from the last provisioning operation.""" - routes: Optional["_models.ManagedComputeDeploymentRoutes"] = rest_field(visibility=["read"]) - """Read-only. Inference route paths relative to the account endpoint. Populated when - provisioningState is Succeeded.""" - - @overload - def __init__( - self, - *, - model: str, - deployment_template: Optional[str] = None, - accelerator_type: Optional[str] = None, - version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = None, - gated_model_access: Optional["_models.GatedModelAccessProperties"] = None, - compute_id: Optional[str] = None, - priority: 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 ManagedComputeDeploymentProvisioningDetails( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Provisioning status details for a managed compute deployment. - - :ivar message: A human-readable status message from the last provisioning operation. - :vartype message: str - :ivar last_operation_timestamp: Timestamp of the last provisioning operation. - :vartype last_operation_timestamp: ~datetime.datetime - """ - - message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable status message from the last provisioning operation.""" - last_operation_timestamp: Optional[datetime.datetime] = rest_field( - name="lastOperationTimestamp", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + """The state of the deployment. Controls whether the deployment is accepting inference requests. + Use 'Running' for active deployments that process requests, or 'Paused' to temporarily stop + inference while preserving the deployment configuration. Known values are: \"Running\" and + \"Paused\".""" + routing: Optional["_models.DeploymentRouting"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Timestamp of the last provisioning operation.""" + """Routing configuration for the model-router deployment. This property is only applicable when + the deployed model is 'model-router' version 2025-11-18 or later. Allows you to select the + models subset for routing and the routing mode (balanced, quality, cost) for routing across all + supported models or the model subset.""" @overload def __init__( self, *, - message: Optional[str] = None, - last_operation_timestamp: Optional[datetime.datetime] = None, + model: Optional["_models.DeploymentModel"] = None, + context_cache_container_id: Optional[str] = None, + scale_settings: Optional["_models.DeploymentScaleSettings"] = None, + rai_policy_name: Optional[str] = None, + version_upgrade_option: Optional[Union[str, "_models.DeploymentModelVersionUpgradeOption"]] = None, + current_capacity: Optional[int] = None, + capacity_settings: Optional["_models.DeploymentCapacitySettings"] = None, + parent_deployment_name: Optional[str] = None, + spillover_deployment_name: Optional[str] = None, + service_tier: Optional[Union[str, "_models.ServiceTier"]] = None, + deployment_state: Optional[Union[str, "_models.DeploymentState"]] = None, + routing: Optional["_models.DeploymentRouting"] = None, ) -> None: ... @overload @@ -7015,36 +3897,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedComputeDeploymentRoutes(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Inference route paths for a managed compute deployment, relative to the account endpoint. - Populated when provisioningState is Succeeded. +class DeploymentRouting(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Routing configuration for the model-router deployment. Specifies how requests are routed across + multiple models. - :ivar chat_completions_scoring_path: Relative path to the chat completions scoring endpoint. - :vartype chat_completions_scoring_path: str - :ivar swagger: Relative path to the Swagger/OpenAPI endpoint. - :vartype swagger: str - :ivar messages_api_scoring_path: Relative path to the messages API scoring endpoint. - :vartype messages_api_scoring_path: str + :ivar mode: The model-router routing mode that determines how requests are distributed across + models. Known values are: "cost", "balanced", and "quality". + :vartype mode: str or ~azure.mgmt.cognitiveservices.models.RoutingMode + :ivar models: Optional. The list of model-router supported models that the model router can use + to route requests across. If not specified, the model router will route to all available models + specified in the model-router version. + :vartype models: list[~azure.mgmt.cognitiveservices.models.DeploymentModel] """ - chat_completions_scoring_path: Optional[str] = rest_field( - name="chatCompletionsScoringPath", visibility=["read", "create", "update", "delete", "query"] + mode: Optional[Union[str, "_models.RoutingMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Relative path to the chat completions scoring endpoint.""" - swagger: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Relative path to the Swagger/OpenAPI endpoint.""" - messages_api_scoring_path: Optional[str] = rest_field( - name="messagesApiScoringPath", visibility=["read", "create", "update", "delete", "query"] + """The model-router routing mode that determines how requests are distributed across models. Known + values are: \"cost\", \"balanced\", and \"quality\".""" + models: Optional[list["_models.DeploymentModel"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Relative path to the messages API scoring endpoint.""" + """Optional. The list of model-router supported models that the model router can use to route + requests across. If not specified, the model router will route to all available models + specified in the model-router version.""" @overload def __init__( self, *, - chat_completions_scoring_path: Optional[str] = None, - swagger: Optional[str] = None, - messages_api_scoring_path: Optional[str] = None, + mode: Optional[Union[str, "_models.RoutingMode"]] = None, + models: Optional[list["_models.DeploymentModel"]] = None, ) -> None: ... @overload @@ -7058,63 +3941,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedComputeUsage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Managed compute quota usage for a specific SKU. +class DeploymentScaleSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of Cognitive Services account deployment model. (Deprecated, please use + Deployment.sku instead.). - :ivar id: Fully qualified resource ID for the managed compute usage. - :vartype id: str - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.cognitiveservices.models.MetricName - :ivar type: The resource type. - :vartype type: str - :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", - "CountPerSecond", "BytesPerSecond", and "Milliseconds". - :vartype unit: str or ~azure.mgmt.cognitiveservices.models.UnitType - :ivar limit: Maximum value for this metric. - :vartype limit: float - :ivar current_value: Current value for this metric. - :vartype current_value: float - :ivar offer_scope: Offer scope (e.g., 'Global', 'Datazone-US'). - :vartype offer_scope: str - :ivar deployments: Deployments consuming this managed compute quota. - :vartype deployments: list[~azure.mgmt.cognitiveservices.models.ManagedComputeDeploymentInfo] + :ivar scale_type: Deployment scale type. Known values are: "Standard" and "Manual". + :vartype scale_type: str or ~azure.mgmt.cognitiveservices.models.DeploymentScaleType + :ivar capacity: Deployment capacity. + :vartype capacity: int + :ivar active_capacity: Deployment active capacity. This value might be different from + ``capacity`` if customer recently updated ``capacity``. + :vartype active_capacity: int """ - id: Optional[str] = rest_field(visibility=["read"]) - """Fully qualified resource ID for the managed compute usage.""" - name: Optional["_models.MetricName"] = rest_field(visibility=["read"]) - """The name information for the metric.""" - type: Optional[str] = rest_field(visibility=["read"]) - """The resource type.""" - unit: Optional[Union[str, "_models.UnitType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The unit of the metric. Known values are: \"Count\", \"Bytes\", \"Seconds\", \"Percent\", - \"CountPerSecond\", \"BytesPerSecond\", and \"Milliseconds\".""" - limit: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum value for this metric.""" - current_value: Optional[float] = rest_field( - name="currentValue", visibility=["read", "create", "update", "delete", "query"] - ) - """Current value for this metric.""" - offer_scope: Optional[str] = rest_field( - name="offerScope", visibility=["read", "create", "update", "delete", "query"] - ) - """Offer scope (e.g., 'Global', 'Datazone-US').""" - deployments: Optional[list["_models.ManagedComputeDeploymentInfo"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + scale_type: Optional[Union[str, "_models.DeploymentScaleType"]] = rest_field( + name="scaleType", visibility=["read", "create", "update", "delete", "query"] ) - """Deployments consuming this managed compute quota.""" + """Deployment scale type. Known values are: \"Standard\" and \"Manual\".""" + capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Deployment capacity.""" + active_capacity: Optional[int] = rest_field(name="activeCapacity", visibility=["read"]) + """Deployment active capacity. This value might be different from ``capacity`` if customer + recently updated ``capacity``.""" @overload def __init__( self, *, - unit: Optional[Union[str, "_models.UnitType"]] = None, - limit: Optional[float] = None, - current_value: Optional[float] = None, - offer_scope: Optional[str] = None, - deployments: Optional[list["_models.ManagedComputeDeploymentInfo"]] = None, + scale_type: Optional[Union[str, "_models.DeploymentScaleType"]] = None, + capacity: Optional[int] = None, ) -> None: ... @overload @@ -7128,124 +3983,67 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedIdentityAuthTypeConnectionProperties( - ConnectionPropertiesV2, discriminator="ManagedIdentity" -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """ManagedIdentityAuthTypeConnectionProperties. +class DeploymentSizeCapacity(_Model): + """Capacity information for a specific deployment size. - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or ~azure.mgmt.cognitiveservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: Provides the error message if the connection fails. - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.mgmt.cognitiveservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Specifies how private endpoints are used with this connection: - 'Required', 'NotRequired', or 'NotApplicable'. Known values are: "Required", "NotRequired", and - "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.cognitiveservices.models.ManagedPERequirement - :ivar pe_status: Specifies the status of private endpoints for this connection: 'Inactive', - 'Active', or 'NotApplicable'. Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.cognitiveservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: The connection URL to be used. - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionManagedIdentity - :ivar auth_type: Authentication type of the connection target. Required. MANAGED_IDENTITY. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.MANAGED_IDENTITY + :ivar model_instance_accelerator_count: The number of accelerators required per model instance. + :vartype model_instance_accelerator_count: int + :ivar total_available_capacity: The total available capacity for this deployment size. + :vartype total_available_capacity: int + :ivar largest_deployment_capacity: The largest contiguous deployment capacity available for + this deployment size. + :vartype largest_deployment_capacity: int """ - credentials: Optional["_models.ConnectionManagedIdentity"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + model_instance_accelerator_count: Optional[int] = rest_field( + name="modelInstanceAcceleratorCount", visibility=["read"] ) - auth_type: Literal[ConnectionAuthType.MANAGED_IDENTITY] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. MANAGED_IDENTITY.""" - - @overload - def __init__( - self, - *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.ConnectionManagedIdentity"] = 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.auth_type = ConnectionAuthType.MANAGED_IDENTITY # type: ignore - - -class ManagedNetworkProvisionOptions(_Model): - """Managed Network Provisioning options for managed network of a cognitive services account.""" + """The number of accelerators required per model instance.""" + total_available_capacity: Optional[int] = rest_field(name="totalAvailableCapacity", visibility=["read"]) + """The total available capacity for this deployment size.""" + largest_deployment_capacity: Optional[int] = rest_field(name="largestDeploymentCapacity", visibility=["read"]) + """The largest contiguous deployment capacity available for this deployment size.""" -class ManagedNetworkProvisionStatus(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Status of the Provisioning for the managed network of a cognitive services account. +class DomainAvailability(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Domain availability. - :ivar status: Status for the managed network of a cognitive services account. Known values are: - "Inactive" and "Active". - :vartype status: str or ~azure.mgmt.cognitiveservices.models.ManagedNetworkStatus + :ivar is_subdomain_available: Indicates the given SKU is available or not. + :vartype is_subdomain_available: bool + :ivar reason: Reason why the SKU is not available. + :vartype reason: str + :ivar subdomain_name: The subdomain name to use. + :vartype subdomain_name: str + :ivar type: The Type of the resource. + :vartype type: str + :ivar kind: The kind (type) of cognitive service account. + :vartype kind: str """ - status: Optional[Union[str, "_models.ManagedNetworkStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + is_subdomain_available: Optional[bool] = rest_field( + name="isSubdomainAvailable", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates the given SKU is available or not.""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Reason why the SKU is not available.""" + subdomain_name: Optional[str] = rest_field( + name="subdomainName", visibility=["read", "create", "update", "delete", "query"] ) - """Status for the managed network of a cognitive services account. Known values are: \"Inactive\" - and \"Active\".""" + """The subdomain name to use.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Type of the resource.""" + kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kind (type) of cognitive service account.""" @overload def __init__( self, *, - status: Optional[Union[str, "_models.ManagedNetworkStatus"]] = None, + is_subdomain_available: Optional[bool] = None, + reason: Optional[str] = None, + subdomain_name: Optional[str] = None, + type: Optional[str] = None, + kind: Optional[str] = None, ) -> None: ... @overload @@ -7259,73 +4057,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedNetworkSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Managed Network settings for a cognitive services account. +class Encryption(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties to configure Encryption. - :ivar isolation_mode: Isolation mode for the managed network of a cognitive services account. - Known values are: "Disabled", "AllowInternetOutbound", and "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.cognitiveservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of . - :vartype outbound_rules: dict[str, ~azure.mgmt.cognitiveservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a cognitive services - account. - :vartype status: ~azure.mgmt.cognitiveservices.models.ManagedNetworkProvisionStatus - :ivar firewall_sku: Firewall Sku used for FQDN Rules. Known values are: "Standard" and "Basic". - :vartype firewall_sku: str or ~azure.mgmt.cognitiveservices.models.FirewallSku - :ivar managed_network_kind: The Kind of the managed network. Users can switch from V1 to V2 for - granular access controls, but cannot switch back to V1 once V2 is enabled. Known values are: - "V1" and "V2". - :vartype managed_network_kind: str or ~azure.mgmt.cognitiveservices.models.ManagedNetworkKind - :ivar firewall_public_ip_address: Public IP address assigned to the Azure Firewall. - :vartype firewall_public_ip_address: str - :ivar provisioning_state: The provisioning state of the managed network settings. Known values - are: "Deferred", "Updating", "Succeeded", "Failed", "Deleting", and "Deleted". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.ManagedNetworkProvisioningState + :ivar key_vault_properties: Properties of KeyVault. + :vartype key_vault_properties: ~azure.mgmt.cognitiveservices.models.KeyVaultProperties + :ivar key_source: Enumerates the possible value of keySource for Encryption. Known values are: + "Microsoft.CognitiveServices" and "Microsoft.KeyVault". + :vartype key_source: str or ~azure.mgmt.cognitiveservices.models.KeySource """ - isolation_mode: Optional[Union[str, "_models.IsolationMode"]] = rest_field( - name="isolationMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Isolation mode for the managed network of a cognitive services account. Known values are: - \"Disabled\", \"AllowInternetOutbound\", and \"AllowOnlyApprovedOutbound\".""" - network_id: Optional[str] = rest_field(name="networkId", visibility=["read"]) - outbound_rules: Optional[dict[str, "_models.OutboundRule"]] = rest_field( - name="outboundRules", visibility=["read", "create", "update", "delete", "query"] - ) - """Dictionary of .""" - status: Optional["_models.ManagedNetworkProvisionStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Status of the Provisioning for the managed network of a cognitive services account.""" - firewall_sku: Optional[Union[str, "_models.FirewallSku"]] = rest_field( - name="firewallSku", visibility=["read", "create", "update", "delete", "query"] - ) - """Firewall Sku used for FQDN Rules. Known values are: \"Standard\" and \"Basic\".""" - managed_network_kind: Optional[Union[str, "_models.ManagedNetworkKind"]] = rest_field( - name="managedNetworkKind", visibility=["read", "create", "update", "delete", "query"] + key_vault_properties: Optional["_models.KeyVaultProperties"] = rest_field( + name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"] ) - """The Kind of the managed network. Users can switch from V1 to V2 for granular access controls, - but cannot switch back to V1 once V2 is enabled. Known values are: \"V1\" and \"V2\".""" - firewall_public_ip_address: Optional[str] = rest_field(name="firewallPublicIpAddress", visibility=["read"]) - """Public IP address assigned to the Azure Firewall.""" - provisioning_state: Optional[Union[str, "_models.ManagedNetworkProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] + """Properties of KeyVault.""" + key_source: Optional[Union[str, "_models.KeySource"]] = rest_field( + name="keySource", visibility=["read", "create", "update", "delete", "query"] ) - """The provisioning state of the managed network settings. Known values are: \"Deferred\", - \"Updating\", \"Succeeded\", \"Failed\", \"Deleting\", and \"Deleted\".""" + """Enumerates the possible value of keySource for Encryption. Known values are: + \"Microsoft.CognitiveServices\" and \"Microsoft.KeyVault\".""" @overload def __init__( self, *, - isolation_mode: Optional[Union[str, "_models.IsolationMode"]] = None, - outbound_rules: Optional[dict[str, "_models.OutboundRule"]] = None, - status: Optional["_models.ManagedNetworkProvisionStatus"] = None, - firewall_sku: Optional[Union[str, "_models.FirewallSku"]] = None, - managed_network_kind: Optional[Union[str, "_models.ManagedNetworkKind"]] = None, + key_vault_properties: Optional["_models.KeyVaultProperties"] = None, + key_source: Optional[Union[str, "_models.KeySource"]] = None, ) -> None: ... @overload @@ -7339,8 +4096,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedNetworkSettingsBasicResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only - """ManagedNetworkSettingsBasicResource. +class EncryptionScope(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services EncryptionScope. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -7353,20 +4110,29 @@ class ManagedNetworkSettingsBasicResource(Resource): # pylint: disable=docstrin :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Managed Network settings for a cognitive services account. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ManagedNetworkSettings + :ivar properties: Properties of Cognitive Services EncryptionScope. + :vartype properties: ~azure.mgmt.cognitiveservices.models.EncryptionScopeProperties + :ivar etag: Resource Etag. + :vartype etag: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] """ - properties: Optional["_models.ManagedNetworkSettings"] = rest_field( + properties: Optional["_models.EncryptionScopeProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Managed Network settings for a cognitive services account.""" + """Properties of Cognitive Services EncryptionScope.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """Resource Etag.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) + """Resource tags.""" @overload def __init__( self, *, - properties: Optional["_models.ManagedNetworkSettings"] = None, + properties: Optional["_models.EncryptionScopeProperties"] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -7380,49 +4146,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedNetworkSettingsEx(ManagedNetworkSettings): # pylint: disable=docstring-keyword-should-match-keyword-only - """ManagedNetworkSettingsEx. +class EncryptionScopeProperties(Encryption): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties to EncryptionScope. - :ivar isolation_mode: Isolation mode for the managed network of a cognitive services account. - Known values are: "Disabled", "AllowInternetOutbound", and "AllowOnlyApprovedOutbound". - :vartype isolation_mode: str or ~azure.mgmt.cognitiveservices.models.IsolationMode - :ivar network_id: - :vartype network_id: str - :ivar outbound_rules: Dictionary of . - :vartype outbound_rules: dict[str, ~azure.mgmt.cognitiveservices.models.OutboundRule] - :ivar status: Status of the Provisioning for the managed network of a cognitive services - account. - :vartype status: ~azure.mgmt.cognitiveservices.models.ManagedNetworkProvisionStatus - :ivar firewall_sku: Firewall Sku used for FQDN Rules. Known values are: "Standard" and "Basic". - :vartype firewall_sku: str or ~azure.mgmt.cognitiveservices.models.FirewallSku - :ivar managed_network_kind: The Kind of the managed network. Users can switch from V1 to V2 for - granular access controls, but cannot switch back to V1 once V2 is enabled. Known values are: - "V1" and "V2". - :vartype managed_network_kind: str or ~azure.mgmt.cognitiveservices.models.ManagedNetworkKind - :ivar firewall_public_ip_address: Public IP address assigned to the Azure Firewall. - :vartype firewall_public_ip_address: str - :ivar provisioning_state: The provisioning state of the managed network settings. Known values - are: "Deferred", "Updating", "Succeeded", "Failed", "Deleting", and "Deleted". + :ivar key_vault_properties: Properties of KeyVault. + :vartype key_vault_properties: ~azure.mgmt.cognitiveservices.models.KeyVaultProperties + :ivar key_source: Enumerates the possible value of keySource for Encryption. Known values are: + "Microsoft.CognitiveServices" and "Microsoft.KeyVault". + :vartype key_source: str or ~azure.mgmt.cognitiveservices.models.KeySource + :ivar provisioning_state: Gets the status of the resource at the time the operation was called. + Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", "Succeeded", and + "Canceled". :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.ManagedNetworkProvisioningState - :ivar changeable_isolation_modes: - :vartype changeable_isolation_modes: list[str or - ~azure.mgmt.cognitiveservices.models.IsolationMode] + ~azure.mgmt.cognitiveservices.models.EncryptionScopeProvisioningState + :ivar state: The encryptionScope state. Known values are: "Disabled" and "Enabled". + :vartype state: str or ~azure.mgmt.cognitiveservices.models.EncryptionScopeState """ - changeable_isolation_modes: Optional[list[Union[str, "_models.IsolationMode"]]] = rest_field( - name="changeableIsolationModes", visibility=["read"] + provisioning_state: Optional[Union[str, "_models.EncryptionScopeProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Gets the status of the resource at the time the operation was called. Known values are: + \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", and + \"Canceled\".""" + state: Optional[Union[str, "_models.EncryptionScopeState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) + """The encryptionScope state. Known values are: \"Disabled\" and \"Enabled\".""" @overload def __init__( self, *, - isolation_mode: Optional[Union[str, "_models.IsolationMode"]] = None, - outbound_rules: Optional[dict[str, "_models.OutboundRule"]] = None, - status: Optional["_models.ManagedNetworkProvisionStatus"] = None, - firewall_sku: Optional[Union[str, "_models.FirewallSku"]] = None, - managed_network_kind: Optional[Union[str, "_models.ManagedNetworkKind"]] = None, + key_vault_properties: Optional["_models.KeyVaultProperties"] = None, + key_source: Optional[Union[str, "_models.KeySource"]] = None, + state: Optional[Union[str, "_models.EncryptionScopeState"]] = None, ) -> None: ... @overload @@ -7436,79 +4194,65 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedNetworkSettingsProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The properties of the managed network settings of a cognitive services account. +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. - :ivar managed_network: Managed Network settings for a cognitive services account. - :vartype managed_network: ~azure.mgmt.cognitiveservices.models.ManagedNetworkSettingsEx - :ivar provisioning_state: The current deployment state of the managed network resource. The - provisioningState is to indicate states for resource provisioning. Known values are: - "Deferred", "Updating", "Succeeded", "Failed", "Deleting", and "Deleted". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.ManagedNetworkProvisioningState + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any """ - managed_network: Optional["_models.ManagedNetworkSettingsEx"] = rest_field( - name="managedNetwork", visibility=["read", "create", "update", "delete", "query"] - ) - """Managed Network settings for a cognitive services account.""" - provisioning_state: Optional[Union[str, "_models.ManagedNetworkProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """The current deployment state of the managed network resource. The provisioningState is to - indicate states for resource provisioning. Known values are: \"Deferred\", \"Updating\", - \"Succeeded\", \"Failed\", \"Deleting\", and \"Deleted\".""" - - @overload - def __init__( - self, - *, - managed_network: Optional["_models.ManagedNetworkSettingsEx"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) +class ErrorDetail(_Model): + """The error detail. -class ManagedNetworkSettingsPropertiesBasicResource( - ProxyResource -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Concrete proxy resource types can be created by aliasing this type using a specific property - type. + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.cognitiveservices.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.cognitiveservices.models.ErrorAdditionalInfo] + """ - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: The properties of the managed network settings of a cognitive services - account. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ManagedNetworkSettingsProperties + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.cognitiveservices.models.ErrorDetail """ - properties: Optional["_models.ManagedNetworkSettingsProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The properties of the managed network settings of a cognitive services account.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" @overload def __init__( self, *, - properties: Optional["_models.ManagedNetworkSettingsProperties"] = None, + error: Optional["_models.ErrorDetail"] = None, ) -> None: ... @overload @@ -7522,28 +4266,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MetricName(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A metric name. +class OutboundRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Outbound Rule for the managed network of a cognitive services account. - :ivar value: The name of the metric. - :vartype value: str - :ivar localized_value: The friendly name of the metric. - :vartype localized_value: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule + + :ivar category: Category of a managed network Outbound Rule of a cognitive services account. + Known values are: "Required", "Recommended", "UserDefined", and "Dependency". + :vartype category: str or ~azure.mgmt.cognitiveservices.models.RuleCategory + :ivar status: Type of a managed network Outbound Rule of a cognitive services account. Known + values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". + :vartype status: str or ~azure.mgmt.cognitiveservices.models.RuleStatus + :ivar type: Type of a managed network Outbound Rule of a cognitive services account. Required. + Known values are: "FQDN", "PrivateEndpoint", and "ServiceTag". + :vartype type: str or ~azure.mgmt.cognitiveservices.models.RuleType + :ivar error_information: Error information about an outbound rule of a cognitive services + account if RuleStatus is failed. + :vartype error_information: str + :ivar parent_rule_names: + :vartype parent_rule_names: list[str] """ - value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the metric.""" - localized_value: Optional[str] = rest_field( - name="localizedValue", visibility=["read", "create", "update", "delete", "query"] + __mapping__: dict[str, _Model] = {} + category: Optional[Union[str, "_models.RuleCategory"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The friendly name of the metric.""" + """Category of a managed network Outbound Rule of a cognitive services account. Known values are: + \"Required\", \"Recommended\", \"UserDefined\", and \"Dependency\".""" + status: Optional[Union[str, "_models.RuleStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of a managed network Outbound Rule of a cognitive services account. Known values are: + \"Inactive\", \"Active\", \"Provisioning\", \"Deleting\", and \"Failed\".""" + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Type of a managed network Outbound Rule of a cognitive services account. Required. Known values + are: \"FQDN\", \"PrivateEndpoint\", and \"ServiceTag\".""" + error_information: Optional[str] = rest_field(name="errorInformation", visibility=["read"]) + """Error information about an outbound rule of a cognitive services account if RuleStatus is + failed.""" + parent_rule_names: Optional[list[str]] = rest_field(name="parentRuleNames", visibility=["read"]) @overload def __init__( self, *, - value: Optional[str] = None, - localized_value: Optional[str] = None, + type: str, + category: Optional[Union[str, "_models.RuleCategory"]] = None, + status: Optional[Union[str, "_models.RuleStatus"]] = None, ) -> None: ... @overload @@ -7557,36 +4327,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Model(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services Model. +class FqdnOutboundRule( + OutboundRule, discriminator="FQDN" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """FQDN Outbound Rule for the managed network of a cognitive services account. - :ivar model: Cognitive Services account Model. - :vartype model: ~azure.mgmt.cognitiveservices.models.AccountModel - :ivar kind: The kind (type) of cognitive service account. - :vartype kind: str - :ivar sku_name: The name of SKU. - :vartype sku_name: str - :ivar description: The description of the model. - :vartype description: str + :ivar category: Category of a managed network Outbound Rule of a cognitive services account. + Known values are: "Required", "Recommended", "UserDefined", and "Dependency". + :vartype category: str or ~azure.mgmt.cognitiveservices.models.RuleCategory + :ivar status: Type of a managed network Outbound Rule of a cognitive services account. Known + values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". + :vartype status: str or ~azure.mgmt.cognitiveservices.models.RuleStatus + :ivar error_information: Error information about an outbound rule of a cognitive services + account if RuleStatus is failed. + :vartype error_information: str + :ivar parent_rule_names: + :vartype parent_rule_names: list[str] + :ivar destination: + :vartype destination: str + :ivar type: Type of a managed network Outbound Rule of a cognitive services account. Required. + FQDN. + :vartype type: str or ~azure.mgmt.cognitiveservices.models.RuleType """ - model: Optional["_models.AccountModel"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Cognitive Services account Model.""" - kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The kind (type) of cognitive service account.""" - sku_name: Optional[str] = rest_field(name="skuName", visibility=["read", "create", "update", "delete", "query"]) - """The name of SKU.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the model.""" + destination: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[RuleType.FQDN] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of a managed network Outbound Rule of a cognitive services account. Required. FQDN.""" @overload def __init__( self, *, - model: Optional["_models.AccountModel"] = None, - kind: Optional[str] = None, - sku_name: Optional[str] = None, - description: Optional[str] = None, + category: Optional[Union[str, "_models.RuleCategory"]] = None, + status: Optional[Union[str, "_models.RuleStatus"]] = None, + destination: Optional[str] = None, ) -> None: ... @overload @@ -7598,33 +4372,70 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RuleType.FQDN # type: ignore -class ModelCapacityCalculatorWorkload(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Model Capacity Calculator Workload. +class HostedAgentDeployment( + AgentDeploymentProperties, discriminator="Hosted" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a hosted agent deployment where the underlying infrastructure is owned by the + platform. - :ivar request_per_minute: Request per minute. - :vartype request_per_minute: int - :ivar request_parameters: Dictionary, Model Capacity Calculator Workload Parameters. - :vartype request_parameters: - ~azure.mgmt.cognitiveservices.models.ModelCapacityCalculatorWorkloadRequestParam + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar display_name: Gets or sets the display name of the deployment. + :vartype display_name: str + :ivar deployment_id: Gets or sets the unique identifier of the deployment. + :vartype deployment_id: str + :ivar state: Gets or sets the current operational state of the deployment (and, intrinsically, + of the comprising agents). Known values are: "Starting", "Running", "Stopping", "Stopped", + "Failed", "Deleting", "Deleted", and "Updating". + :vartype state: str or ~azure.mgmt.cognitiveservices.models.AgentDeploymentState + :ivar protocols: Gets or sets the supported protocol types and versions exposed by this + deployment. + :vartype protocols: list[~azure.mgmt.cognitiveservices.models.AgentProtocolVersion] + :ivar agents: Returns a flat list of agent:version deployed in this deployment. + :vartype agents: list[~azure.mgmt.cognitiveservices.models.VersionedAgentReference] + :ivar provisioning_state: Gets or sets the provisioning state of the agent deployment. Known + values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.AgentDeploymentProvisioningState + :ivar min_replicas: Gets or sets the minimum number of replicas for this hosted deployment. + :vartype min_replicas: int + :ivar max_replicas: Gets or sets the maximum number of replicas for this hosted deployment. + :vartype max_replicas: int + :ivar deployment_type: Gets or sets the type of deployment for the agent. Required. The + underlying infra is owned by the platform. + :vartype deployment_type: str or ~azure.mgmt.cognitiveservices.models.AgentDeploymentType """ - request_per_minute: Optional[int] = rest_field( - name="requestPerMinute", visibility=["read", "create", "update", "delete", "query"] + min_replicas: Optional[int] = rest_field( + name="minReplicas", visibility=["read", "create", "update", "delete", "query"] ) - """Request per minute.""" - request_parameters: Optional["_models.ModelCapacityCalculatorWorkloadRequestParam"] = rest_field( - name="requestParameters", visibility=["read", "create", "update", "delete", "query"] + """Gets or sets the minimum number of replicas for this hosted deployment.""" + max_replicas: Optional[int] = rest_field( + name="maxReplicas", visibility=["read", "create", "update", "delete", "query"] ) - """Dictionary, Model Capacity Calculator Workload Parameters.""" + """Gets or sets the maximum number of replicas for this hosted deployment.""" + deployment_type: Literal[AgentDeploymentType.HOSTED] = rest_discriminator(name="deploymentType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Gets or sets the type of deployment for the agent. Required. The underlying infra is owned by + the platform.""" @overload def __init__( self, *, - request_per_minute: Optional[int] = None, - request_parameters: Optional["_models.ModelCapacityCalculatorWorkloadRequestParam"] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + display_name: Optional[str] = None, + deployment_id: Optional[str] = None, + state: Optional[Union[str, "_models.AgentDeploymentState"]] = None, + protocols: Optional[list["_models.AgentProtocolVersion"]] = None, + agents: Optional[list["_models.VersionedAgentReference"]] = None, + min_replicas: Optional[int] = None, + max_replicas: Optional[int] = None, ) -> None: ... @overload @@ -7636,80 +4447,78 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.deployment_type = AgentDeploymentType.HOSTED # type: ignore -class ModelCapacityCalculatorWorkloadRequestParam( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Dictionary, Model Capacity Calculator Workload Parameters. +class Identity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Identity for the resource. - :ivar avg_prompt_tokens: Average prompt tokens. - :vartype avg_prompt_tokens: int - :ivar avg_generated_tokens: Average generated tokens. - :vartype avg_generated_tokens: int + :ivar type: The identity type. Known values are: "None", "SystemAssigned", "UserAssigned", and + "SystemAssigned, UserAssigned". + :vartype type: str or ~azure.mgmt.cognitiveservices.models.ResourceIdentityType + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar user_assigned_identities: The list of user assigned identities associated with the + resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.cognitiveservices.models.UserAssignedIdentity] """ - avg_prompt_tokens: Optional[int] = rest_field( - name="avgPromptTokens", visibility=["read", "create", "update", "delete", "query"] + type: Optional[Union[str, "_models.ResourceIdentityType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Average prompt tokens.""" - avg_generated_tokens: Optional[int] = rest_field( - name="avgGeneratedTokens", visibility=["read", "create", "update", "delete", "query"] + """The identity type. Known values are: \"None\", \"SystemAssigned\", \"UserAssigned\", and + \"SystemAssigned, UserAssigned\".""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of resource.""" + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of resource identity.""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] ) - """Average generated tokens.""" + """The list of user assigned identities associated with the resource. The user identity dictionary + key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.""" @overload def __init__( self, *, - avg_prompt_tokens: Optional[int] = None, - avg_generated_tokens: Optional[int] = None, + type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = 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 ModelCapacityListResultValueItem(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """ModelCapacityListResultValueItem. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar location: The location of the Model Sku Capacity. - :vartype location: str - :ivar properties: Cognitive Services account ModelSkuCapacity. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ModelSkuCapacityProperties + """ + :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 IpRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A rule governing the accessibility from a specific ip address or ip range. + + :ivar value: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) + or '124.56.78.0/24' (all addresses that start with 124.56.78). Required. + :vartype value: str """ - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The location of the Model Sku Capacity.""" - properties: Optional["_models.ModelSkuCapacityProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Cognitive Services account ModelSkuCapacity.""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or + '124.56.78.0/24' (all addresses that start with 124.56.78). Required.""" @overload def __init__( self, *, - location: Optional[str] = None, - properties: Optional["_models.ModelSkuCapacityProperties"] = None, + value: str, ) -> None: ... @overload @@ -7723,40 +4532,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelDeprecationInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services account ModelDeprecationInfo. +class KeyVaultProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties to configure keyVault Properties. - :ivar fine_tune: The datetime of deprecation of the fineTune Model. - :vartype fine_tune: str - :ivar inference: The datetime of deprecation of the inference Model. - :vartype inference: str - :ivar deprecation_status: Indicates whether the deprecation date is a confirmed planned - end-of-life date or an estimated deprecation date. When 'Planned', the deprecation date - represents a confirmed and communicated model end-of-life date. When 'Tentative', the - deprecation date is an estimated timeline that may be subject to change. Known values are: - "Planned" and "Tentative". - :vartype deprecation_status: str or ~azure.mgmt.cognitiveservices.models.DeprecationStatus + :ivar key_name: Name of the Key from KeyVault. + :vartype key_name: str + :ivar key_version: Version of the Key from KeyVault. + :vartype key_version: str + :ivar key_vault_uri: Uri of KeyVault. + :vartype key_vault_uri: str + :ivar identity_client_id: + :vartype identity_client_id: str """ - fine_tune: Optional[str] = rest_field(name="fineTune", visibility=["read", "create", "update", "delete", "query"]) - """The datetime of deprecation of the fineTune Model.""" - inference: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The datetime of deprecation of the inference Model.""" - deprecation_status: Optional[Union[str, "_models.DeprecationStatus"]] = rest_field( - name="deprecationStatus", visibility=["read", "create", "update", "delete", "query"] + key_name: Optional[str] = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"]) + """Name of the Key from KeyVault.""" + key_version: Optional[str] = rest_field( + name="keyVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Version of the Key from KeyVault.""" + key_vault_uri: Optional[str] = rest_field( + name="keyVaultUri", visibility=["read", "create", "update", "delete", "query"] + ) + """Uri of KeyVault.""" + identity_client_id: Optional[str] = rest_field( + name="identityClientId", visibility=["read", "create", "update", "delete", "query"] ) - """Indicates whether the deprecation date is a confirmed planned end-of-life date or an estimated - deprecation date. When 'Planned', the deprecation date represents a confirmed and communicated - model end-of-life date. When 'Tentative', the deprecation date is an estimated timeline that - may be subject to change. Known values are: \"Planned\" and \"Tentative\".""" @overload def __init__( self, *, - fine_tune: Optional[str] = None, - inference: Optional[str] = None, - deprecation_status: Optional[Union[str, "_models.DeprecationStatus"]] = None, + key_name: Optional[str] = None, + key_version: Optional[str] = None, + key_vault_uri: Optional[str] = None, + identity_client_id: Optional[str] = None, ) -> None: ... @overload @@ -7770,54 +4580,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ModelSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Describes an available Cognitive Services Model SKU. +class ManagedAgentDeployment( + AgentDeploymentProperties, discriminator="Managed" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents a managed agent deployment where the underlying infrastructure is managed by the + platform in the deployer's subscription. - :ivar name: The name of the model SKU. - :vartype name: str - :ivar usage_name: The usage name of the model SKU. - :vartype usage_name: str - :ivar deprecation_date: The datetime of deprecation of the model SKU. - :vartype deprecation_date: ~datetime.datetime - :ivar capacity: The capacity configuration. - :vartype capacity: ~azure.mgmt.cognitiveservices.models.CapacityConfig - :ivar rate_limits: The list of rateLimit. - :vartype rate_limits: list[~azure.mgmt.cognitiveservices.models.CallRateLimit] - :ivar cost: The list of billing meter info. - :vartype cost: list[~azure.mgmt.cognitiveservices.models.BillingMeterInfo] + :ivar description: The asset description text. + :vartype description: str + :ivar tags: Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar display_name: Gets or sets the display name of the deployment. + :vartype display_name: str + :ivar deployment_id: Gets or sets the unique identifier of the deployment. + :vartype deployment_id: str + :ivar state: Gets or sets the current operational state of the deployment (and, intrinsically, + of the comprising agents). Known values are: "Starting", "Running", "Stopping", "Stopped", + "Failed", "Deleting", "Deleted", and "Updating". + :vartype state: str or ~azure.mgmt.cognitiveservices.models.AgentDeploymentState + :ivar protocols: Gets or sets the supported protocol types and versions exposed by this + deployment. + :vartype protocols: list[~azure.mgmt.cognitiveservices.models.AgentProtocolVersion] + :ivar agents: Returns a flat list of agent:version deployed in this deployment. + :vartype agents: list[~azure.mgmt.cognitiveservices.models.VersionedAgentReference] + :ivar provisioning_state: Gets or sets the provisioning state of the agent deployment. Known + values are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.AgentDeploymentProvisioningState + :ivar deployment_type: Gets or sets the type of deployment for the agent. Required. The + underlying infra is managed by the platform in the deployer's subscription. + :vartype deployment_type: str or ~azure.mgmt.cognitiveservices.models.AgentDeploymentType """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the model SKU.""" - usage_name: Optional[str] = rest_field(name="usageName", visibility=["read", "create", "update", "delete", "query"]) - """The usage name of the model SKU.""" - deprecation_date: Optional[datetime.datetime] = rest_field( - name="deprecationDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The datetime of deprecation of the model SKU.""" - capacity: Optional["_models.CapacityConfig"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The capacity configuration.""" - rate_limits: Optional[list["_models.CallRateLimit"]] = rest_field( - name="rateLimits", visibility=["read", "create", "update", "delete", "query"] - ) - """The list of rateLimit.""" - cost: Optional[list["_models.BillingMeterInfo"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The list of billing meter info.""" + deployment_type: Literal[AgentDeploymentType.MANAGED] = rest_discriminator(name="deploymentType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Gets or sets the type of deployment for the agent. Required. The underlying infra is managed by + the platform in the deployer's subscription.""" @overload def __init__( self, *, - name: Optional[str] = None, - usage_name: Optional[str] = None, - deprecation_date: Optional[datetime.datetime] = None, - capacity: Optional["_models.CapacityConfig"] = None, - rate_limits: Optional[list["_models.CallRateLimit"]] = None, - cost: Optional[list["_models.BillingMeterInfo"]] = None, + description: Optional[str] = None, + tags: Optional[dict[str, str]] = None, + display_name: Optional[str] = None, + deployment_id: Optional[str] = None, + state: Optional[Union[str, "_models.AgentDeploymentState"]] = None, + protocols: Optional[list["_models.AgentProtocolVersion"]] = None, + agents: Optional[list["_models.VersionedAgentReference"]] = None, ) -> None: ... @overload @@ -7829,56 +4638,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.deployment_type = AgentDeploymentType.MANAGED # type: ignore -class ModelSkuCapacityProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services account ModelSkuCapacity. +class ManagedComputeCapacity(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed compute capacity information for Cognitive Services managed compute deployments. + Provides available accelerator capacity per type and region at the subscription level. - :ivar model: Properties of Cognitive Services account deployment model. - :vartype model: ~azure.mgmt.cognitiveservices.models.DeploymentModel - :ivar sku_name: - :vartype sku_name: str - :ivar available_capacity: The available capacity for deployment with this model and sku. - :vartype available_capacity: float - :ivar available_finetune_capacity: The available capacity for deployment with a fine-tune - version of this model and sku. - :vartype available_finetune_capacity: float - :ivar scope_id: The scope identifier for model SKU capacity. - :vartype scope_id: str - :ivar scope_type: The scope type for model SKU capacity. Known values are: "Regional", - "Global", "DataZone", and "Classic". - :vartype scope_type: str or ~azure.mgmt.cognitiveservices.models.QuotaScopeType + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: Properties of the managed compute capacity resource. + :vartype properties: ~azure.mgmt.cognitiveservices.models.ManagedComputeCapacityProperties """ - model: Optional["_models.DeploymentModel"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Properties of Cognitive Services account deployment model.""" - sku_name: Optional[str] = rest_field(name="skuName", visibility=["read", "create", "update", "delete", "query"]) - available_capacity: Optional[float] = rest_field( - name="availableCapacity", visibility=["read", "create", "update", "delete", "query"] - ) - """The available capacity for deployment with this model and sku.""" - available_finetune_capacity: Optional[float] = rest_field( - name="availableFinetuneCapacity", visibility=["read", "create", "update", "delete", "query"] - ) - """The available capacity for deployment with a fine-tune version of this model and sku.""" - scope_id: Optional[str] = rest_field(name="scopeId", visibility=["read", "create", "update", "delete", "query"]) - """The scope identifier for model SKU capacity.""" - scope_type: Optional[Union[str, "_models.QuotaScopeType"]] = rest_field( - name="scopeType", visibility=["read", "create", "update", "delete", "query"] + properties: Optional["_models.ManagedComputeCapacityProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The scope type for model SKU capacity. Known values are: \"Regional\", \"Global\", - \"DataZone\", and \"Classic\".""" + """Properties of the managed compute capacity resource.""" @overload def __init__( self, *, - model: Optional["_models.DeploymentModel"] = None, - sku_name: Optional[str] = None, - available_capacity: Optional[float] = None, - available_finetune_capacity: Optional[float] = None, - scope_id: Optional[str] = None, - scope_type: Optional[Union[str, "_models.QuotaScopeType"]] = None, + properties: Optional["_models.ManagedComputeCapacityProperties"] = None, ) -> None: ... @overload @@ -7892,30 +4683,126 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MultiRegionSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The multiregion settings Cognitive Services account. +class ManagedComputeCapacityProperties(_Model): + """Properties of a managed compute capacity resource. - :ivar routing_method: Multiregion routing methods. Known values are: "Priority", "Weighted", - and "Performance". - :vartype routing_method: str or ~azure.mgmt.cognitiveservices.models.RoutingMethods - :ivar regions: - :vartype regions: list[~azure.mgmt.cognitiveservices.models.RegionSetting] + :ivar accelerator_type: The type of accelerator (e.g., Azure.A100, Azure.H100). + :vartype accelerator_type: str + :ivar offer_scope: The capacity offer scope: Global or DataZone. Omitted for deployment-scoped + results. + :vartype offer_scope: str + :ivar scope_id: The identifier within the offer scope: an empty string for Global, or US or EU + for DataZone. Omitted for deployment-scoped results. + :vartype scope_id: str + :ivar available_accelerators: The number of available accelerators in the region. + :vartype available_accelerators: int + :ivar total_available_accelerators: The total number of available accelerators summed across + regions within the scope. Omitted for deployment-scoped results. + :vartype total_available_accelerators: int + :ivar deployment_size_capacities: Capacity information broken down by deployment size. + :vartype deployment_size_capacities: + list[~azure.mgmt.cognitiveservices.models.DeploymentSizeCapacity] + """ + + accelerator_type: Optional[str] = rest_field(name="acceleratorType", visibility=["read"]) + """The type of accelerator (e.g., Azure.A100, Azure.H100).""" + offer_scope: Optional[str] = rest_field(name="offerScope", visibility=["read"]) + """The capacity offer scope: Global or DataZone. Omitted for deployment-scoped results.""" + scope_id: Optional[str] = rest_field(name="scopeId", visibility=["read"]) + """The identifier within the offer scope: an empty string for Global, or US or EU for DataZone. + Omitted for deployment-scoped results.""" + available_accelerators: Optional[int] = rest_field(name="availableAccelerators", visibility=["read"]) + """The number of available accelerators in the region.""" + total_available_accelerators: Optional[int] = rest_field(name="totalAvailableAccelerators", visibility=["read"]) + """The total number of available accelerators summed across regions within the scope. Omitted for + deployment-scoped results.""" + deployment_size_capacities: Optional[list["_models.DeploymentSizeCapacity"]] = rest_field( + name="deploymentSizeCapacities", visibility=["read"] + ) + """Capacity information broken down by deployment size.""" + + +class ManagedIdentityAuthTypeConnectionProperties( + ConnectionPropertiesV2, discriminator="ManagedIdentity" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """ManagedIdentityAuthTypeConnectionProperties. + + :ivar category: Category of the connection. Known values are: "PythonFeed", + "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", + "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", + "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", + "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", + "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", + "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", + "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", + "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", + "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", + "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", + "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", + "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", + "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", + "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", + "PowerPlatformEnvironment", and "RemoteA2A". + :vartype category: str or ~azure.mgmt.cognitiveservices.models.ConnectionCategory + :ivar created_by_workspace_arm_id: + :vartype created_by_workspace_arm_id: str + :ivar error: Provides the error message if the connection fails. + :vartype error: str + :ivar expiry_time: + :vartype expiry_time: ~datetime.datetime + :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", + "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". + :vartype group: str or ~azure.mgmt.cognitiveservices.models.ConnectionGroup + :ivar is_shared_to_all: + :vartype is_shared_to_all: bool + :ivar metadata: Store user metadata for this connection. + :vartype metadata: dict[str, str] + :ivar pe_requirement: Specifies how private endpoints are used with this connection: + 'Required', 'NotRequired', or 'NotApplicable'. Known values are: "Required", "NotRequired", and + "NotApplicable". + :vartype pe_requirement: str or ~azure.mgmt.cognitiveservices.models.ManagedPERequirement + :ivar pe_status: Specifies the status of private endpoints for this connection: 'Inactive', + 'Active', or 'NotApplicable'. Known values are: "Inactive", "Active", and "NotApplicable". + :vartype pe_status: str or ~azure.mgmt.cognitiveservices.models.ManagedPEStatus + :ivar shared_user_list: + :vartype shared_user_list: list[str] + :ivar target: The connection URL to be used. + :vartype target: str + :ivar use_workspace_managed_identity: + :vartype use_workspace_managed_identity: bool + :ivar credentials: + :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionManagedIdentity + :ivar auth_type: Authentication type of the connection target. Required. MANAGED_IDENTITY. + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ - routing_method: Optional[Union[str, "_models.RoutingMethods"]] = rest_field( - name="routingMethod", visibility=["read", "create", "update", "delete", "query"] - ) - """Multiregion routing methods. Known values are: \"Priority\", \"Weighted\", and \"Performance\".""" - regions: Optional[list["_models.RegionSetting"]] = rest_field( + credentials: Optional["_models.ConnectionManagedIdentity"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) + auth_type: Literal[ConnectionAuthType.MANAGED_IDENTITY] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Authentication type of the connection target. Required. MANAGED_IDENTITY.""" @overload def __init__( self, *, - routing_method: Optional[Union[str, "_models.RoutingMethods"]] = None, - regions: Optional[list["_models.RegionSetting"]] = None, + category: Optional[Union[str, "_models.ConnectionCategory"]] = None, + error: Optional[str] = None, + expiry_time: Optional[datetime.datetime] = None, + is_shared_to_all: Optional[bool] = None, + metadata: Optional[dict[str, str]] = None, + pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, + pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, + shared_user_list: Optional[list[str]] = None, + target: Optional[str] = None, + use_workspace_managed_identity: Optional[bool] = None, + credentials: Optional["_models.ConnectionManagedIdentity"] = None, ) -> None: ... @overload @@ -7927,46 +4814,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.auth_type = ConnectionAuthType.MANAGED_IDENTITY # type: ignore -class NetworkInjection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Specifies in AI Foundry where virtual network injection occurs to secure scenarios like Agents - entirely within the user's private network, eliminating public internet exposure while - maintaining control over network configurations and resources. +class ManagedNetworkProvisionOptions(_Model): + """Managed Network Provisioning options for managed network of a cognitive services account.""" - :ivar scenario: Specifies what features in AI Foundry network injection applies to. Currently - only supports 'agent' for agent scenarios. 'none' means no network injection. Known values are: - "none" and "agent". - :vartype scenario: str or ~azure.mgmt.cognitiveservices.models.ScenarioType - :ivar subnet_arm_id: Specify the subnet for which your Agent Client is injected into. - :vartype subnet_arm_id: str - :ivar use_microsoft_managed_network: Boolean to enable Microsoft Managed Network for subnet - delegation. - :vartype use_microsoft_managed_network: bool + +class ManagedNetworkProvisionStatus(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Status of the Provisioning for the managed network of a cognitive services account. + + :ivar status: Status for the managed network of a cognitive services account. Known values are: + "Inactive" and "Active". + :vartype status: str or ~azure.mgmt.cognitiveservices.models.ManagedNetworkStatus """ - scenario: Optional[Union[str, "_models.ScenarioType"]] = rest_field( + status: Optional[Union[str, "_models.ManagedNetworkStatus"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Specifies what features in AI Foundry network injection applies to. Currently only supports - 'agent' for agent scenarios. 'none' means no network injection. Known values are: \"none\" and - \"agent\".""" - subnet_arm_id: Optional[str] = rest_field( - name="subnetArmId", visibility=["read", "create", "update", "delete", "query"] - ) - """Specify the subnet for which your Agent Client is injected into.""" - use_microsoft_managed_network: Optional[bool] = rest_field( - name="useMicrosoftManagedNetwork", visibility=["read", "create", "update", "delete", "query"] - ) - """Boolean to enable Microsoft Managed Network for subnet delegation.""" + """Status for the managed network of a cognitive services account. Known values are: \"Inactive\" + and \"Active\".""" @overload def __init__( self, *, - scenario: Optional[Union[str, "_models.ScenarioType"]] = None, - subnet_arm_id: Optional[str] = None, - use_microsoft_managed_network: Optional[bool] = None, + status: Optional[Union[str, "_models.ManagedNetworkStatus"]] = None, ) -> None: ... @overload @@ -7980,47 +4853,73 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NetworkRuleSet(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A set of rules governing the network accessibility. +class ManagedNetworkSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed Network settings for a cognitive services account. - :ivar default_action: The default action when no rule from ipRules and from virtualNetworkRules - match. This is only used after the bypass property has been evaluated. Known values are: - "Allow" and "Deny". - :vartype default_action: str or ~azure.mgmt.cognitiveservices.models.NetworkRuleAction - :ivar bypass: Setting for trusted services. Known values are: "None" and "AzureServices". - :vartype bypass: str or ~azure.mgmt.cognitiveservices.models.ByPassSelection - :ivar ip_rules: The list of IP address rules. - :vartype ip_rules: list[~azure.mgmt.cognitiveservices.models.IpRule] - :ivar virtual_network_rules: The list of virtual network rules. - :vartype virtual_network_rules: list[~azure.mgmt.cognitiveservices.models.VirtualNetworkRule] + :ivar isolation_mode: Isolation mode for the managed network of a cognitive services account. + Known values are: "Disabled", "AllowInternetOutbound", and "AllowOnlyApprovedOutbound". + :vartype isolation_mode: str or ~azure.mgmt.cognitiveservices.models.IsolationMode + :ivar network_id: + :vartype network_id: str + :ivar outbound_rules: Dictionary of . + :vartype outbound_rules: dict[str, ~azure.mgmt.cognitiveservices.models.OutboundRule] + :ivar status: Status of the Provisioning for the managed network of a cognitive services + account. + :vartype status: ~azure.mgmt.cognitiveservices.models.ManagedNetworkProvisionStatus + :ivar firewall_sku: Firewall Sku used for FQDN Rules. Known values are: "Standard" and "Basic". + :vartype firewall_sku: str or ~azure.mgmt.cognitiveservices.models.FirewallSku + :ivar managed_network_kind: The Kind of the managed network. Users can switch from V1 to V2 for + granular access controls, but cannot switch back to V1 once V2 is enabled. Known values are: + "V1" and "V2". + :vartype managed_network_kind: str or ~azure.mgmt.cognitiveservices.models.ManagedNetworkKind + :ivar firewall_public_ip_address: Public IP address assigned to the Azure Firewall. + :vartype firewall_public_ip_address: str + :ivar provisioning_state: The provisioning state of the managed network settings. Known values + are: "Deferred", "Updating", "Succeeded", "Failed", "Deleting", and "Deleted". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.ManagedNetworkProvisioningState """ - default_action: Optional[Union[str, "_models.NetworkRuleAction"]] = rest_field( - name="defaultAction", visibility=["read", "create", "update", "delete", "query"] + isolation_mode: Optional[Union[str, "_models.IsolationMode"]] = rest_field( + name="isolationMode", visibility=["read", "create", "update", "delete", "query"] ) - """The default action when no rule from ipRules and from virtualNetworkRules match. This is only - used after the bypass property has been evaluated. Known values are: \"Allow\" and \"Deny\".""" - bypass: Optional[Union[str, "_models.ByPassSelection"]] = rest_field( + """Isolation mode for the managed network of a cognitive services account. Known values are: + \"Disabled\", \"AllowInternetOutbound\", and \"AllowOnlyApprovedOutbound\".""" + network_id: Optional[str] = rest_field(name="networkId", visibility=["read"]) + outbound_rules: Optional[dict[str, "_models.OutboundRule"]] = rest_field( + name="outboundRules", visibility=["read", "create", "update", "delete", "query"] + ) + """Dictionary of .""" + status: Optional["_models.ManagedNetworkProvisionStatus"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Setting for trusted services. Known values are: \"None\" and \"AzureServices\".""" - ip_rules: Optional[list["_models.IpRule"]] = rest_field( - name="ipRules", visibility=["read", "create", "update", "delete", "query"] + """Status of the Provisioning for the managed network of a cognitive services account.""" + firewall_sku: Optional[Union[str, "_models.FirewallSku"]] = rest_field( + name="firewallSku", visibility=["read", "create", "update", "delete", "query"] ) - """The list of IP address rules.""" - virtual_network_rules: Optional[list["_models.VirtualNetworkRule"]] = rest_field( - name="virtualNetworkRules", visibility=["read", "create", "update", "delete", "query"] + """Firewall Sku used for FQDN Rules. Known values are: \"Standard\" and \"Basic\".""" + managed_network_kind: Optional[Union[str, "_models.ManagedNetworkKind"]] = rest_field( + name="managedNetworkKind", visibility=["read", "create", "update", "delete", "query"] ) - """The list of virtual network rules.""" + """The Kind of the managed network. Users can switch from V1 to V2 for granular access controls, + but cannot switch back to V1 once V2 is enabled. Known values are: \"V1\" and \"V2\".""" + firewall_public_ip_address: Optional[str] = rest_field(name="firewallPublicIpAddress", visibility=["read"]) + """Public IP address assigned to the Azure Firewall.""" + provisioning_state: Optional[Union[str, "_models.ManagedNetworkProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the managed network settings. Known values are: \"Deferred\", + \"Updating\", \"Succeeded\", \"Failed\", \"Deleting\", and \"Deleted\".""" @overload def __init__( self, *, - default_action: Optional[Union[str, "_models.NetworkRuleAction"]] = None, - bypass: Optional[Union[str, "_models.ByPassSelection"]] = None, - ip_rules: Optional[list["_models.IpRule"]] = None, - virtual_network_rules: Optional[list["_models.VirtualNetworkRule"]] = None, + isolation_mode: Optional[Union[str, "_models.IsolationMode"]] = None, + outbound_rules: Optional[dict[str, "_models.OutboundRule"]] = None, + status: Optional["_models.ManagedNetworkProvisionStatus"] = None, + firewall_sku: Optional[Union[str, "_models.FirewallSku"]] = None, + managed_network_kind: Optional[Union[str, "_models.ManagedNetworkKind"]] = None, ) -> None: ... @overload @@ -8034,33 +4933,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NetworkSecurityPerimeter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Information about a linked Network Security Perimeter. +class ManagedNetworkSettingsBasicResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only + """ManagedNetworkSettingsBasicResource. - :ivar id: Fully qualified identifier of the resource. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str - :ivar perimeter_guid: Guid of the resource. - :vartype perimeter_guid: str - :ivar location: Location of the resource. - :vartype location: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: Managed Network settings for a cognitive services account. + :vartype properties: ~azure.mgmt.cognitiveservices.models.ManagedNetworkSettings """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Fully qualified identifier of the resource.""" - perimeter_guid: Optional[str] = rest_field( - name="perimeterGuid", visibility=["read", "create", "update", "delete", "query"] + properties: Optional["_models.ManagedNetworkSettings"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Guid of the resource.""" - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Location of the resource.""" + """Managed Network settings for a cognitive services account.""" @overload def __init__( self, *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - perimeter_guid: Optional[str] = None, - location: Optional[str] = None, + properties: Optional["_models.ManagedNetworkSettings"] = None, ) -> None: ... @overload @@ -8074,29 +4974,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NetworkSecurityPerimeterAccessRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Network Security Perimeter Access Rule. +class ManagedNetworkSettingsEx(ManagedNetworkSettings): # pylint: disable=docstring-keyword-should-match-keyword-only + """ManagedNetworkSettingsEx. - :ivar name: Network Security Perimeter Access Rule Name. - :vartype name: str - :ivar properties: Properties of Network Security Perimeter Access Rule. - :vartype properties: - ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties + :ivar isolation_mode: Isolation mode for the managed network of a cognitive services account. + Known values are: "Disabled", "AllowInternetOutbound", and "AllowOnlyApprovedOutbound". + :vartype isolation_mode: str or ~azure.mgmt.cognitiveservices.models.IsolationMode + :ivar network_id: + :vartype network_id: str + :ivar outbound_rules: Dictionary of . + :vartype outbound_rules: dict[str, ~azure.mgmt.cognitiveservices.models.OutboundRule] + :ivar status: Status of the Provisioning for the managed network of a cognitive services + account. + :vartype status: ~azure.mgmt.cognitiveservices.models.ManagedNetworkProvisionStatus + :ivar firewall_sku: Firewall Sku used for FQDN Rules. Known values are: "Standard" and "Basic". + :vartype firewall_sku: str or ~azure.mgmt.cognitiveservices.models.FirewallSku + :ivar managed_network_kind: The Kind of the managed network. Users can switch from V1 to V2 for + granular access controls, but cannot switch back to V1 once V2 is enabled. Known values are: + "V1" and "V2". + :vartype managed_network_kind: str or ~azure.mgmt.cognitiveservices.models.ManagedNetworkKind + :ivar firewall_public_ip_address: Public IP address assigned to the Azure Firewall. + :vartype firewall_public_ip_address: str + :ivar provisioning_state: The provisioning state of the managed network settings. Known values + are: "Deferred", "Updating", "Succeeded", "Failed", "Deleting", and "Deleted". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.ManagedNetworkProvisioningState + :ivar changeable_isolation_modes: + :vartype changeable_isolation_modes: list[str or + ~azure.mgmt.cognitiveservices.models.IsolationMode] """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Network Security Perimeter Access Rule Name.""" - properties: Optional["_models.NetworkSecurityPerimeterAccessRuleProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + changeable_isolation_modes: Optional[list[Union[str, "_models.IsolationMode"]]] = rest_field( + name="changeableIsolationModes", visibility=["read"] ) - """Properties of Network Security Perimeter Access Rule.""" @overload def __init__( self, *, - name: Optional[str] = None, - properties: Optional["_models.NetworkSecurityPerimeterAccessRuleProperties"] = None, + isolation_mode: Optional[Union[str, "_models.IsolationMode"]] = None, + outbound_rules: Optional[dict[str, "_models.OutboundRule"]] = None, + status: Optional["_models.ManagedNetworkProvisionStatus"] = None, + firewall_sku: Optional[Union[str, "_models.FirewallSku"]] = None, + managed_network_kind: Optional[Union[str, "_models.ManagedNetworkKind"]] = None, ) -> None: ... @overload @@ -8110,55 +5030,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NetworkSecurityPerimeterAccessRuleProperties( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The Properties of Network Security Perimeter Rule. +class ManagedNetworkSettingsProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of the managed network settings of a cognitive services account. - :ivar direction: Direction of Access Rule. Known values are: "Inbound" and "Outbound". - :vartype direction: str or ~azure.mgmt.cognitiveservices.models.NspAccessRuleDirection - :ivar address_prefixes: Address prefixes for inbound rules. - :vartype address_prefixes: list[str] - :ivar subscriptions: Subscriptions for inbound rules. - :vartype subscriptions: - list[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem] - :ivar network_security_perimeters: NetworkSecurityPerimeters for inbound rules. - :vartype network_security_perimeters: - list[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeter] - :ivar fully_qualified_domain_names: Fully qualified domain name for outbound rules. - :vartype fully_qualified_domain_names: list[str] + :ivar managed_network: Managed Network settings for a cognitive services account. + :vartype managed_network: ~azure.mgmt.cognitiveservices.models.ManagedNetworkSettingsEx + :ivar provisioning_state: The current deployment state of the managed network resource. The + provisioningState is to indicate states for resource provisioning. Known values are: + "Deferred", "Updating", "Succeeded", "Failed", "Deleting", and "Deleted". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.ManagedNetworkProvisioningState """ - direction: Optional[Union[str, "_models.NspAccessRuleDirection"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Direction of Access Rule. Known values are: \"Inbound\" and \"Outbound\".""" - address_prefixes: Optional[list[str]] = rest_field( - name="addressPrefixes", visibility=["read", "create", "update", "delete", "query"] - ) - """Address prefixes for inbound rules.""" - subscriptions: Optional[list["_models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Subscriptions for inbound rules.""" - network_security_perimeters: Optional[list["_models.NetworkSecurityPerimeter"]] = rest_field( - name="networkSecurityPerimeters", visibility=["read", "create", "update", "delete", "query"] + managed_network: Optional["_models.ManagedNetworkSettingsEx"] = rest_field( + name="managedNetwork", visibility=["read", "create", "update", "delete", "query"] ) - """NetworkSecurityPerimeters for inbound rules.""" - fully_qualified_domain_names: Optional[list[str]] = rest_field( - name="fullyQualifiedDomainNames", visibility=["read", "create", "update", "delete", "query"] + """Managed Network settings for a cognitive services account.""" + provisioning_state: Optional[Union[str, "_models.ManagedNetworkProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] ) - """Fully qualified domain name for outbound rules.""" + """The current deployment state of the managed network resource. The provisioningState is to + indicate states for resource provisioning. Known values are: \"Deferred\", \"Updating\", + \"Succeeded\", \"Failed\", \"Deleting\", and \"Deleted\".""" @overload def __init__( self, *, - direction: Optional[Union[str, "_models.NspAccessRuleDirection"]] = None, - address_prefixes: Optional[list[str]] = None, - subscriptions: Optional[list["_models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem"]] = None, - network_security_perimeters: Optional[list["_models.NetworkSecurityPerimeter"]] = None, - fully_qualified_domain_names: Optional[list[str]] = None, + managed_network: Optional["_models.ManagedNetworkSettingsEx"] = None, ) -> None: ... @overload @@ -8172,23 +5071,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem( - _Model +class ManagedNetworkSettingsPropertiesBasicResource( + ProxyResource ): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Subscription for inbound rule. + """Concrete proxy resource types can be created by aliasing this type using a specific property + type. - :ivar id: Fully qualified identifier of subscription. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: The properties of the managed network settings of a cognitive services + account. + :vartype properties: ~azure.mgmt.cognitiveservices.models.ManagedNetworkSettingsProperties """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Fully qualified identifier of subscription.""" + properties: Optional["_models.ManagedNetworkSettingsProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The properties of the managed network settings of a cognitive services account.""" @overload def __init__( self, *, - id: Optional[str] = None, # pylint: disable=redefined-builtin + properties: Optional["_models.ManagedNetworkSettingsProperties"] = None, ) -> None: ... @overload @@ -8202,37 +5116,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NetworkSecurityPerimeterConfiguration( - ProxyResource -): # pylint: disable=docstring-keyword-should-match-keyword-only - """NSP Configuration for an Cognitive Services account. +class MetricName(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A metric name. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: NSP Configuration properties. - :vartype properties: - ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties + :ivar value: The name of the metric. + :vartype value: str + :ivar localized_value: The friendly name of the metric. + :vartype localized_value: str """ - properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the metric.""" + localized_value: Optional[str] = rest_field( + name="localizedValue", visibility=["read", "create", "update", "delete", "query"] ) - """NSP Configuration properties.""" + """The friendly name of the metric.""" @overload def __init__( self, *, - properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = None, + value: Optional[str] = None, + localized_value: Optional[str] = None, ) -> None: ... @overload @@ -8246,30 +5151,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NetworkSecurityPerimeterConfigurationAssociationInfo( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """Network Security Perimeter Configuration Association Information. +class Model(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services Model. - :ivar name: Name of the resource association. - :vartype name: str - :ivar access_mode: Access Mode of the resource association. - :vartype access_mode: str + :ivar model: Cognitive Services account Model. + :vartype model: ~azure.mgmt.cognitiveservices.models.AccountModel + :ivar kind: The kind (type) of cognitive service account. + :vartype kind: str + :ivar sku_name: The name of SKU. + :vartype sku_name: str + :ivar description: The description of the model. + :vartype description: str """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the resource association.""" - access_mode: Optional[str] = rest_field( - name="accessMode", visibility=["read", "create", "update", "delete", "query"] - ) - """Access Mode of the resource association.""" + model: Optional["_models.AccountModel"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Cognitive Services account Model.""" + kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kind (type) of cognitive service account.""" + sku_name: Optional[str] = rest_field(name="skuName", visibility=["read", "create", "update", "delete", "query"]) + """The name of SKU.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the model.""" @overload def __init__( self, *, - name: Optional[str] = None, - access_mode: Optional[str] = None, + model: Optional["_models.AccountModel"] = None, + kind: Optional[str] = None, + sku_name: Optional[str] = None, + description: Optional[str] = None, ) -> None: ... @overload @@ -8283,52 +5194,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NetworkSecurityPerimeterConfigurationProperties( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """The properties of an NSP Configuration. +class ModelCapacityCalculatorWorkload(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Model Capacity Calculator Workload. - :ivar provisioning_state: Provisioning state of NetworkSecurityPerimeter configuration. - :vartype provisioning_state: str - :ivar provisioning_issues: List of Provisioning Issues. - :vartype provisioning_issues: list[~azure.mgmt.cognitiveservices.models.ProvisioningIssue] - :ivar network_security_perimeter: Information about a linked Network Security Perimeter. - :vartype network_security_perimeter: - ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeter - :ivar resource_association: Network Security Perimeter Configuration Association Information. - :vartype resource_association: - ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfigurationAssociationInfo - :ivar profile: Network Security Perimeter Profile Information. - :vartype profile: ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo + :ivar request_per_minute: Request per minute. + :vartype request_per_minute: int + :ivar request_parameters: Dictionary, Model Capacity Calculator Workload Parameters. + :vartype request_parameters: + ~azure.mgmt.cognitiveservices.models.ModelCapacityCalculatorWorkloadRequestParam """ - provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) - """Provisioning state of NetworkSecurityPerimeter configuration.""" - provisioning_issues: Optional[list["_models.ProvisioningIssue"]] = rest_field( - name="provisioningIssues", visibility=["read", "create", "update", "delete", "query"] - ) - """List of Provisioning Issues.""" - network_security_perimeter: Optional["_models.NetworkSecurityPerimeter"] = rest_field( - name="networkSecurityPerimeter", visibility=["read", "create", "update", "delete", "query"] - ) - """Information about a linked Network Security Perimeter.""" - resource_association: Optional["_models.NetworkSecurityPerimeterConfigurationAssociationInfo"] = rest_field( - name="resourceAssociation", visibility=["read", "create", "update", "delete", "query"] + request_per_minute: Optional[int] = rest_field( + name="requestPerMinute", visibility=["read", "create", "update", "delete", "query"] ) - """Network Security Perimeter Configuration Association Information.""" - profile: Optional["_models.NetworkSecurityPerimeterProfileInfo"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """Request per minute.""" + request_parameters: Optional["_models.ModelCapacityCalculatorWorkloadRequestParam"] = rest_field( + name="requestParameters", visibility=["read", "create", "update", "delete", "query"] ) - """Network Security Perimeter Profile Information.""" + """Dictionary, Model Capacity Calculator Workload Parameters.""" @overload def __init__( self, *, - provisioning_issues: Optional[list["_models.ProvisioningIssue"]] = None, - network_security_perimeter: Optional["_models.NetworkSecurityPerimeter"] = None, - resource_association: Optional["_models.NetworkSecurityPerimeterConfigurationAssociationInfo"] = None, - profile: Optional["_models.NetworkSecurityPerimeterProfileInfo"] = None, + request_per_minute: Optional[int] = None, + request_parameters: Optional["_models.ModelCapacityCalculatorWorkloadRequestParam"] = None, ) -> None: ... @overload @@ -8342,49 +5232,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NetworkSecurityPerimeterProfileInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Network Security Perimeter Profile Information. - - :ivar name: Name of the resource profile. - :vartype name: str - :ivar access_rules_version: Access rules version of the resource profile. - :vartype access_rules_version: int - :ivar access_rules: - :vartype access_rules: - list[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterAccessRule] - :ivar diagnostic_settings_version: Current diagnostic settings version. - :vartype diagnostic_settings_version: int - :ivar enabled_log_categories: List of enabled log categories. - :vartype enabled_log_categories: list[str] - """ +class ModelCapacityCalculatorWorkloadRequestParam( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Dictionary, Model Capacity Calculator Workload Parameters. - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the resource profile.""" - access_rules_version: Optional[int] = rest_field( - name="accessRulesVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Access rules version of the resource profile.""" - access_rules: Optional[list["_models.NetworkSecurityPerimeterAccessRule"]] = rest_field( - name="accessRules", visibility=["read", "create", "update", "delete", "query"] - ) - diagnostic_settings_version: Optional[int] = rest_field( - name="diagnosticSettingsVersion", visibility=["read", "create", "update", "delete", "query"] + :ivar avg_prompt_tokens: Average prompt tokens. + :vartype avg_prompt_tokens: int + :ivar avg_generated_tokens: Average generated tokens. + :vartype avg_generated_tokens: int + """ + + avg_prompt_tokens: Optional[int] = rest_field( + name="avgPromptTokens", visibility=["read", "create", "update", "delete", "query"] ) - """Current diagnostic settings version.""" - enabled_log_categories: Optional[list[str]] = rest_field( - name="enabledLogCategories", visibility=["read", "create", "update", "delete", "query"] + """Average prompt tokens.""" + avg_generated_tokens: Optional[int] = rest_field( + name="avgGeneratedTokens", visibility=["read", "create", "update", "delete", "query"] ) - """List of enabled log categories.""" + """Average generated tokens.""" @overload def __init__( self, *, - name: Optional[str] = None, - access_rules_version: Optional[int] = None, - access_rules: Optional[list["_models.NetworkSecurityPerimeterAccessRule"]] = None, - diagnostic_settings_version: Optional[int] = None, - enabled_log_categories: Optional[list[str]] = None, + avg_prompt_tokens: Optional[int] = None, + avg_generated_tokens: Optional[int] = None, ) -> None: ... @overload @@ -8398,81 +5271,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NoneAuthTypeConnectionProperties( - ConnectionPropertiesV2, discriminator="None" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """NoneAuthTypeConnectionProperties. +class ModelCapacityListResultValueItem(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """ModelCapacityListResultValueItem. - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or ~azure.mgmt.cognitiveservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: Provides the error message if the connection fails. - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.mgmt.cognitiveservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Specifies how private endpoints are used with this connection: - 'Required', 'NotRequired', or 'NotApplicable'. Known values are: "Required", "NotRequired", and - "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.cognitiveservices.models.ManagedPERequirement - :ivar pe_status: Specifies the status of private endpoints for this connection: 'Inactive', - 'Active', or 'NotApplicable'. Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.cognitiveservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: The connection URL to be used. - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar auth_type: Authentication type of the connection target. Required. NONE. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.NONE + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar location: The location of the Model Sku Capacity. + :vartype location: str + :ivar properties: Cognitive Services account ModelSkuCapacity. + :vartype properties: ~azure.mgmt.cognitiveservices.models.ModelSkuCapacityProperties """ - auth_type: Literal[ConnectionAuthType.NONE] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. NONE.""" + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The location of the Model Sku Capacity.""" + properties: Optional["_models.ModelSkuCapacityProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Cognitive Services account ModelSkuCapacity.""" @overload def __init__( self, *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, + location: Optional[str] = None, + properties: Optional["_models.ModelSkuCapacityProperties"] = None, ) -> None: ... @overload @@ -8484,93 +5315,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.NONE # type: ignore -class OAuth2AuthTypeConnectionProperties( - ConnectionPropertiesV2, discriminator="OAuth2" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """OAuth2AuthTypeConnectionProperties. +class ModelDeprecationInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services account ModelDeprecationInfo. - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or ~azure.mgmt.cognitiveservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: Provides the error message if the connection fails. - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.mgmt.cognitiveservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Specifies how private endpoints are used with this connection: - 'Required', 'NotRequired', or 'NotApplicable'. Known values are: "Required", "NotRequired", and - "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.cognitiveservices.models.ManagedPERequirement - :ivar pe_status: Specifies the status of private endpoints for this connection: 'Inactive', - 'Active', or 'NotApplicable'. Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.cognitiveservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: The connection URL to be used. - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: ClientId and ClientSecret are required. Other properties are optional - depending on each OAuth2 provider's implementation. - :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionOAuth2 - :ivar auth_type: Authentication type of the connection target. Required. O_AUTH2. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.O_AUTH2 + :ivar fine_tune: The datetime of deprecation of the fineTune Model. + :vartype fine_tune: str + :ivar inference: The datetime of deprecation of the inference Model. + :vartype inference: str + :ivar deprecation_status: Indicates whether the deprecation date is a confirmed planned + end-of-life date or an estimated deprecation date. When 'Planned', the deprecation date + represents a confirmed and communicated model end-of-life date. When 'Tentative', the + deprecation date is an estimated timeline that may be subject to change. Known values are: + "Planned" and "Tentative". + :vartype deprecation_status: str or ~azure.mgmt.cognitiveservices.models.DeprecationStatus """ - credentials: Optional["_models.ConnectionOAuth2"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + fine_tune: Optional[str] = rest_field(name="fineTune", visibility=["read", "create", "update", "delete", "query"]) + """The datetime of deprecation of the fineTune Model.""" + inference: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The datetime of deprecation of the inference Model.""" + deprecation_status: Optional[Union[str, "_models.DeprecationStatus"]] = rest_field( + name="deprecationStatus", visibility=["read", "create", "update", "delete", "query"] ) - """ClientId and ClientSecret are required. Other properties are optional depending on each OAuth2 - provider's implementation.""" - auth_type: Literal[ConnectionAuthType.O_AUTH2] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. O_AUTH2.""" + """Indicates whether the deprecation date is a confirmed planned end-of-life date or an estimated + deprecation date. When 'Planned', the deprecation date represents a confirmed and communicated + model end-of-life date. When 'Tentative', the deprecation date is an estimated timeline that + may be subject to change. Known values are: \"Planned\" and \"Tentative\".""" @overload def __init__( self, *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.ConnectionOAuth2"] = None, + fine_tune: Optional[str] = None, + inference: Optional[str] = None, + deprecation_status: Optional[Union[str, "_models.DeprecationStatus"]] = None, ) -> None: ... @overload @@ -8582,53 +5362,56 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.O_AUTH2 # type: ignore -class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """REST API Operation. +class ModelSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Describes an available Cognitive Services Model SKU. - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :ivar name: The name of the model SKU. :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for Azure Resource Manager/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.cognitiveservices.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.cognitiveservices.models.Origin - :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions - that are for internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.cognitiveservices.models.ActionType + :ivar usage_name: The usage name of the model SKU. + :vartype usage_name: str + :ivar deprecation_date: The datetime of deprecation of the model SKU. + :vartype deprecation_date: ~datetime.datetime + :ivar capacity: The capacity configuration. + :vartype capacity: ~azure.mgmt.cognitiveservices.models.CapacityConfig + :ivar rate_limits: The list of rateLimit. + :vartype rate_limits: list[~azure.mgmt.cognitiveservices.models.CallRateLimit] + :ivar cost: The list of billing meter info. + :vartype cost: list[~azure.mgmt.cognitiveservices.models.BillingMeterInfo] """ - name: Optional[str] = rest_field(visibility=["read"]) - """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - \"Microsoft.Compute/virtualMachines/write\", - \"Microsoft.Compute/virtualMachines/capture/action\".""" - is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) - """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and - \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models.OperationDisplay"] = rest_field( + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the model SKU.""" + usage_name: Optional[str] = rest_field(name="usageName", visibility=["read", "create", "update", "delete", "query"]) + """The usage name of the model SKU.""" + deprecation_date: Optional[datetime.datetime] = rest_field( + name="deprecationDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The datetime of deprecation of the model SKU.""" + capacity: Optional["_models.CapacityConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The capacity configuration.""" + rate_limits: Optional[list["_models.CallRateLimit"]] = rest_field( + name="rateLimits", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of rateLimit.""" + cost: Optional[list["_models.BillingMeterInfo"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Localized display information for this particular operation.""" - origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and - \"user,system\".""" - action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) - """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for - internal only APIs. \"Internal\"""" + """The list of billing meter info.""" @overload def __init__( self, *, - display: Optional["_models.OperationDisplay"] = None, + name: Optional[str] = None, + usage_name: Optional[str] = None, + deprecation_date: Optional[datetime.datetime] = None, + capacity: Optional["_models.CapacityConfig"] = None, + rate_limits: Optional[list["_models.CallRateLimit"]] = None, + cost: Optional[list["_models.BillingMeterInfo"]] = None, ) -> None: ... @overload @@ -8642,53 +5425,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OperationDisplay(_Model): - """Localized display information for an operation. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - provider: Optional[str] = rest_field(visibility=["read"]) - """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring - Insights\" or \"Microsoft Compute\".""" - resource: Optional[str] = rest_field(visibility=["read"]) - """The localized friendly name of the resource type related to this operation. E.g. \"Virtual - Machines\" or \"Job Schedule Collections\".""" - operation: Optional[str] = rest_field(visibility=["read"]) - """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create - or Update Virtual Machine\", \"Restart Virtual Machine\".""" - description: Optional[str] = rest_field(visibility=["read"]) - """The short, localized friendly description of the operation; suitable for tool tips and detailed - views.""" - - -class OrganizationSharedBuiltInAuthorizationPolicy( - ApplicationAuthorizationPolicy, discriminator="OrganizationScope" -): # pylint: disable=name-too-long - """Built-in authorization policy scoped to organization/tenant. +class ModelSkuCapacityProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services account ModelSkuCapacity. - :ivar type: Authorization scheme type. Required. Claim-based, requires membership in the - tenant. - :vartype type: str or ~azure.mgmt.cognitiveservices.models.ORGANIZATION_SCOPE + :ivar model: Properties of Cognitive Services account deployment model. + :vartype model: ~azure.mgmt.cognitiveservices.models.DeploymentModel + :ivar sku_name: + :vartype sku_name: str + :ivar available_capacity: The available capacity for deployment with this model and sku. + :vartype available_capacity: float + :ivar available_finetune_capacity: The available capacity for deployment with a fine-tune + version of this model and sku. + :vartype available_finetune_capacity: float + :ivar scope_id: The scope identifier for model SKU capacity. + :vartype scope_id: str + :ivar scope_type: The scope type for model SKU capacity. Known values are: "Regional", + "Global", "DataZone", and "Classic". + :vartype scope_type: str or ~azure.mgmt.cognitiveservices.models.QuotaScopeType """ - type: Literal[BuiltInAuthorizationScheme.ORGANIZATION_SCOPE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authorization scheme type. Required. Claim-based, requires membership in the tenant.""" + model: Optional["_models.DeploymentModel"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Properties of Cognitive Services account deployment model.""" + sku_name: Optional[str] = rest_field(name="skuName", visibility=["read", "create", "update", "delete", "query"]) + available_capacity: Optional[float] = rest_field( + name="availableCapacity", visibility=["read", "create", "update", "delete", "query"] + ) + """The available capacity for deployment with this model and sku.""" + available_finetune_capacity: Optional[float] = rest_field( + name="availableFinetuneCapacity", visibility=["read", "create", "update", "delete", "query"] + ) + """The available capacity for deployment with a fine-tune version of this model and sku.""" + scope_id: Optional[str] = rest_field(name="scopeId", visibility=["read", "create", "update", "delete", "query"]) + """The scope identifier for model SKU capacity.""" + scope_type: Optional[Union[str, "_models.QuotaScopeType"]] = rest_field( + name="scopeType", visibility=["read", "create", "update", "delete", "query"] + ) + """The scope type for model SKU capacity. Known values are: \"Regional\", \"Global\", + \"DataZone\", and \"Classic\".""" @overload def __init__( self, + *, + model: Optional["_models.DeploymentModel"] = None, + sku_name: Optional[str] = None, + available_capacity: Optional[float] = None, + available_finetune_capacity: Optional[float] = None, + scope_id: Optional[str] = None, + scope_type: Optional[Union[str, "_models.QuotaScopeType"]] = None, ) -> None: ... @overload @@ -8700,37 +5484,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = BuiltInAuthorizationScheme.ORGANIZATION_SCOPE # type: ignore -class OutboundRuleBasicResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Concrete proxy resource types can be created by aliasing this type using a specific property - type. +class MultiRegionSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The multiregion settings Cognitive Services account. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Outbound Rule for the managed network of a cognitive services account. - Required. - :vartype properties: ~azure.mgmt.cognitiveservices.models.OutboundRule + :ivar routing_method: Multiregion routing methods. Known values are: "Priority", "Weighted", + and "Performance". + :vartype routing_method: str or ~azure.mgmt.cognitiveservices.models.RoutingMethods + :ivar regions: + :vartype regions: list[~azure.mgmt.cognitiveservices.models.RegionSetting] """ - properties: "_models.OutboundRule" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Outbound Rule for the managed network of a cognitive services account. Required.""" + routing_method: Optional[Union[str, "_models.RoutingMethods"]] = rest_field( + name="routingMethod", visibility=["read", "create", "update", "delete", "query"] + ) + """Multiregion routing methods. Known values are: \"Priority\", \"Weighted\", and \"Performance\".""" + regions: Optional[list["_models.RegionSetting"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - properties: "_models.OutboundRule", + routing_method: Optional[Union[str, "_models.RoutingMethods"]] = None, + regions: Optional[list["_models.RegionSetting"]] = None, ) -> None: ... @overload @@ -8744,87 +5523,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PATAuthTypeConnectionProperties( - ConnectionPropertiesV2, discriminator="PAT" -): # pylint: disable=docstring-keyword-should-match-keyword-only - """PATAuthTypeConnectionProperties. +class NetworkInjection(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Specifies in AI Foundry where virtual network injection occurs to secure scenarios like Agents + entirely within the user's private network, eliminating public internet exposure while + maintaining control over network configurations and resources. - :ivar category: Category of the connection. Known values are: "PythonFeed", - "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", - "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", - "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", - "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", - "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", - "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", - "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", - "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", - "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", - "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", - "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", - "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", - "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", - "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", - "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", - "PowerPlatformEnvironment", and "RemoteA2A". - :vartype category: str or ~azure.mgmt.cognitiveservices.models.ConnectionCategory - :ivar created_by_workspace_arm_id: - :vartype created_by_workspace_arm_id: str - :ivar error: Provides the error message if the connection fails. - :vartype error: str - :ivar expiry_time: - :vartype expiry_time: ~datetime.datetime - :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", - "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". - :vartype group: str or ~azure.mgmt.cognitiveservices.models.ConnectionGroup - :ivar is_shared_to_all: - :vartype is_shared_to_all: bool - :ivar metadata: Store user metadata for this connection. - :vartype metadata: dict[str, str] - :ivar pe_requirement: Specifies how private endpoints are used with this connection: - 'Required', 'NotRequired', or 'NotApplicable'. Known values are: "Required", "NotRequired", and - "NotApplicable". - :vartype pe_requirement: str or ~azure.mgmt.cognitiveservices.models.ManagedPERequirement - :ivar pe_status: Specifies the status of private endpoints for this connection: 'Inactive', - 'Active', or 'NotApplicable'. Known values are: "Inactive", "Active", and "NotApplicable". - :vartype pe_status: str or ~azure.mgmt.cognitiveservices.models.ManagedPEStatus - :ivar shared_user_list: - :vartype shared_user_list: list[str] - :ivar target: The connection URL to be used. - :vartype target: str - :ivar use_workspace_managed_identity: - :vartype use_workspace_managed_identity: bool - :ivar credentials: - :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionPersonalAccessToken - :ivar auth_type: Authentication type of the connection target. Required. PAT. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.PAT + :ivar scenario: Specifies what features in AI Foundry network injection applies to. Currently + only supports 'agent' for agent scenarios. 'none' means no network injection. Known values are: + "none" and "agent". + :vartype scenario: str or ~azure.mgmt.cognitiveservices.models.ScenarioType + :ivar subnet_arm_id: Specify the subnet for which your Agent Client is injected into. + :vartype subnet_arm_id: str + :ivar use_microsoft_managed_network: Boolean to enable Microsoft Managed Network for subnet + delegation. + :vartype use_microsoft_managed_network: bool """ - credentials: Optional["_models.ConnectionPersonalAccessToken"] = rest_field( + scenario: Optional[Union[str, "_models.ScenarioType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - auth_type: Literal[ConnectionAuthType.PAT] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Authentication type of the connection target. Required. PAT.""" + """Specifies what features in AI Foundry network injection applies to. Currently only supports + 'agent' for agent scenarios. 'none' means no network injection. Known values are: \"none\" and + \"agent\".""" + subnet_arm_id: Optional[str] = rest_field( + name="subnetArmId", visibility=["read", "create", "update", "delete", "query"] + ) + """Specify the subnet for which your Agent Client is injected into.""" + use_microsoft_managed_network: Optional[bool] = rest_field( + name="useMicrosoftManagedNetwork", visibility=["read", "create", "update", "delete", "query"] + ) + """Boolean to enable Microsoft Managed Network for subnet delegation.""" @overload def __init__( self, *, - category: Optional[Union[str, "_models.ConnectionCategory"]] = None, - error: Optional[str] = None, - expiry_time: Optional[datetime.datetime] = None, - is_shared_to_all: Optional[bool] = None, - metadata: Optional[dict[str, str]] = None, - pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, - pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, - shared_user_list: Optional[list[str]] = None, - target: Optional[str] = None, - use_workspace_managed_identity: Optional[bool] = None, - credentials: Optional["_models.ConnectionPersonalAccessToken"] = None, + scenario: Optional[Union[str, "_models.ScenarioType"]] = None, + subnet_arm_id: Optional[str] = None, + use_microsoft_managed_network: Optional[bool] = None, ) -> None: ... @overload @@ -8836,24 +5572,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.auth_type = ConnectionAuthType.PAT # type: ignore -class PatchResourceSku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The object being used to update sku of a resource, in general used for PATCH operations. +class NetworkRuleSet(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A set of rules governing the network accessibility. - :ivar sku: The resource model definition representing SKU. - :vartype sku: ~azure.mgmt.cognitiveservices.models.Sku + :ivar default_action: The default action when no rule from ipRules and from virtualNetworkRules + match. This is only used after the bypass property has been evaluated. Known values are: + "Allow" and "Deny". + :vartype default_action: str or ~azure.mgmt.cognitiveservices.models.NetworkRuleAction + :ivar bypass: Setting for trusted services. Known values are: "None" and "AzureServices". + :vartype bypass: str or ~azure.mgmt.cognitiveservices.models.ByPassSelection + :ivar ip_rules: The list of IP address rules. + :vartype ip_rules: list[~azure.mgmt.cognitiveservices.models.IpRule] + :ivar virtual_network_rules: The list of virtual network rules. + :vartype virtual_network_rules: list[~azure.mgmt.cognitiveservices.models.VirtualNetworkRule] """ - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource model definition representing SKU.""" + default_action: Optional[Union[str, "_models.NetworkRuleAction"]] = rest_field( + name="defaultAction", visibility=["read", "create", "update", "delete", "query"] + ) + """The default action when no rule from ipRules and from virtualNetworkRules match. This is only + used after the bypass property has been evaluated. Known values are: \"Allow\" and \"Deny\".""" + bypass: Optional[Union[str, "_models.ByPassSelection"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Setting for trusted services. Known values are: \"None\" and \"AzureServices\".""" + ip_rules: Optional[list["_models.IpRule"]] = rest_field( + name="ipRules", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of IP address rules.""" + virtual_network_rules: Optional[list["_models.VirtualNetworkRule"]] = rest_field( + name="virtualNetworkRules", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of virtual network rules.""" @overload def __init__( self, *, - sku: Optional["_models.Sku"] = None, + default_action: Optional[Union[str, "_models.NetworkRuleAction"]] = None, + bypass: Optional[Union[str, "_models.ByPassSelection"]] = None, + ip_rules: Optional[list["_models.IpRule"]] = None, + virtual_network_rules: Optional[list["_models.VirtualNetworkRule"]] = None, ) -> None: ... @overload @@ -8867,21 +5628,33 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PatchResourceTags(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The object being used to update tags of a resource, in general used for PATCH operations. +class NetworkSecurityPerimeter(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Information about a linked Network Security Perimeter. - :ivar tags: Resource tags. - :vartype tags: dict[str, str] + :ivar id: Fully qualified identifier of the resource. + :vartype id: str + :ivar perimeter_guid: Guid of the resource. + :vartype perimeter_guid: str + :ivar location: Location of the resource. + :vartype location: str """ - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) - """Resource tags.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified identifier of the resource.""" + perimeter_guid: Optional[str] = rest_field( + name="perimeterGuid", visibility=["read", "create", "update", "delete", "query"] + ) + """Guid of the resource.""" + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Location of the resource.""" @overload def __init__( self, *, - tags: Optional[dict[str, str]] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + perimeter_guid: Optional[str] = None, + location: Optional[str] = None, ) -> None: ... @overload @@ -8895,25 +5668,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PatchResourceTagsAndSku(PatchResourceTags): # pylint: disable=docstring-keyword-should-match-keyword-only - """The object being used to update tags and sku of a resource, in general used for PATCH - operations. +class NetworkSecurityPerimeterAccessRule(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Network Security Perimeter Access Rule. - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: The resource model definition representing SKU. - :vartype sku: ~azure.mgmt.cognitiveservices.models.Sku + :ivar name: Network Security Perimeter Access Rule Name. + :vartype name: str + :ivar properties: Properties of Network Security Perimeter Access Rule. + :vartype properties: + ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties """ - sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The resource model definition representing SKU.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Network Security Perimeter Access Rule Name.""" + properties: Optional["_models.NetworkSecurityPerimeterAccessRuleProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of Network Security Perimeter Access Rule.""" @overload def __init__( self, *, - tags: Optional[dict[str, str]] = None, - sku: Optional["_models.Sku"] = None, + name: Optional[str] = None, + properties: Optional["_models.NetworkSecurityPerimeterAccessRuleProperties"] = None, ) -> None: ... @overload @@ -8927,67 +5704,55 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PolicyAssignmentEvaluationDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Details of a non-compliant policy assignment. +class NetworkSecurityPerimeterAccessRuleProperties( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The Properties of Network Security Perimeter Rule. - :ivar assignment_id: The policy assignment ID. - :vartype assignment_id: str - :ivar policy_definition_id: The policy definition ID. - :vartype policy_definition_id: str - :ivar policy_set_definition_id: The policy set definition ID. - :vartype policy_set_definition_id: str - :ivar evaluation_outcome: The evaluation outcome for this assignment. Known values are: - "Compliant", "NonCompliant", and "Error". - :vartype evaluation_outcome: str or - ~azure.mgmt.cognitiveservices.models.PolicyEvaluationOutcome - :ivar non_compliance_reason: The reason for non-compliance. - :vartype non_compliance_reason: str - :ivar effect: The policy effect (e.g., Deny, Audit). - :vartype effect: str - :ivar expression_evaluations: Expression-level evaluation details. - :vartype expression_evaluations: - list[~azure.mgmt.cognitiveservices.models.PolicyExpressionEvaluationDetails] + :ivar direction: Direction of Access Rule. Known values are: "Inbound" and "Outbound". + :vartype direction: str or ~azure.mgmt.cognitiveservices.models.NspAccessRuleDirection + :ivar address_prefixes: Address prefixes for inbound rules. + :vartype address_prefixes: list[str] + :ivar subscriptions: Subscriptions for inbound rules. + :vartype subscriptions: + list[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem] + :ivar network_security_perimeters: NetworkSecurityPerimeters for inbound rules. + :vartype network_security_perimeters: + list[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeter] + :ivar fully_qualified_domain_names: Fully qualified domain name for outbound rules. + :vartype fully_qualified_domain_names: list[str] """ - assignment_id: Optional[str] = rest_field( - name="assignmentId", visibility=["read", "create", "update", "delete", "query"] - ) - """The policy assignment ID.""" - policy_definition_id: Optional[str] = rest_field( - name="policyDefinitionId", visibility=["read", "create", "update", "delete", "query"] + direction: Optional[Union[str, "_models.NspAccessRuleDirection"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The policy definition ID.""" - policy_set_definition_id: Optional[str] = rest_field( - name="policySetDefinitionId", visibility=["read", "create", "update", "delete", "query"] + """Direction of Access Rule. Known values are: \"Inbound\" and \"Outbound\".""" + address_prefixes: Optional[list[str]] = rest_field( + name="addressPrefixes", visibility=["read", "create", "update", "delete", "query"] ) - """The policy set definition ID.""" - evaluation_outcome: Optional[Union[str, "_models.PolicyEvaluationOutcome"]] = rest_field( - name="evaluationOutcome", visibility=["read", "create", "update", "delete", "query"] + """Address prefixes for inbound rules.""" + subscriptions: Optional[list["_models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The evaluation outcome for this assignment. Known values are: \"Compliant\", \"NonCompliant\", - and \"Error\".""" - non_compliance_reason: Optional[str] = rest_field( - name="nonComplianceReason", visibility=["read", "create", "update", "delete", "query"] + """Subscriptions for inbound rules.""" + network_security_perimeters: Optional[list["_models.NetworkSecurityPerimeter"]] = rest_field( + name="networkSecurityPerimeters", visibility=["read", "create", "update", "delete", "query"] ) - """The reason for non-compliance.""" - effect: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The policy effect (e.g., Deny, Audit).""" - expression_evaluations: Optional[list["_models.PolicyExpressionEvaluationDetails"]] = rest_field( - name="expressionEvaluations", visibility=["read", "create", "update", "delete", "query"] + """NetworkSecurityPerimeters for inbound rules.""" + fully_qualified_domain_names: Optional[list[str]] = rest_field( + name="fullyQualifiedDomainNames", visibility=["read", "create", "update", "delete", "query"] ) - """Expression-level evaluation details.""" + """Fully qualified domain name for outbound rules.""" @overload def __init__( self, *, - assignment_id: Optional[str] = None, - policy_definition_id: Optional[str] = None, - policy_set_definition_id: Optional[str] = None, - evaluation_outcome: Optional[Union[str, "_models.PolicyEvaluationOutcome"]] = None, - non_compliance_reason: Optional[str] = None, - effect: Optional[str] = None, - expression_evaluations: Optional[list["_models.PolicyExpressionEvaluationDetails"]] = None, + direction: Optional[Union[str, "_models.NspAccessRuleDirection"]] = None, + address_prefixes: Optional[list[str]] = None, + subscriptions: Optional[list["_models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem"]] = None, + network_security_perimeters: Optional[list["_models.NetworkSecurityPerimeter"]] = None, + fully_qualified_domain_names: Optional[list[str]] = None, ) -> None: ... @overload @@ -9001,52 +5766,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PolicyExpressionEvaluationDetails(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Details of a policy expression evaluation. +class NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Subscription for inbound rule. - :ivar expression: The policy expression. - :vartype expression: str - :ivar expression_kind: The kind of expression. - :vartype expression_kind: str - :ivar operator: The operator used in evaluation. - :vartype operator: str - :ivar result: The evaluation result. - :vartype result: str - :ivar target_value: The target value of the expression. - :vartype target_value: str - :ivar expression_value: The actual value of the expression. - :vartype expression_value: str + :ivar id: Fully qualified identifier of subscription. + :vartype id: str """ - expression: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The policy expression.""" - expression_kind: Optional[str] = rest_field( - name="expressionKind", visibility=["read", "create", "update", "delete", "query"] - ) - """The kind of expression.""" - operator: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The operator used in evaluation.""" - result: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The evaluation result.""" - target_value: Optional[str] = rest_field( - name="targetValue", visibility=["read", "create", "update", "delete", "query"] - ) - """The target value of the expression.""" - expression_value: Optional[str] = rest_field( - name="expressionValue", visibility=["read", "create", "update", "delete", "query"] - ) - """The actual value of the expression.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified identifier of subscription.""" @overload def __init__( self, *, - expression: Optional[str] = None, - expression_kind: Optional[str] = None, - operator: Optional[str] = None, - result: Optional[str] = None, - target_value: Optional[str] = None, - expression_value: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -9060,38 +5796,37 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Pool(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A compute pool configuration. +class NetworkSecurityPerimeterConfiguration( + ProxyResource +): # pylint: disable=docstring-keyword-should-match-keyword-only + """NSP Configuration for an Cognitive Services account. - :ivar name: The name of the pool. Required. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. :vartype name: str - :ivar vm_priority: The VM priority of the pool. Known values are: "Regular" and "Spot". - :vartype vm_priority: str or ~azure.mgmt.cognitiveservices.models.VmPriority - :ivar instance_type: The instance type (VM SKU) used in the pool. Required. - :vartype instance_type: str - :ivar node_count: The number of nodes in the pool. Required. - :vartype node_count: int + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: NSP Configuration properties. + :vartype properties: + ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties """ - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the pool. Required.""" - vm_priority: Optional[Union[str, "_models.VmPriority"]] = rest_field( - name="vmPriority", visibility=["read", "create", "update", "delete", "query"] + properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The VM priority of the pool. Known values are: \"Regular\" and \"Spot\".""" - instance_type: str = rest_field(name="instanceType", visibility=["read", "create", "update", "delete", "query"]) - """The instance type (VM SKU) used in the pool. Required.""" - node_count: int = rest_field(name="nodeCount", visibility=["read", "create", "update", "delete", "query"]) - """The number of nodes in the pool. Required.""" + """NSP Configuration properties.""" @overload def __init__( self, *, - name: str, - instance_type: str, - node_count: int, - vm_priority: Optional[Union[str, "_models.VmPriority"]] = None, + properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = None, ) -> None: ... @overload @@ -9105,54 +5840,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateEndpoint(_Model): - """The private endpoint resource. - - :ivar id: The resource identifier of the private endpoint. - :vartype id: str - """ - - id: Optional[str] = rest_field(visibility=["read"]) - """The resource identifier of the private endpoint.""" - - -class PrivateEndpointConnection(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """The Private Endpoint Connection resource. +class NetworkSecurityPerimeterConfigurationAssociationInfo( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Network Security Perimeter Configuration Association Information. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. + :ivar name: Name of the resource association. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Resource properties. - :vartype properties: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionProperties - :ivar etag: Resource Etag. - :vartype etag: str - :ivar location: The location of the private endpoint connection. - :vartype location: str + :ivar access_mode: Access Mode of the resource association. + :vartype access_mode: str """ - properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the resource association.""" + access_mode: Optional[str] = rest_field( + name="accessMode", visibility=["read", "create", "update", "delete", "query"] ) - """Resource properties.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource Etag.""" - location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The location of the private endpoint connection.""" + """Access Mode of the resource association.""" @overload def __init__( self, *, - properties: Optional["_models.PrivateEndpointConnectionProperties"] = None, - location: Optional[str] = None, + name: Optional[str] = None, + access_mode: Optional[str] = None, ) -> None: ... @overload @@ -9166,23 +5877,52 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateEndpointConnectionListResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A list of private endpoint connections. +class NetworkSecurityPerimeterConfigurationProperties( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The properties of an NSP Configuration. - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] + :ivar provisioning_state: Provisioning state of NetworkSecurityPerimeter configuration. + :vartype provisioning_state: str + :ivar provisioning_issues: List of Provisioning Issues. + :vartype provisioning_issues: list[~azure.mgmt.cognitiveservices.models.ProvisioningIssue] + :ivar network_security_perimeter: Information about a linked Network Security Perimeter. + :vartype network_security_perimeter: + ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeter + :ivar resource_association: Network Security Perimeter Configuration Association Information. + :vartype resource_association: + ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfigurationAssociationInfo + :ivar profile: Network Security Perimeter Profile Information. + :vartype profile: ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo """ - value: Optional[list["_models.PrivateEndpointConnection"]] = rest_field( + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """Provisioning state of NetworkSecurityPerimeter configuration.""" + provisioning_issues: Optional[list["_models.ProvisioningIssue"]] = rest_field( + name="provisioningIssues", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Provisioning Issues.""" + network_security_perimeter: Optional["_models.NetworkSecurityPerimeter"] = rest_field( + name="networkSecurityPerimeter", visibility=["read", "create", "update", "delete", "query"] + ) + """Information about a linked Network Security Perimeter.""" + resource_association: Optional["_models.NetworkSecurityPerimeterConfigurationAssociationInfo"] = rest_field( + name="resourceAssociation", visibility=["read", "create", "update", "delete", "query"] + ) + """Network Security Perimeter Configuration Association Information.""" + profile: Optional["_models.NetworkSecurityPerimeterProfileInfo"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Array of private endpoint connections.""" + """Network Security Perimeter Profile Information.""" @overload def __init__( self, *, - value: Optional[list["_models.PrivateEndpointConnection"]] = None, + provisioning_issues: Optional[list["_models.ProvisioningIssue"]] = None, + network_security_perimeter: Optional["_models.NetworkSecurityPerimeter"] = None, + resource_association: Optional["_models.NetworkSecurityPerimeterConfigurationAssociationInfo"] = None, + profile: Optional["_models.NetworkSecurityPerimeterProfileInfo"] = None, ) -> None: ... @overload @@ -9196,49 +5936,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateEndpointConnectionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of the PrivateEndpointConnectProperties. +class NetworkSecurityPerimeterProfileInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Network Security Perimeter Profile Information. - :ivar private_endpoint: The resource of private end point. - :vartype private_endpoint: ~azure.mgmt.cognitiveservices.models.PrivateEndpoint - :ivar private_link_service_connection_state: A collection of information about the state of the - connection between service consumer and provider. Required. - :vartype private_link_service_connection_state: - ~azure.mgmt.cognitiveservices.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The provisioning state of the private endpoint connection resource. - Known values are: "Succeeded", "Creating", "Deleting", and "Failed". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionProvisioningState - :ivar group_ids: The private link resource group ids. - :vartype group_ids: list[str] + :ivar name: Name of the resource profile. + :vartype name: str + :ivar access_rules_version: Access rules version of the resource profile. + :vartype access_rules_version: int + :ivar access_rules: + :vartype access_rules: + list[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterAccessRule] + :ivar diagnostic_settings_version: Current diagnostic settings version. + :vartype diagnostic_settings_version: int + :ivar enabled_log_categories: List of enabled log categories. + :vartype enabled_log_categories: list[str] """ - private_endpoint: Optional["_models.PrivateEndpoint"] = rest_field( - name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"] + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the resource profile.""" + access_rules_version: Optional[int] = rest_field( + name="accessRulesVersion", visibility=["read", "create", "update", "delete", "query"] ) - """The resource of private end point.""" - private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState" = rest_field( - name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"] + """Access rules version of the resource profile.""" + access_rules: Optional[list["_models.NetworkSecurityPerimeterAccessRule"]] = rest_field( + name="accessRules", visibility=["read", "create", "update", "delete", "query"] ) - """A collection of information about the state of the connection between service consumer and - provider. Required.""" - provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] + diagnostic_settings_version: Optional[int] = rest_field( + name="diagnosticSettingsVersion", visibility=["read", "create", "update", "delete", "query"] ) - """The provisioning state of the private endpoint connection resource. Known values are: - \"Succeeded\", \"Creating\", \"Deleting\", and \"Failed\".""" - group_ids: Optional[list[str]] = rest_field( - name="groupIds", visibility=["read", "create", "update", "delete", "query"] + """Current diagnostic settings version.""" + enabled_log_categories: Optional[list[str]] = rest_field( + name="enabledLogCategories", visibility=["read", "create", "update", "delete", "query"] ) - """The private link resource group ids.""" + """List of enabled log categories.""" @overload def __init__( self, *, - private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState", - private_endpoint: Optional["_models.PrivateEndpoint"] = None, - group_ids: Optional[list[str]] = None, + name: Optional[str] = None, + access_rules_version: Optional[int] = None, + access_rules: Optional[list["_models.NetworkSecurityPerimeterAccessRule"]] = None, + diagnostic_settings_version: Optional[int] = None, + enabled_log_categories: Optional[list[str]] = None, ) -> None: ... @overload @@ -9252,50 +5992,81 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateEndpointOutboundRule( - OutboundRule, discriminator="PrivateEndpoint" +class NoneAuthTypeConnectionProperties( + ConnectionPropertiesV2, discriminator="None" ): # pylint: disable=docstring-keyword-should-match-keyword-only - """Private Endpoint outbound rule for the managed network of a cognitive services account. + """NoneAuthTypeConnectionProperties. - :ivar category: Category of a managed network Outbound Rule of a cognitive services account. - Known values are: "Required", "Recommended", "UserDefined", and "Dependency". - :vartype category: str or ~azure.mgmt.cognitiveservices.models.RuleCategory - :ivar status: Type of a managed network Outbound Rule of a cognitive services account. Known - values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". - :vartype status: str or ~azure.mgmt.cognitiveservices.models.RuleStatus - :ivar error_information: Error information about an outbound rule of a cognitive services - account if RuleStatus is failed. - :vartype error_information: str - :ivar parent_rule_names: - :vartype parent_rule_names: list[str] - :ivar destination: Private Endpoint destination. - :vartype destination: - ~azure.mgmt.cognitiveservices.models.PrivateEndpointOutboundRuleDestination - :ivar fqdns: List of FQDNs associated with the private endpoint outbound rule. - :vartype fqdns: list[str] - :ivar type: Type of a managed network Outbound Rule of a cognitive services account. Required. - PRIVATE_ENDPOINT. - :vartype type: str or ~azure.mgmt.cognitiveservices.models.PRIVATE_ENDPOINT + :ivar category: Category of the connection. Known values are: "PythonFeed", + "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", + "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", + "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", + "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", + "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", + "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", + "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", + "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", + "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", + "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", + "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", + "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", + "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", + "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", + "PowerPlatformEnvironment", and "RemoteA2A". + :vartype category: str or ~azure.mgmt.cognitiveservices.models.ConnectionCategory + :ivar created_by_workspace_arm_id: + :vartype created_by_workspace_arm_id: str + :ivar error: Provides the error message if the connection fails. + :vartype error: str + :ivar expiry_time: + :vartype expiry_time: ~datetime.datetime + :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", + "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". + :vartype group: str or ~azure.mgmt.cognitiveservices.models.ConnectionGroup + :ivar is_shared_to_all: + :vartype is_shared_to_all: bool + :ivar metadata: Store user metadata for this connection. + :vartype metadata: dict[str, str] + :ivar pe_requirement: Specifies how private endpoints are used with this connection: + 'Required', 'NotRequired', or 'NotApplicable'. Known values are: "Required", "NotRequired", and + "NotApplicable". + :vartype pe_requirement: str or ~azure.mgmt.cognitiveservices.models.ManagedPERequirement + :ivar pe_status: Specifies the status of private endpoints for this connection: 'Inactive', + 'Active', or 'NotApplicable'. Known values are: "Inactive", "Active", and "NotApplicable". + :vartype pe_status: str or ~azure.mgmt.cognitiveservices.models.ManagedPEStatus + :ivar shared_user_list: + :vartype shared_user_list: list[str] + :ivar target: The connection URL to be used. + :vartype target: str + :ivar use_workspace_managed_identity: + :vartype use_workspace_managed_identity: bool + :ivar auth_type: Authentication type of the connection target. Required. NONE. + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ - destination: Optional["_models.PrivateEndpointOutboundRuleDestination"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Private Endpoint destination.""" - fqdns: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of FQDNs associated with the private endpoint outbound rule.""" - type: Literal[RuleType.PRIVATE_ENDPOINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Type of a managed network Outbound Rule of a cognitive services account. Required. - PRIVATE_ENDPOINT.""" + auth_type: Literal[ConnectionAuthType.NONE] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Authentication type of the connection target. Required. NONE.""" @overload def __init__( self, *, - category: Optional[Union[str, "_models.RuleCategory"]] = None, - status: Optional[Union[str, "_models.RuleStatus"]] = None, - destination: Optional["_models.PrivateEndpointOutboundRuleDestination"] = None, - fqdns: Optional[list[str]] = None, + category: Optional[Union[str, "_models.ConnectionCategory"]] = None, + error: Optional[str] = None, + expiry_time: Optional[datetime.datetime] = None, + is_shared_to_all: Optional[bool] = None, + metadata: Optional[dict[str, str]] = None, + pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, + pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, + shared_user_list: Optional[list[str]] = None, + target: Optional[str] = None, + use_workspace_managed_identity: Optional[bool] = None, ) -> None: ... @overload @@ -9307,33 +6078,93 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = RuleType.PRIVATE_ENDPOINT # type: ignore + self.auth_type = ConnectionAuthType.NONE # type: ignore -class PrivateEndpointOutboundRuleDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Private Endpoint destination for an outbound rule. +class OAuth2AuthTypeConnectionProperties( + ConnectionPropertiesV2, discriminator="OAuth2" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """OAuth2AuthTypeConnectionProperties. - :ivar service_resource_id: The Azure resource ID of the target private endpoint service. - :vartype service_resource_id: str - :ivar subresource_target: The subresource of the target service to connect to. - :vartype subresource_target: str + :ivar category: Category of the connection. Known values are: "PythonFeed", + "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", + "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", + "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", + "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", + "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", + "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", + "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", + "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", + "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", + "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", + "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", + "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", + "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", + "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", + "PowerPlatformEnvironment", and "RemoteA2A". + :vartype category: str or ~azure.mgmt.cognitiveservices.models.ConnectionCategory + :ivar created_by_workspace_arm_id: + :vartype created_by_workspace_arm_id: str + :ivar error: Provides the error message if the connection fails. + :vartype error: str + :ivar expiry_time: + :vartype expiry_time: ~datetime.datetime + :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", + "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". + :vartype group: str or ~azure.mgmt.cognitiveservices.models.ConnectionGroup + :ivar is_shared_to_all: + :vartype is_shared_to_all: bool + :ivar metadata: Store user metadata for this connection. + :vartype metadata: dict[str, str] + :ivar pe_requirement: Specifies how private endpoints are used with this connection: + 'Required', 'NotRequired', or 'NotApplicable'. Known values are: "Required", "NotRequired", and + "NotApplicable". + :vartype pe_requirement: str or ~azure.mgmt.cognitiveservices.models.ManagedPERequirement + :ivar pe_status: Specifies the status of private endpoints for this connection: 'Inactive', + 'Active', or 'NotApplicable'. Known values are: "Inactive", "Active", and "NotApplicable". + :vartype pe_status: str or ~azure.mgmt.cognitiveservices.models.ManagedPEStatus + :ivar shared_user_list: + :vartype shared_user_list: list[str] + :ivar target: The connection URL to be used. + :vartype target: str + :ivar use_workspace_managed_identity: + :vartype use_workspace_managed_identity: bool + :ivar credentials: ClientId and ClientSecret are required. Other properties are optional + depending on each OAuth2 provider's implementation. + :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionOAuth2 + :ivar auth_type: Authentication type of the connection target. Required. O_AUTH2. + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ - service_resource_id: Optional[str] = rest_field( - name="serviceResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """The Azure resource ID of the target private endpoint service.""" - subresource_target: Optional[str] = rest_field( - name="subresourceTarget", visibility=["read", "create", "update", "delete", "query"] + credentials: Optional["_models.ConnectionOAuth2"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The subresource of the target service to connect to.""" + """ClientId and ClientSecret are required. Other properties are optional depending on each OAuth2 + provider's implementation.""" + auth_type: Literal[ConnectionAuthType.O_AUTH2] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Authentication type of the connection target. Required. O_AUTH2.""" @overload def __init__( self, *, - service_resource_id: Optional[str] = None, - subresource_target: Optional[str] = None, + category: Optional[Union[str, "_models.ConnectionCategory"]] = None, + error: Optional[str] = None, + expiry_time: Optional[datetime.datetime] = None, + is_shared_to_all: Optional[bool] = None, + metadata: Optional[dict[str, str]] = None, + pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, + pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, + shared_user_list: Optional[list[str]] = None, + target: Optional[str] = None, + use_workspace_managed_identity: Optional[bool] = None, + credentials: Optional["_models.ConnectionOAuth2"] = None, ) -> None: ... @overload @@ -9345,36 +6176,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.auth_type = ConnectionAuthType.O_AUTH2 # type: ignore -class PrivateLinkResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only - """A private link resource. +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """REST API Operation. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Resource properties. - :vartype properties: ~azure.mgmt.cognitiveservices.models.PrivateLinkResourceProperties + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.cognitiveservices.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.cognitiveservices.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.cognitiveservices.models.ActionType """ - properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field( + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Resource properties.""" + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and + \"user,system\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" @overload def __init__( self, *, - properties: Optional["_models.PrivateLinkResourceProperties"] = None, + display: Optional["_models.OperationDisplay"] = None, ) -> None: ... @overload @@ -9388,23 +6236,53 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateLinkResourceListResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A list of private link resources. +class OperationDisplay(_Model): + """Localized display information for an operation. - :ivar value: Array of private link resources. - :vartype value: list[~azure.mgmt.cognitiveservices.models.PrivateLinkResource] + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str """ - value: Optional[list["_models.PrivateLinkResource"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Array of private link resources.""" + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" + + +class OrganizationSharedBuiltInAuthorizationPolicy( + ApplicationAuthorizationPolicy, discriminator="OrganizationScope" +): # pylint: disable=name-too-long + """Built-in authorization policy scoped to organization/tenant. + + :ivar type: Authorization scheme type. Required. Claim-based, requires membership in the + tenant. + :vartype type: str or ~azure.mgmt.cognitiveservices.models.BuiltInAuthorizationScheme + """ + + type: Literal[BuiltInAuthorizationScheme.ORGANIZATION_SCOPE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Authorization scheme type. Required. Claim-based, requires membership in the tenant.""" @overload def __init__( self, - *, - value: Optional[list["_models.PrivateLinkResource"]] = None, ) -> None: ... @overload @@ -9416,37 +6294,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = BuiltInAuthorizationScheme.ORGANIZATION_SCOPE # type: ignore -class PrivateLinkResourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a private link resource. +class OutboundRuleBasicResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Concrete proxy resource types can be created by aliasing this type using a specific property + type. - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - :ivar display_name: The private link resource display name. - :vartype display_name: str + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: Outbound Rule for the managed network of a cognitive services account. + Required. + :vartype properties: ~azure.mgmt.cognitiveservices.models.OutboundRule """ - group_id: Optional[str] = rest_field(name="groupId", visibility=["read"]) - """The private link resource group id.""" - required_members: Optional[list[str]] = rest_field(name="requiredMembers", visibility=["read"]) - """The private link resource required member names.""" - required_zone_names: Optional[list[str]] = rest_field( - name="requiredZoneNames", visibility=["read", "create", "update", "delete", "query"] - ) - """The private link resource Private link DNS zone name.""" - display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) - """The private link resource display name.""" + properties: "_models.OutboundRule" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Outbound Rule for the managed network of a cognitive services account. Required.""" @overload def __init__( self, *, - required_zone_names: Optional[list[str]] = None, + properties: "_models.OutboundRule", ) -> None: ... @overload @@ -9460,40 +6338,87 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateLinkServiceConnectionState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A collection of information about the state of the connection between service consumer and - provider. +class PATAuthTypeConnectionProperties( + ConnectionPropertiesV2, discriminator="PAT" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """PATAuthTypeConnectionProperties. - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Known values are: "Pending", "Approved", and "Rejected". - :vartype status: str or - ~azure.mgmt.cognitiveservices.models.PrivateEndpointServiceConnectionStatus - :ivar description: The reason for approval/rejection of the connection. - :vartype description: str - :ivar actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :vartype actions_required: str + :ivar category: Category of the connection. Known values are: "PythonFeed", + "ContainerRegistry", "Git", "S3", "Snowflake", "AzureKeyVault", "AzureSqlDb", + "AzureSynapseAnalytics", "AzureMySqlDb", "AzurePostgresDb", "ADLSGen2", + "AzureContainerAppEnvironment", "Redis", "ApiKey", "AzureOpenAI", "AIServices", + "CognitiveSearch", "CognitiveService", "CustomKeys", "AzureBlob", "AzureStorageAccount", + "AzureOneLake", "CosmosDb", "CosmosDbMongoDbApi", "AzureDataExplorer", "AzureMariaDb", + "AzureDatabricksDeltaLake", "AzureSqlMi", "AzureTableStorage", "AmazonRdsForOracle", + "AmazonRdsForSqlServer", "AmazonRedshift", "Db2", "Drill", "GoogleBigQuery", "Greenplum", + "Hbase", "Hive", "Impala", "Informix", "MariaDb", "MicrosoftAccess", "MySql", "Netezza", + "Oracle", "Phoenix", "PostgreSql", "Presto", "SapOpenHub", "SapBw", "SapHana", "SapTable", + "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", + "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", + "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", + "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", + "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", + "PowerPlatformEnvironment", and "RemoteA2A". + :vartype category: str or ~azure.mgmt.cognitiveservices.models.ConnectionCategory + :ivar created_by_workspace_arm_id: + :vartype created_by_workspace_arm_id: str + :ivar error: Provides the error message if the connection fails. + :vartype error: str + :ivar expiry_time: + :vartype expiry_time: ~datetime.datetime + :ivar group: Group based on connection category. Known values are: "Azure", "AzureAI", + "Database", "NoSQL", "File", "GenericProtocol", and "ServicesAndApps". + :vartype group: str or ~azure.mgmt.cognitiveservices.models.ConnectionGroup + :ivar is_shared_to_all: + :vartype is_shared_to_all: bool + :ivar metadata: Store user metadata for this connection. + :vartype metadata: dict[str, str] + :ivar pe_requirement: Specifies how private endpoints are used with this connection: + 'Required', 'NotRequired', or 'NotApplicable'. Known values are: "Required", "NotRequired", and + "NotApplicable". + :vartype pe_requirement: str or ~azure.mgmt.cognitiveservices.models.ManagedPERequirement + :ivar pe_status: Specifies the status of private endpoints for this connection: 'Inactive', + 'Active', or 'NotApplicable'. Known values are: "Inactive", "Active", and "NotApplicable". + :vartype pe_status: str or ~azure.mgmt.cognitiveservices.models.ManagedPEStatus + :ivar shared_user_list: + :vartype shared_user_list: list[str] + :ivar target: The connection URL to be used. + :vartype target: str + :ivar use_workspace_managed_identity: + :vartype use_workspace_managed_identity: bool + :ivar credentials: + :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionPersonalAccessToken + :ivar auth_type: Authentication type of the connection target. Required. PAT. + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ - status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = rest_field( + credentials: Optional["_models.ConnectionPersonalAccessToken"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - service. Known values are: \"Pending\", \"Approved\", and \"Rejected\".""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The reason for approval/rejection of the connection.""" - actions_required: Optional[str] = rest_field( - name="actionsRequired", visibility=["read", "create", "update", "delete", "query"] - ) - """A message indicating if changes on the service provider require any updates on the consumer.""" + auth_type: Literal[ConnectionAuthType.PAT] = rest_discriminator(name="authType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Authentication type of the connection target. Required. PAT.""" @overload def __init__( self, *, - status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = None, - description: Optional[str] = None, - actions_required: Optional[str] = None, + category: Optional[Union[str, "_models.ConnectionCategory"]] = None, + error: Optional[str] = None, + expiry_time: Optional[datetime.datetime] = None, + is_shared_to_all: Optional[bool] = None, + metadata: Optional[dict[str, str]] = None, + pe_requirement: Optional[Union[str, "_models.ManagedPERequirement"]] = None, + pe_status: Optional[Union[str, "_models.ManagedPEStatus"]] = None, + shared_user_list: Optional[list[str]] = None, + target: Optional[str] = None, + use_workspace_managed_identity: Optional[bool] = None, + credentials: Optional["_models.ConnectionPersonalAccessToken"] = None, ) -> None: ... @overload @@ -9505,56 +6430,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.auth_type = ConnectionAuthType.PAT # type: ignore -class Project(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Cognitive Services project is an Azure resource representing the provisioned account's project, - it's type, location and SKU. +class PatchResourceTags(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The object being used to update tags of a resource, in general used for PATCH operations. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of Cognitive Services project. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ProjectProperties :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar etag: Resource Etag. - :vartype etag: str - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cognitiveservices.models.Identity """ - properties: Optional["_models.ProjectProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of Cognitive Services project.""" tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) """Resource tags.""" - location: Optional[str] = rest_field(visibility=["read", "create"]) - """The geo-location where the resource lives.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource Etag.""" - identity: Optional["_models.Identity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identity for the resource.""" @overload def __init__( self, *, - properties: Optional["_models.ProjectProperties"] = None, tags: Optional[dict[str, str]] = None, - location: Optional[str] = None, - identity: Optional["_models.Identity"] = None, ) -> None: ... @overload @@ -9568,34 +6461,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProjectCapabilityHost(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure Resource Manager resource envelope for Project CapabilityHost. +class PatchResourceTagsAndSku(PatchResourceTags): # pylint: disable=docstring-keyword-should-match-keyword-only + """The object being used to update tags and sku of a resource, in general used for PATCH + operations. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: [Required] Additional attributes of the entity. Required. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHostProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar sku: The resource model definition representing SKU. + :vartype sku: ~azure.mgmt.cognitiveservices.models.Sku """ - properties: "_models.ProjectCapabilityHostProperties" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """[Required] Additional attributes of the entity. Required.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource model definition representing SKU.""" @overload def __init__( self, *, - properties: "_models.ProjectCapabilityHostProperties", + tags: Optional[dict[str, str]] = None, + sku: Optional["_models.Sku"] = None, ) -> None: ... @overload @@ -9609,59 +6493,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProjectCapabilityHostProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ProjectCapabilityHostProperties. +class PrivateEndpoint(_Model): + """The private endpoint resource. - :ivar ai_services_connections: List of AI services connections. - :vartype ai_services_connections: list[str] - :ivar vector_store_connections: List of connection names from those available in the account or - project to be used for vector database (e.g. CosmosDB). - :vartype vector_store_connections: list[str] - :ivar storage_connections: List of connection names from those available in the account or - project to be used as a storage resource. - :vartype storage_connections: list[str] - :ivar thread_storage_connections: List of connection names from those available in the account - or project to be used for Thread storage. - :vartype thread_storage_connections: list[str] - :ivar provisioning_state: Provisioning state for the CapabilityHost. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.CapabilityHostProvisioningState + :ivar id: The resource identifier of the private endpoint. + :vartype id: str """ - ai_services_connections: Optional[list[str]] = rest_field( - name="aiServicesConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of AI services connections.""" - vector_store_connections: Optional[list[str]] = rest_field( - name="vectorStoreConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of connection names from those available in the account or project to be used for vector - database (e.g. CosmosDB).""" - storage_connections: Optional[list[str]] = rest_field( - name="storageConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of connection names from those available in the account or project to be used as a storage - resource.""" - thread_storage_connections: Optional[list[str]] = rest_field( - name="threadStorageConnections", visibility=["read", "create", "update", "delete", "query"] - ) - """List of connection names from those available in the account or project to be used for Thread - storage.""" - provisioning_state: Optional[Union[str, "_models.CapabilityHostProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] + id: Optional[str] = rest_field(visibility=["read"]) + """The resource identifier of the private endpoint.""" + + +class PrivateEndpointConnection(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The Private Endpoint Connection resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionProperties + :ivar etag: Resource Etag. + :vartype etag: str + :ivar location: The location of the private endpoint connection. + :vartype location: str + """ + + properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Provisioning state for the CapabilityHost. Known values are: \"Succeeded\", \"Failed\", - \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" + """Resource properties.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """Resource Etag.""" + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The location of the private endpoint connection.""" @overload def __init__( self, *, - ai_services_connections: Optional[list[str]] = None, - vector_store_connections: Optional[list[str]] = None, - storage_connections: Optional[list[str]] = None, - thread_storage_connections: Optional[list[str]] = None, + properties: Optional["_models.PrivateEndpointConnectionProperties"] = None, + location: Optional[str] = None, ) -> None: ... @overload @@ -9675,57 +6554,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProjectProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of Cognitive Services Project'. +class PrivateEndpointConnectionListResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A list of private endpoint connections. - :ivar provisioning_state: Gets the status of the cognitive services project at the time the - operation was called. Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", - "Succeeded", "Canceled", "ResolvingDNS", and "ExtensionUnreachable". - :vartype provisioning_state: str or ~azure.mgmt.cognitiveservices.models.ProvisioningState - :ivar display_name: The display name of the Cognitive Services Project. - :vartype display_name: str - :ivar description: The description of the Cognitive Services Project. - :vartype description: str - :ivar endpoints: The list of endpoint for this Cognitive Services Project. - :vartype endpoints: dict[str, str] - :ivar is_default: Indicates whether the project is the default project for the account. - :vartype is_default: bool - :ivar capability_settings: Effective agent capability settings for the project. Optional - partial override of the account defaults; omitted fields inherit from the parent account when - present. Settable only at create time. - :vartype capability_settings: ~azure.mgmt.cognitiveservices.models.CapabilitySettings + :ivar value: Array of private endpoint connections. + :vartype value: list[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] """ - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Gets the status of the cognitive services project at the time the operation was called. Known - values are: \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", - \"Canceled\", \"ResolvingDNS\", and \"ExtensionUnreachable\".""" - display_name: Optional[str] = rest_field( - name="displayName", visibility=["read", "create", "update", "delete", "query"] - ) - """The display name of the Cognitive Services Project.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the Cognitive Services Project.""" - endpoints: Optional[dict[str, str]] = rest_field(visibility=["read"]) - """The list of endpoint for this Cognitive Services Project.""" - is_default: Optional[bool] = rest_field(name="isDefault", visibility=["read"]) - """Indicates whether the project is the default project for the account.""" - capability_settings: Optional["_models.CapabilitySettings"] = rest_field( - name="capabilitySettings", visibility=["read", "create"] + value: Optional[list["_models.PrivateEndpointConnection"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Effective agent capability settings for the project. Optional partial override of the account - defaults; omitted fields inherit from the parent account when present. Settable only at create - time.""" + """Array of private endpoint connections.""" @overload def __init__( self, *, - display_name: Optional[str] = None, - description: Optional[str] = None, - capability_settings: Optional["_models.CapabilitySettings"] = None, + value: Optional[list["_models.PrivateEndpointConnection"]] = None, ) -> None: ... @overload @@ -9739,28 +6584,49 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProvisioningIssue(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """ProvisioningIssue. +class PrivateEndpointConnectionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of the PrivateEndpointConnectProperties. - :ivar name: Name of the NSP provisioning issue. - :vartype name: str - :ivar properties: Properties of Provisioning Issue. - :vartype properties: ~azure.mgmt.cognitiveservices.models.ProvisioningIssueProperties + :ivar private_endpoint: The resource of private end point. + :vartype private_endpoint: ~azure.mgmt.cognitiveservices.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. Required. + :vartype private_link_service_connection_state: + ~azure.mgmt.cognitiveservices.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Known values are: "Succeeded", "Creating", "Deleting", and "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionProvisioningState + :ivar group_ids: The private link resource group ids. + :vartype group_ids: list[str] """ - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Name of the NSP provisioning issue.""" - properties: Optional["_models.ProvisioningIssueProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + private_endpoint: Optional["_models.PrivateEndpoint"] = rest_field( + name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"] ) - """Properties of Provisioning Issue.""" + """The resource of private end point.""" + private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState" = rest_field( + name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"] + ) + """A collection of information about the state of the connection between service consumer and + provider. Required.""" + provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the private endpoint connection resource. Known values are: + \"Succeeded\", \"Creating\", \"Deleting\", and \"Failed\".""" + group_ids: Optional[list[str]] = rest_field( + name="groupIds", visibility=["read", "create", "update", "delete", "query"] + ) + """The private link resource group ids.""" @overload def __init__( self, *, - name: Optional[str] = None, - properties: Optional["_models.ProvisioningIssueProperties"] = None, + private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState", + private_endpoint: Optional["_models.PrivateEndpoint"] = None, + group_ids: Optional[list[str]] = None, ) -> None: ... @overload @@ -9774,47 +6640,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProvisioningIssueProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of Provisioning Issue. +class PrivateEndpointOutboundRule( + OutboundRule, discriminator="PrivateEndpoint" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Private Endpoint outbound rule for the managed network of a cognitive services account. - :ivar issue_type: Type of Issue. - :vartype issue_type: str - :ivar severity: Severity of the issue. - :vartype severity: str - :ivar description: Description of the issue. - :vartype description: str - :ivar suggested_resource_ids: IDs of resources that can be associated to the same perimeter to - remediate the issue. - :vartype suggested_resource_ids: list[str] - :ivar suggested_access_rules: Optional array, suggested access rules. - :vartype suggested_access_rules: - list[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterAccessRule] + :ivar category: Category of a managed network Outbound Rule of a cognitive services account. + Known values are: "Required", "Recommended", "UserDefined", and "Dependency". + :vartype category: str or ~azure.mgmt.cognitiveservices.models.RuleCategory + :ivar status: Type of a managed network Outbound Rule of a cognitive services account. Known + values are: "Inactive", "Active", "Provisioning", "Deleting", and "Failed". + :vartype status: str or ~azure.mgmt.cognitiveservices.models.RuleStatus + :ivar error_information: Error information about an outbound rule of a cognitive services + account if RuleStatus is failed. + :vartype error_information: str + :ivar parent_rule_names: + :vartype parent_rule_names: list[str] + :ivar destination: Private Endpoint destination. + :vartype destination: + ~azure.mgmt.cognitiveservices.models.PrivateEndpointOutboundRuleDestination + :ivar fqdns: List of FQDNs associated with the private endpoint outbound rule. + :vartype fqdns: list[str] + :ivar type: Type of a managed network Outbound Rule of a cognitive services account. Required. + PRIVATE_ENDPOINT. + :vartype type: str or ~azure.mgmt.cognitiveservices.models.RuleType """ - issue_type: Optional[str] = rest_field(name="issueType", visibility=["read", "create", "update", "delete", "query"]) - """Type of Issue.""" - severity: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Severity of the issue.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the issue.""" - suggested_resource_ids: Optional[list[str]] = rest_field( - name="suggestedResourceIds", visibility=["read", "create", "update", "delete", "query"] - ) - """IDs of resources that can be associated to the same perimeter to remediate the issue.""" - suggested_access_rules: Optional[list["_models.NetworkSecurityPerimeterAccessRule"]] = rest_field( - name="suggestedAccessRules", visibility=["read", "create", "update", "delete", "query"] + destination: Optional["_models.PrivateEndpointOutboundRuleDestination"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Optional array, suggested access rules.""" + """Private Endpoint destination.""" + fqdns: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of FQDNs associated with the private endpoint outbound rule.""" + type: Literal[RuleType.PRIVATE_ENDPOINT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Type of a managed network Outbound Rule of a cognitive services account. Required. + PRIVATE_ENDPOINT.""" @overload def __init__( self, *, - issue_type: Optional[str] = None, - severity: Optional[str] = None, - description: Optional[str] = None, - suggested_resource_ids: Optional[list[str]] = None, - suggested_access_rules: Optional[list["_models.NetworkSecurityPerimeterAccessRule"]] = None, + category: Optional[Union[str, "_models.RuleCategory"]] = None, + status: Optional[Union[str, "_models.RuleStatus"]] = None, + destination: Optional["_models.PrivateEndpointOutboundRuleDestination"] = None, + fqdns: Optional[list[str]] = None, ) -> None: ... @overload @@ -9826,34 +6695,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - - -class QuotaLimit(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """QuotaLimit. - - :ivar count: - :vartype count: float - :ivar renewal_period: - :vartype renewal_period: float - :ivar rules: - :vartype rules: list[~azure.mgmt.cognitiveservices.models.ThrottlingRule] + self.type = RuleType.PRIVATE_ENDPOINT # type: ignore + + +class PrivateEndpointOutboundRuleDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Private Endpoint destination for an outbound rule. + + :ivar service_resource_id: The Azure resource ID of the target private endpoint service. + :vartype service_resource_id: str + :ivar subresource_target: The subresource of the target service to connect to. + :vartype subresource_target: str """ - count: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - renewal_period: Optional[float] = rest_field( - name="renewalPeriod", visibility=["read", "create", "update", "delete", "query"] + service_resource_id: Optional[str] = rest_field( + name="serviceResourceId", visibility=["read", "create", "update", "delete", "query"] ) - rules: Optional[list["_models.ThrottlingRule"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """The Azure resource ID of the target private endpoint service.""" + subresource_target: Optional[str] = rest_field( + name="subresourceTarget", visibility=["read", "create", "update", "delete", "query"] ) + """The subresource of the target service to connect to.""" @overload def __init__( self, *, - count: Optional[float] = None, - renewal_period: Optional[float] = None, - rules: Optional[list["_models.ThrottlingRule"]] = None, + service_resource_id: Optional[str] = None, + subresource_target: Optional[str] = None, ) -> None: ... @overload @@ -9867,8 +6735,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class QuotaTier(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """The quota tier information for the subscription. +class PrivateLinkResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A private link resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -9881,20 +6749,20 @@ class QuotaTier(ProxyResource): # pylint: disable=docstring-keyword-should-matc :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of quota tier resource. - :vartype properties: ~azure.mgmt.cognitiveservices.models.QuotaTierProperties + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.cognitiveservices.models.PrivateLinkResourceProperties """ - properties: Optional["_models.QuotaTierProperties"] = rest_field( + properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Properties of quota tier resource.""" + """Resource properties.""" @overload def __init__( self, *, - properties: Optional["_models.QuotaTierProperties"] = None, + properties: Optional["_models.PrivateLinkResourceProperties"] = None, ) -> None: ... @overload @@ -9908,44 +6776,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class QuotaTierProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of Quota Tier resource'. +class PrivateLinkResourceListResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A list of private link resources. - :ivar current_tier_name: Name of the current quota tier for the subscription. - :vartype current_tier_name: str - :ivar tier_upgrade_policy: Gets the tier upgrade policy for the subscription. Known values are: - "OnceUpgradeIsAvailable" and "NoAutoUpgrade". - :vartype tier_upgrade_policy: str or ~azure.mgmt.cognitiveservices.models.TierUpgradePolicy - :ivar assignment_date: The date on which the current tier was assigned to the subscription - (UTC). - :vartype assignment_date: ~datetime.datetime - :ivar tier_upgrade_eligibility_info: Information about the quota tier upgrade eligibility for - the subscription. - :vartype tier_upgrade_eligibility_info: - ~azure.mgmt.cognitiveservices.models.QuotaTierUpgradeEligibilityInfo + :ivar value: Array of private link resources. + :vartype value: list[~azure.mgmt.cognitiveservices.models.PrivateLinkResource] """ - current_tier_name: Optional[str] = rest_field(name="currentTierName", visibility=["read"]) - """Name of the current quota tier for the subscription.""" - tier_upgrade_policy: Optional[Union[str, "_models.TierUpgradePolicy"]] = rest_field( - name="tierUpgradePolicy", visibility=["read", "create", "update", "delete", "query"] - ) - """Gets the tier upgrade policy for the subscription. Known values are: \"OnceUpgradeIsAvailable\" - and \"NoAutoUpgrade\".""" - assignment_date: Optional[datetime.datetime] = rest_field( - name="assignmentDate", visibility=["read"], format="rfc3339" - ) - """The date on which the current tier was assigned to the subscription (UTC).""" - tier_upgrade_eligibility_info: Optional["_models.QuotaTierUpgradeEligibilityInfo"] = rest_field( - name="tierUpgradeEligibilityInfo", visibility=["read"] + value: Optional[list["_models.PrivateLinkResource"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """Information about the quota tier upgrade eligibility for the subscription.""" + """Array of private link resources.""" @overload def __init__( self, *, - tier_upgrade_policy: Optional[Union[str, "_models.TierUpgradePolicy"]] = None, + value: Optional[list["_models.PrivateLinkResource"]] = None, ) -> None: ... @overload @@ -9959,50 +6806,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class QuotaTierUpgradeEligibilityInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Information about the quota tier upgrade eligibility for the subscription. +class PrivateLinkResourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a private link resource. - :ivar next_tier_name: Name of the next quota tier for the subscription. - :vartype next_tier_name: str - :ivar upgrade_availability_status: Specifies whether an upgrade to the next quota tier is - available. Known values are: "Available" and "NotAvailable". - :vartype upgrade_availability_status: str or - ~azure.mgmt.cognitiveservices.models.UpgradeAvailabilityStatus - :ivar upgrade_applicable_date: The date after which the current tier will be upgraded to the - next tier if the TierUpgradePolicy is "OnceUpgradeIsAvailable" (UTC). - :vartype upgrade_applicable_date: ~datetime.datetime - :ivar upgrade_unavailability_reason: Reason in case the subscription is not eligible for - upgrade to the next tier. - :vartype upgrade_unavailability_reason: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :ivar required_zone_names: The private link resource Private link DNS zone name. + :vartype required_zone_names: list[str] + :ivar display_name: The private link resource display name. + :vartype display_name: str """ - next_tier_name: Optional[str] = rest_field( - name="nextTierName", visibility=["read", "create", "update", "delete", "query"] - ) - """Name of the next quota tier for the subscription.""" - upgrade_availability_status: Optional[Union[str, "_models.UpgradeAvailabilityStatus"]] = rest_field( - name="upgradeAvailabilityStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Specifies whether an upgrade to the next quota tier is available. Known values are: - \"Available\" and \"NotAvailable\".""" - upgrade_applicable_date: Optional[datetime.datetime] = rest_field( - name="upgradeApplicableDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The date after which the current tier will be upgraded to the next tier if the - TierUpgradePolicy is \"OnceUpgradeIsAvailable\" (UTC).""" - upgrade_unavailability_reason: Optional[str] = rest_field( - name="upgradeUnavailabilityReason", visibility=["read", "create", "update", "delete", "query"] + group_id: Optional[str] = rest_field(name="groupId", visibility=["read"]) + """The private link resource group id.""" + required_members: Optional[list[str]] = rest_field(name="requiredMembers", visibility=["read"]) + """The private link resource required member names.""" + required_zone_names: Optional[list[str]] = rest_field( + name="requiredZoneNames", visibility=["read", "create", "update", "delete", "query"] ) - """Reason in case the subscription is not eligible for upgrade to the next tier.""" + """The private link resource Private link DNS zone name.""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """The private link resource display name.""" @overload def __init__( self, *, - next_tier_name: Optional[str] = None, - upgrade_availability_status: Optional[Union[str, "_models.UpgradeAvailabilityStatus"]] = None, - upgrade_applicable_date: Optional[datetime.datetime] = None, - upgrade_unavailability_reason: Optional[str] = None, + required_zone_names: Optional[list[str]] = None, ) -> None: ... @overload @@ -10016,38 +6848,40 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiAcsEmptyObject(_Model): - """An object that must contain no properties.""" - - -class RaiAcsHarmConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Selects one Azure AI Content Safety harm-detector configuration. +class PrivateLinkServiceConnectionState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A collection of information about the state of the connection between service consumer and + provider. - :ivar category: The logical harm category exposed under input.snapshot.moderation.harm. - Required. Known values are: "Hate", "SelfHarm", "Sexual", "Violence", "PromptInjection", - "ProtectedMaterialText", and "ProtectedMaterialCode". - :vartype category: str or ~azure.mgmt.cognitiveservices.models.RaiAcsHarmCategory - :ivar harm_config_id: The Azure AI Content Safety detector configuration identifier. When - supplied, it must be the configuration supported for the selected category. - :vartype harm_config_id: str + :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Known values are: "Pending", "Approved", and "Rejected". + :vartype status: str or + ~azure.mgmt.cognitiveservices.models.PrivateEndpointServiceConnectionStatus + :ivar description: The reason for approval/rejection of the connection. + :vartype description: str + :ivar actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :vartype actions_required: str """ - category: Union[str, "_models.RaiAcsHarmCategory"] = rest_field( + status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The logical harm category exposed under input.snapshot.moderation.harm. Required. Known values - are: \"Hate\", \"SelfHarm\", \"Sexual\", \"Violence\", \"PromptInjection\", - \"ProtectedMaterialText\", and \"ProtectedMaterialCode\".""" - harm_config_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Azure AI Content Safety detector configuration identifier. When supplied, it must be the - configuration supported for the selected category.""" + """Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + service. Known values are: \"Pending\", \"Approved\", and \"Rejected\".""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for approval/rejection of the connection.""" + actions_required: Optional[str] = rest_field( + name="actionsRequired", visibility=["read", "create", "update", "delete", "query"] + ) + """A message indicating if changes on the service provider require any updates on the consumer.""" @overload def __init__( self, *, - category: Union[str, "_models.RaiAcsHarmCategory"], - harm_config_id: Optional[str] = None, + status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, ) -> None: ... @overload @@ -10061,50 +6895,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiAcsInterventionPoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Binds one logical policy to an Agent Control Specification intervention point. +class Project(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Cognitive Services project is an Azure resource representing the provisioned account's project, + it's type, location and SKU. - :ivar policy_target: The canonical Agent Hooks snapshot path projected as the policy target. - Required. Known values are: "$snap.input", "$snap.output", "$snap.tool_call.args", and - "$snap.tool_result.value". - :vartype policy_target: str or ~azure.mgmt.cognitiveservices.models.RaiAcsPolicyTarget - :ivar policy_target_kind: The semantic kind of the projected policy target. Required. Known - values are: "user_input", "assistant_output", "tool_args", and "tool_result". - :vartype policy_target_kind: str or ~azure.mgmt.cognitiveservices.models.RaiAcsPolicyTargetKind - :ivar policy: The logical policy evaluated at this intervention point. Required. - :vartype policy: ~azure.mgmt.cognitiveservices.models.RaiAcsPolicyBinding - :ivar annotations: Standard Agent Control Specification annotation bindings are disabled; when - present, this object must be empty. - :vartype annotations: ~azure.mgmt.cognitiveservices.models.RaiAcsEmptyObject + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: Properties of Cognitive Services project. + :vartype properties: ~azure.mgmt.cognitiveservices.models.ProjectProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. + :vartype location: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.cognitiveservices.models.Identity """ - policy_target: Union[str, "_models.RaiAcsPolicyTarget"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The canonical Agent Hooks snapshot path projected as the policy target. Required. Known values - are: \"$snap.input\", \"$snap.output\", \"$snap.tool_call.args\", and - \"$snap.tool_result.value\".""" - policy_target_kind: Union[str, "_models.RaiAcsPolicyTargetKind"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The semantic kind of the projected policy target. Required. Known values are: \"user_input\", - \"assistant_output\", \"tool_args\", and \"tool_result\".""" - policy: "_models.RaiAcsPolicyBinding" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The logical policy evaluated at this intervention point. Required.""" - annotations: Optional["_models.RaiAcsEmptyObject"] = rest_field( + properties: Optional["_models.ProjectProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Standard Agent Control Specification annotation bindings are disabled; when present, this - object must be empty.""" + """Properties of Cognitive Services project.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) + """Resource tags.""" + location: Optional[str] = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """Resource Etag.""" + identity: Optional["_models.Identity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identity for the resource.""" @overload def __init__( self, *, - policy_target: Union[str, "_models.RaiAcsPolicyTarget"], - policy_target_kind: Union[str, "_models.RaiAcsPolicyTargetKind"], - policy: "_models.RaiAcsPolicyBinding", - annotations: Optional["_models.RaiAcsEmptyObject"] = None, + properties: Optional["_models.ProjectProperties"] = None, + tags: Optional[dict[str, str]] = None, + location: Optional[str] = None, + identity: Optional["_models.Identity"] = None, ) -> None: ... @overload @@ -10118,44 +6956,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiAcsInterventionPoints(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Intervention points supported by the Azure AI Content Safety Unified Moderate host profile. +class ProjectCapabilityHost(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure Resource Manager resource envelope for Project CapabilityHost. - :ivar input: The policy evaluated for user input. - :vartype input: ~azure.mgmt.cognitiveservices.models.RaiAcsInterventionPoint - :ivar pre_tool_call: The policy evaluated before a tool call. - :vartype pre_tool_call: ~azure.mgmt.cognitiveservices.models.RaiAcsToolInterventionPoint - :ivar post_tool_call: The policy evaluated after a tool call. - :vartype post_tool_call: ~azure.mgmt.cognitiveservices.models.RaiAcsToolInterventionPoint - :ivar output: The policy evaluated for final output. - :vartype output: ~azure.mgmt.cognitiveservices.models.RaiAcsInterventionPoint + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: [Required] Additional attributes of the entity. Required. + :vartype properties: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHostProperties """ - input: Optional["_models.RaiAcsInterventionPoint"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The policy evaluated for user input.""" - pre_tool_call: Optional["_models.RaiAcsToolInterventionPoint"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The policy evaluated before a tool call.""" - post_tool_call: Optional["_models.RaiAcsToolInterventionPoint"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The policy evaluated after a tool call.""" - output: Optional["_models.RaiAcsInterventionPoint"] = rest_field( + properties: "_models.ProjectCapabilityHostProperties" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The policy evaluated for final output.""" + """[Required] Additional attributes of the entity. Required.""" @overload def __init__( self, *, - input: Optional["_models.RaiAcsInterventionPoint"] = None, - pre_tool_call: Optional["_models.RaiAcsToolInterventionPoint"] = None, - post_tool_call: Optional["_models.RaiAcsToolInterventionPoint"] = None, - output: Optional["_models.RaiAcsInterventionPoint"] = None, + properties: "_models.ProjectCapabilityHostProperties", ) -> None: ... @overload @@ -10169,64 +6997,59 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiAcsManifest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The closed Rego-only Agent Control Specification (ACS) profile supported by Azure AI Content - Safety Unified Moderate. +class ProjectCapabilityHostProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ProjectCapabilityHostProperties. - :ivar agent_control_specification_version: The declared Agent Control Specification manifest - version. Required. - :vartype agent_control_specification_version: str - :ivar metadata: Non-policy manifest metadata. - :vartype metadata: dict[str, any] - :ivar policies: Named Rego policies in this manifest. Required. - :vartype policies: dict[str, ~azure.mgmt.cognitiveservices.models.RaiAcsRegoPolicyDefinition] - :ivar intervention_points: Agent Control Specification intervention-point bindings. At least - one intervention point is required. Required. - :vartype intervention_points: ~azure.mgmt.cognitiveservices.models.RaiAcsInterventionPoints - :ivar tools: Static tool catalog keyed by canonical tool name. The catalog may be omitted or - empty when no tool selector is configured. A tool selector requires a non-empty catalog, and an - unknown selected key fails closed. - :vartype tools: dict[str, ~azure.mgmt.cognitiveservices.models.RaiAcsToolDefinition] - :ivar annotators: Standard Agent Control Specification annotator dispatch is disabled; when - present, this object must be empty. - :vartype annotators: ~azure.mgmt.cognitiveservices.models.RaiAcsEmptyObject + :ivar ai_services_connections: List of AI services connections. + :vartype ai_services_connections: list[str] + :ivar vector_store_connections: List of connection names from those available in the account or + project to be used for vector database (e.g. CosmosDB). + :vartype vector_store_connections: list[str] + :ivar storage_connections: List of connection names from those available in the account or + project to be used as a storage resource. + :vartype storage_connections: list[str] + :ivar thread_storage_connections: List of connection names from those available in the account + or project to be used for Thread storage. + :vartype thread_storage_connections: list[str] + :ivar provisioning_state: Provisioning state for the CapabilityHost. Known values are: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.CapabilityHostProvisioningState """ - agent_control_specification_version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The declared Agent Control Specification manifest version. Required.""" - metadata: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Non-policy manifest metadata.""" - policies: dict[str, "_models.RaiAcsRegoPolicyDefinition"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + ai_services_connections: Optional[list[str]] = rest_field( + name="aiServicesConnections", visibility=["read", "create", "update", "delete", "query"] ) - """Named Rego policies in this manifest. Required.""" - intervention_points: "_models.RaiAcsInterventionPoints" = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """List of AI services connections.""" + vector_store_connections: Optional[list[str]] = rest_field( + name="vectorStoreConnections", visibility=["read", "create", "update", "delete", "query"] ) - """Agent Control Specification intervention-point bindings. At least one intervention point is - required. Required.""" - tools: Optional[dict[str, "_models.RaiAcsToolDefinition"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """List of connection names from those available in the account or project to be used for vector + database (e.g. CosmosDB).""" + storage_connections: Optional[list[str]] = rest_field( + name="storageConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """List of connection names from those available in the account or project to be used as a storage + resource.""" + thread_storage_connections: Optional[list[str]] = rest_field( + name="threadStorageConnections", visibility=["read", "create", "update", "delete", "query"] ) - """Static tool catalog keyed by canonical tool name. The catalog may be omitted or empty when no - tool selector is configured. A tool selector requires a non-empty catalog, and an unknown - selected key fails closed.""" - annotators: Optional["_models.RaiAcsEmptyObject"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """List of connection names from those available in the account or project to be used for Thread + storage.""" + provisioning_state: Optional[Union[str, "_models.CapabilityHostProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] ) - """Standard Agent Control Specification annotator dispatch is disabled; when present, this object - must be empty.""" + """Provisioning state for the CapabilityHost. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" @overload def __init__( self, *, - agent_control_specification_version: str, - policies: dict[str, "_models.RaiAcsRegoPolicyDefinition"], - intervention_points: "_models.RaiAcsInterventionPoints", - metadata: Optional[dict[str, Any]] = None, - tools: Optional[dict[str, "_models.RaiAcsToolDefinition"]] = None, - annotators: Optional["_models.RaiAcsEmptyObject"] = None, + ai_services_connections: Optional[list[str]] = None, + vector_store_connections: Optional[list[str]] = None, + storage_connections: Optional[list[str]] = None, + thread_storage_connections: Optional[list[str]] = None, ) -> None: ... @overload @@ -10240,34 +7063,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiAcsModerationBindingExtension(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Azure AI Content Safety moderation work performed before the Agent Control Specification - runtime evaluates the selected Rego query. +class ProjectProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of Cognitive Services Project'. - :ivar subject_format: How the selected policy target is represented to moderation capabilities. - Required. Known values are: "text" and "canonical_json". - :vartype subject_format: str or - ~azure.mgmt.cognitiveservices.models.RaiAcsModerationSubjectFormat - :ivar harm_configs: Harm signals requested for this intervention point. Required. - :vartype harm_configs: list[~azure.mgmt.cognitiveservices.models.RaiAcsHarmConfiguration] + :ivar provisioning_state: Gets the status of the cognitive services project at the time the + operation was called. Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", + "Succeeded", "Canceled", and "ResolvingDNS". + :vartype provisioning_state: str or ~azure.mgmt.cognitiveservices.models.ProvisioningState + :ivar display_name: The display name of the Cognitive Services Project. + :vartype display_name: str + :ivar description: The description of the Cognitive Services Project. + :vartype description: str + :ivar endpoints: The list of endpoint for this Cognitive Services Project. + :vartype endpoints: dict[str, str] + :ivar is_default: Indicates whether the project is the default project for the account. + :vartype is_default: bool """ - subject_format: Union[str, "_models.RaiAcsModerationSubjectFormat"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] ) - """How the selected policy target is represented to moderation capabilities. Required. Known - values are: \"text\" and \"canonical_json\".""" - harm_configs: list["_models.RaiAcsHarmConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + """Gets the status of the cognitive services project at the time the operation was called. Known + values are: \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", + \"Canceled\", and \"ResolvingDNS\".""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] ) - """Harm signals requested for this intervention point. Required.""" + """The display name of the Cognitive Services Project.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the Cognitive Services Project.""" + endpoints: Optional[dict[str, str]] = rest_field(visibility=["read"]) + """The list of endpoint for this Cognitive Services Project.""" + is_default: Optional[bool] = rest_field(name="isDefault", visibility=["read"]) + """Indicates whether the project is the default project for the account.""" @overload def __init__( self, *, - subject_format: Union[str, "_models.RaiAcsModerationSubjectFormat"], - harm_configs: list["_models.RaiAcsHarmConfiguration"], + display_name: Optional[str] = None, + description: Optional[str] = None, ) -> None: ... @overload @@ -10281,34 +7116,28 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiAcsPolicyBinding(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Identifies the logical policy evaluated at an Agent Control Specification intervention point. +class ProvisioningIssue(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ProvisioningIssue. - :ivar id: The logical policy identifier. Required. - :vartype id: str - :ivar query: An optional intervention-specific Rego query override. - :vartype query: str - :ivar aacs_moderation: Optional Azure AI Content Safety moderation capabilities invoked before - Rego evaluation. - :vartype aacs_moderation: ~azure.mgmt.cognitiveservices.models.RaiAcsModerationBindingExtension + :ivar name: Name of the NSP provisioning issue. + :vartype name: str + :ivar properties: Properties of Provisioning Issue. + :vartype properties: ~azure.mgmt.cognitiveservices.models.ProvisioningIssueProperties """ - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The logical policy identifier. Required.""" - query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An optional intervention-specific Rego query override.""" - aacs_moderation: Optional["_models.RaiAcsModerationBindingExtension"] = rest_field( + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the NSP provisioning issue.""" + properties: Optional["_models.ProvisioningIssueProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional Azure AI Content Safety moderation capabilities invoked before Rego evaluation.""" + """Properties of Provisioning Issue.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - query: Optional[str] = None, - aacs_moderation: Optional["_models.RaiAcsModerationBindingExtension"] = None, + name: Optional[str] = None, + properties: Optional["_models.ProvisioningIssueProperties"] = None, ) -> None: ... @overload @@ -10322,28 +7151,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiAcsRegoPolicyDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """A Rego policy definition in the Azure AI Content Safety Unified Moderate host profile. +class ProvisioningIssueProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of Provisioning Issue. - :ivar type: The policy language. This profile supports only Rego. Required. "rego" - :vartype type: str or ~azure.mgmt.cognitiveservices.models.RaiAcsPolicyDefinitionType - :ivar query: The fully qualified Rego query evaluated for this policy. Required. - :vartype query: str + :ivar issue_type: Type of Issue. + :vartype issue_type: str + :ivar severity: Severity of the issue. + :vartype severity: str + :ivar description: Description of the issue. + :vartype description: str + :ivar suggested_resource_ids: IDs of resources that can be associated to the same perimeter to + remediate the issue. + :vartype suggested_resource_ids: list[str] + :ivar suggested_access_rules: Optional array, suggested access rules. + :vartype suggested_access_rules: + list[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterAccessRule] """ - type: Union[str, "_models.RaiAcsPolicyDefinitionType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + issue_type: Optional[str] = rest_field(name="issueType", visibility=["read", "create", "update", "delete", "query"]) + """Type of Issue.""" + severity: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Severity of the issue.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the issue.""" + suggested_resource_ids: Optional[list[str]] = rest_field( + name="suggestedResourceIds", visibility=["read", "create", "update", "delete", "query"] ) - """The policy language. This profile supports only Rego. Required. \"rego\"""" - query: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The fully qualified Rego query evaluated for this policy. Required.""" + """IDs of resources that can be associated to the same perimeter to remediate the issue.""" + suggested_access_rules: Optional[list["_models.NetworkSecurityPerimeterAccessRule"]] = rest_field( + name="suggestedAccessRules", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional array, suggested access rules.""" @overload def __init__( self, *, - type: Union[str, "_models.RaiAcsPolicyDefinitionType"], - query: str, + issue_type: Optional[str] = None, + severity: Optional[str] = None, + description: Optional[str] = None, + suggested_resource_ids: Optional[list[str]] = None, + suggested_access_rules: Optional[list["_models.NetworkSecurityPerimeterAccessRule"]] = None, ) -> None: ... @overload @@ -10357,43 +7205,32 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiAcsToolDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Static policy metadata for one Agent Control Specification tool catalog entry. +class QuotaLimit(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """QuotaLimit. - :ivar id: Optional host-defined tool identifier. The catalog map key, not this value, controls - tool lookup. - :vartype id: str - :ivar type: Optional host-defined tool type. - :vartype type: str - :ivar description: Human-readable policy metadata. - :vartype description: str - :ivar security_labels: Labels describing the sink or capability. - :vartype security_labels: list[str] - :ivar clearance: Maximum sensitivity or host-defined clearance metadata. - :vartype clearance: str + :ivar count: + :vartype count: float + :ivar renewal_period: + :vartype renewal_period: float + :ivar rules: + :vartype rules: list[~azure.mgmt.cognitiveservices.models.ThrottlingRule] """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional host-defined tool identifier. The catalog map key, not this value, controls tool - lookup.""" - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional host-defined tool type.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Human-readable policy metadata.""" - security_labels: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Labels describing the sink or capability.""" - clearance: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum sensitivity or host-defined clearance metadata.""" + count: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + renewal_period: Optional[float] = rest_field( + name="renewalPeriod", visibility=["read", "create", "update", "delete", "query"] + ) + rules: Optional[list["_models.ThrottlingRule"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - type: Optional[str] = None, - description: Optional[str] = None, - security_labels: Optional[list[str]] = None, - clearance: Optional[str] = None, + count: Optional[float] = None, + renewal_period: Optional[float] = None, + rules: Optional[list["_models.ThrottlingRule"]] = None, ) -> None: ... @overload @@ -10407,59 +7244,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiAcsToolInterventionPoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Binds one logical policy to a tool-call intervention point. +class QuotaTier(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The quota tier information for the subscription. - :ivar policy_target: The canonical Agent Hooks snapshot path projected as the policy target. - Required. Known values are: "$snap.input", "$snap.output", "$snap.tool_call.args", and - "$snap.tool_result.value". - :vartype policy_target: str or ~azure.mgmt.cognitiveservices.models.RaiAcsPolicyTarget - :ivar policy_target_kind: The semantic kind of the projected policy target. Required. Known - values are: "user_input", "assistant_output", "tool_args", and "tool_result". - :vartype policy_target_kind: str or ~azure.mgmt.cognitiveservices.models.RaiAcsPolicyTargetKind - :ivar policy: The logical policy evaluated at this intervention point. Required. - :vartype policy: ~azure.mgmt.cognitiveservices.models.RaiAcsPolicyBinding - :ivar annotations: Standard Agent Control Specification annotation bindings are disabled; when - present, this object must be empty. - :vartype annotations: ~azure.mgmt.cognitiveservices.models.RaiAcsEmptyObject - :ivar tool_name_from: Selects the tool catalog key from the raw Agent Hooks snapshot using an - extensible snapshot path. Known values are: "$snap.tool_call.name" and "$.tool_call.name". - :vartype tool_name_from: str or ~azure.mgmt.cognitiveservices.models.RaiAcsToolNameSelector + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData + :ivar properties: Properties of quota tier resource. + :vartype properties: ~azure.mgmt.cognitiveservices.models.QuotaTierProperties """ - policy_target: Union[str, "_models.RaiAcsPolicyTarget"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The canonical Agent Hooks snapshot path projected as the policy target. Required. Known values - are: \"$snap.input\", \"$snap.output\", \"$snap.tool_call.args\", and - \"$snap.tool_result.value\".""" - policy_target_kind: Union[str, "_models.RaiAcsPolicyTargetKind"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The semantic kind of the projected policy target. Required. Known values are: \"user_input\", - \"assistant_output\", \"tool_args\", and \"tool_result\".""" - policy: "_models.RaiAcsPolicyBinding" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The logical policy evaluated at this intervention point. Required.""" - annotations: Optional["_models.RaiAcsEmptyObject"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Standard Agent Control Specification annotation bindings are disabled; when present, this - object must be empty.""" - tool_name_from: Optional[Union[str, "_models.RaiAcsToolNameSelector"]] = rest_field( + properties: Optional["_models.QuotaTierProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Selects the tool catalog key from the raw Agent Hooks snapshot using an extensible snapshot - path. Known values are: \"$snap.tool_call.name\" and \"$.tool_call.name\".""" + """Properties of quota tier resource.""" @overload def __init__( self, *, - policy_target: Union[str, "_models.RaiAcsPolicyTarget"], - policy_target_kind: Union[str, "_models.RaiAcsPolicyTargetKind"], - policy: "_models.RaiAcsPolicyBinding", - annotations: Optional["_models.RaiAcsEmptyObject"] = None, - tool_name_from: Optional[Union[str, "_models.RaiAcsToolNameSelector"]] = None, + properties: Optional["_models.QuotaTierProperties"] = None, ) -> None: ... @overload @@ -10473,43 +7285,44 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiBinding(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An account-scoped binding from an Azure resource to an Agent Control Specification policy. +class QuotaTierProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of Quota Tier resource'. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of the RAI binding. - :vartype properties: ~azure.mgmt.cognitiveservices.models.RaiBindingProperties - :ivar etag: Resource ETag. - :vartype etag: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] + :ivar current_tier_name: Name of the current quota tier for the subscription. + :vartype current_tier_name: str + :ivar tier_upgrade_policy: Gets the tier upgrade policy for the subscription. Known values are: + "OnceUpgradeIsAvailable" and "NoAutoUpgrade". + :vartype tier_upgrade_policy: str or ~azure.mgmt.cognitiveservices.models.TierUpgradePolicy + :ivar assignment_date: The date on which the current tier was assigned to the subscription + (UTC). + :vartype assignment_date: ~datetime.datetime + :ivar tier_upgrade_eligibility_info: Information about the quota tier upgrade eligibility for + the subscription. + :vartype tier_upgrade_eligibility_info: + ~azure.mgmt.cognitiveservices.models.QuotaTierUpgradeEligibilityInfo """ - properties: Optional["_models.RaiBindingProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + current_tier_name: Optional[str] = rest_field(name="currentTierName", visibility=["read"]) + """Name of the current quota tier for the subscription.""" + tier_upgrade_policy: Optional[Union[str, "_models.TierUpgradePolicy"]] = rest_field( + name="tierUpgradePolicy", visibility=["read", "create", "update", "delete", "query"] ) - """Properties of the RAI binding.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource ETag.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) - """Resource tags.""" + """Gets the tier upgrade policy for the subscription. Known values are: \"OnceUpgradeIsAvailable\" + and \"NoAutoUpgrade\".""" + assignment_date: Optional[datetime.datetime] = rest_field( + name="assignmentDate", visibility=["read"], format="rfc3339" + ) + """The date on which the current tier was assigned to the subscription (UTC).""" + tier_upgrade_eligibility_info: Optional["_models.QuotaTierUpgradeEligibilityInfo"] = rest_field( + name="tierUpgradeEligibilityInfo", visibility=["read"] + ) + """Information about the quota tier upgrade eligibility for the subscription.""" @overload def __init__( self, *, - properties: Optional["_models.RaiBindingProperties"] = None, - tags: Optional[dict[str, str]] = None, + tier_upgrade_policy: Optional[Union[str, "_models.TierUpgradePolicy"]] = None, ) -> None: ... @overload @@ -10523,31 +7336,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiBindingProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of a binding from an Azure resource to an Agent Control Specification policy. +class QuotaTierUpgradeEligibilityInfo(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Information about the quota tier upgrade eligibility for the subscription. - :ivar bound_resource_id: A valid Azure Resource Manager resource ID of the resource to bind to - the target RAI policy. Required. - :vartype bound_resource_id: str - :ivar target_policy_name: The same-account Agent Control Specification policy name targeted by - the binding. Required. - :vartype target_policy_name: str + :ivar next_tier_name: Name of the next quota tier for the subscription. + :vartype next_tier_name: str + :ivar upgrade_availability_status: Specifies whether an upgrade to the next quota tier is + available. Known values are: "Available" and "NotAvailable". + :vartype upgrade_availability_status: str or + ~azure.mgmt.cognitiveservices.models.UpgradeAvailabilityStatus + :ivar upgrade_applicable_date: The date after which the current tier will be upgraded to the + next tier if the TierUpgradePolicy is "OnceUpgradeIsAvailable" (UTC). + :vartype upgrade_applicable_date: ~datetime.datetime + :ivar upgrade_unavailability_reason: Reason in case the subscription is not eligible for + upgrade to the next tier. + :vartype upgrade_unavailability_reason: str """ - bound_resource_id: str = rest_field(name="boundResourceId", visibility=["read", "create", "update"]) - """A valid Azure Resource Manager resource ID of the resource to bind to the target RAI policy. - Required.""" - target_policy_name: str = rest_field( - name="targetPolicyName", visibility=["read", "create", "update", "delete", "query"] + next_tier_name: Optional[str] = rest_field( + name="nextTierName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the next quota tier for the subscription.""" + upgrade_availability_status: Optional[Union[str, "_models.UpgradeAvailabilityStatus"]] = rest_field( + name="upgradeAvailabilityStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether an upgrade to the next quota tier is available. Known values are: + \"Available\" and \"NotAvailable\".""" + upgrade_applicable_date: Optional[datetime.datetime] = rest_field( + name="upgradeApplicableDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The date after which the current tier will be upgraded to the next tier if the + TierUpgradePolicy is \"OnceUpgradeIsAvailable\" (UTC).""" + upgrade_unavailability_reason: Optional[str] = rest_field( + name="upgradeUnavailabilityReason", visibility=["read", "create", "update", "delete", "query"] ) - """The same-account Agent Control Specification policy name targeted by the binding. Required.""" + """Reason in case the subscription is not eligible for upgrade to the next tier.""" @overload def __init__( self, *, - bound_resource_id: str, - target_policy_name: str, + next_tier_name: Optional[str] = None, + upgrade_availability_status: Optional[Union[str, "_models.UpgradeAvailabilityStatus"]] = None, + upgrade_applicable_date: Optional[datetime.datetime] = None, + upgrade_unavailability_reason: Optional[str] = None, ) -> None: ... @overload @@ -11539,61 +8371,7 @@ def __init__( severity_threshold: Optional[Union[str, "_models.ContentLevel"]] = None, blocking: Optional[bool] = None, source: Optional[Union[str, "_models.RaiPolicyContentSource"]] = None, - action: Optional[Union[str, "_models.RaiActionType"]] = 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 RaiPolicyCustomExternalSafetyProviderReference( - _Model -): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only - """A customer-visible reference to a subscription-level external safety provider. - - :ivar external_safety_provider_name: The registered external safety-provider name. Required. - :vartype external_safety_provider_name: str - :ivar managed_identity_resource_id: Optional managed identity used when invoking the external - safety provider. - :vartype managed_identity_resource_id: str - :ivar source: The request stage at which the provider runs. Required. Known values are: - "Prompt", "Completion", "PreToolCall", "PostToolCall", "PreRun", and "PostRun". - :vartype source: str or ~azure.mgmt.cognitiveservices.models.RaiPolicyContentSource - :ivar blocking: Whether a provider rejection blocks the request. - :vartype blocking: bool - """ - - external_safety_provider_name: str = rest_field( - name="externalSafetyProviderName", visibility=["read", "create", "update", "delete", "query"] - ) - """The registered external safety-provider name. Required.""" - managed_identity_resource_id: Optional[str] = rest_field( - name="managedIdentityResourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Optional managed identity used when invoking the external safety provider.""" - source: Union[str, "_models.RaiPolicyContentSource"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The request stage at which the provider runs. Required. Known values are: \"Prompt\", - \"Completion\", \"PreToolCall\", \"PostToolCall\", \"PreRun\", and \"PostRun\".""" - blocking: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether a provider rejection blocks the request.""" - - @overload - def __init__( - self, - *, - external_safety_provider_name: str, - source: Union[str, "_models.RaiPolicyContentSource"], - managed_identity_resource_id: Optional[str] = None, - blocking: Optional[bool] = None, + action: Optional[Union[str, "_models.RaiActionType"]] = None, ) -> None: ... @overload @@ -11610,14 +8388,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class RaiPolicyProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Azure OpenAI Content Filters properties. - :ivar format: The policy representation. Omission selects ContentFilters when creating a - policy. ACS policy creation and replacement require ACS. Known values are: "ContentFilters" and - "ACS". - :vartype format: str or ~azure.mgmt.cognitiveservices.models.RaiPolicyFormat - :ivar acs: The ACS manifest. Required by service validation when format is ACS. - :vartype acs: ~azure.mgmt.cognitiveservices.models.RaiAcsManifest - :ivar acs_regos: Reusable same-account Rego resources loaded with the ACS manifest. - :vartype acs_regos: list[~azure.mgmt.cognitiveservices.models.RaiRegoReference] :ivar type: Content Filters policy type. Known values are: "UserManaged" and "SystemManaged". :vartype type: str or ~azure.mgmt.cognitiveservices.models.RaiPolicyType :ivar mode: Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, @@ -11633,24 +8403,11 @@ class RaiPolicyProperties(_Model): # pylint: disable=docstring-keyword-should-m :vartype custom_blocklists: list[~azure.mgmt.cognitiveservices.models.CustomBlocklistConfig] :ivar safety_providers: The list of Safety Providers. :vartype safety_providers: list[~azure.mgmt.cognitiveservices.models.SafetyProviderConfig] - :ivar custom_external_safety_providers: Optional external safety-provider references used by - this policy. - :vartype custom_external_safety_providers: - list[~azure.mgmt.cognitiveservices.models.RaiPolicyCustomExternalSafetyProviderReference] :ivar egress_policy: Egress (outbound network) policy controlling which external endpoints sandboxed agents can reach. Includes rules with Allow/Deny/Transform/Rewrite actions. :vartype egress_policy: ~azure.mgmt.cognitiveservices.models.RaiEgressPolicyConfig """ - format: Optional[Union[str, "_models.RaiPolicyFormat"]] = rest_field(visibility=["read", "create", "update"]) - """The policy representation. Omission selects ContentFilters when creating a policy. ACS policy - creation and replacement require ACS. Known values are: \"ContentFilters\" and \"ACS\".""" - acs: Optional["_models.RaiAcsManifest"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ACS manifest. Required by service validation when format is ACS.""" - acs_regos: Optional[list["_models.RaiRegoReference"]] = rest_field( - name="acsRegos", visibility=["read", "create", "update", "delete", "query"] - ) - """Reusable same-account Rego resources loaded with the ACS manifest.""" type: Optional[Union[str, "_models.RaiPolicyType"]] = rest_field(visibility=["read"]) """Content Filters policy type. Known values are: \"UserManaged\" and \"SystemManaged\".""" mode: Optional[Union[str, "_models.RaiPolicyMode"]] = rest_field( @@ -11676,10 +8433,6 @@ class RaiPolicyProperties(_Model): # pylint: disable=docstring-keyword-should-m name="safetyProviders", visibility=["read", "create", "update", "delete", "query"] ) """The list of Safety Providers.""" - custom_external_safety_providers: Optional[list["_models.RaiPolicyCustomExternalSafetyProviderReference"]] = ( - rest_field(name="customExternalSafetyProviders", visibility=["read", "create", "update", "delete", "query"]) - ) - """Optional external safety-provider references used by this policy.""" egress_policy: Optional["_models.RaiEgressPolicyConfig"] = rest_field( name="egressPolicy", visibility=["read", "create", "update", "delete", "query"] ) @@ -11690,17 +8443,11 @@ class RaiPolicyProperties(_Model): # pylint: disable=docstring-keyword-should-m def __init__( self, *, - format: Optional[Union[str, "_models.RaiPolicyFormat"]] = None, - acs: Optional["_models.RaiAcsManifest"] = None, - acs_regos: Optional[list["_models.RaiRegoReference"]] = None, mode: Optional[Union[str, "_models.RaiPolicyMode"]] = None, base_policy_name: Optional[str] = None, content_filters: Optional[list["_models.RaiPolicyContentFilter"]] = None, custom_blocklists: Optional[list["_models.CustomBlocklistConfig"]] = None, safety_providers: Optional[list["_models.SafetyProviderConfig"]] = None, - custom_external_safety_providers: Optional[ - list["_models.RaiPolicyCustomExternalSafetyProviderReference"] - ] = None, egress_policy: Optional["_models.RaiEgressPolicyConfig"] = None, ) -> None: ... @@ -11715,121 +8462,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RaiRego(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """An account-scoped reusable Rego artifact. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of the reusable Rego artifact. - :vartype properties: ~azure.mgmt.cognitiveservices.models.RaiRegoProperties - :ivar etag: Resource ETag. - :vartype etag: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - properties: Optional["_models.RaiRegoProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of the reusable Rego artifact.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource ETag.""" - tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update"]) - """Resource tags.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.RaiRegoProperties"] = None, - tags: Optional[dict[str, 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 RaiRegoProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties of an account-scoped reusable Rego resource. - - :ivar encoding: How the Rego source is encoded on the wire. The default is None. Known values - are: "None" and "Base64". - :vartype encoding: str or ~azure.mgmt.cognitiveservices.models.RaiRegoEncoding - :ivar rego: Rego source in the selected transport encoding. Required. - :vartype rego: str - """ - - encoding: Optional[Union[str, "_models.RaiRegoEncoding"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """How the Rego source is encoded on the wire. The default is None. Known values are: \"None\" and - \"Base64\".""" - rego: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Rego source in the selected transport encoding. Required.""" - - @overload - def __init__( - self, - *, - rego: str, - encoding: Optional[Union[str, "_models.RaiRegoEncoding"]] = 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 RaiRegoReference(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """References one reusable Rego resource on the same account. - - :ivar rego_name: The same-account Rego resource name. Required. - :vartype rego_name: str - """ - - rego_name: str = rest_field(name="regoName", visibility=["read", "create", "update", "delete", "query"]) - """The same-account Rego resource name. Required.""" - - @overload - def __init__( - self, - *, - rego_name: 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 RaiSafetyProviderConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Azure OpenAI RAI safety provider config. @@ -12452,7 +9084,7 @@ class RoleBasedBuiltInAuthorizationPolicy(ApplicationAuthorizationPolicy, discri """Built-in role-based authorization policy. :ivar type: Authorization scheme type. Required. Standard AzureML RBAC. - :vartype type: str or ~azure.mgmt.cognitiveservices.models.DEFAULT + :vartype type: str or ~azure.mgmt.cognitiveservices.models.BuiltInAuthorizationScheme """ type: Literal[BuiltInAuthorizationScheme.DEFAULT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -12531,11 +9163,11 @@ class SASAuthTypeConnectionProperties( "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -12570,7 +9202,7 @@ class SASAuthTypeConnectionProperties( :ivar credentials: :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionSharedAccessSignature :ivar auth_type: Authentication type of the connection target. Required. SAS. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.SAS + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ credentials: Optional["_models.ConnectionSharedAccessSignature"] = rest_field( @@ -12626,11 +9258,11 @@ class ServicePrincipalAuthTypeConnectionProperties( "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -12665,7 +9297,7 @@ class ServicePrincipalAuthTypeConnectionProperties( :ivar credentials: :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionServicePrincipal :ivar auth_type: Authentication type of the connection target. Required. SERVICE_PRINCIPAL. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.SERVICE_PRINCIPAL + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ credentials: Optional["_models.ConnectionServicePrincipal"] = rest_field( @@ -12723,7 +9355,7 @@ class ServiceTagOutboundRule( :vartype destination: ~azure.mgmt.cognitiveservices.models.ServiceTagOutboundRuleDestination :ivar type: Type of a managed network Outbound Rule of a cognitive services account. Required. SERVICE_TAG. - :vartype type: str or ~azure.mgmt.cognitiveservices.models.SERVICE_TAG + :vartype type: str or ~azure.mgmt.cognitiveservices.models.RuleType """ destination: Optional["_models.ServiceTagOutboundRuleDestination"] = rest_field( @@ -13076,43 +9708,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SshSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """SSH configuration for a Container Instance compute. - - :ivar ssh_public_key: The SSH public key for authenticating to the compute instance. - :vartype ssh_public_key: str - :ivar admin_enabled: Whether SSH admin access is enabled. - :vartype admin_enabled: bool - """ - - ssh_public_key: Optional[str] = rest_field( - name="sshPublicKey", visibility=["read", "create", "update", "delete", "query"] - ) - """The SSH public key for authenticating to the compute instance.""" - admin_enabled: Optional[bool] = rest_field( - name="adminEnabled", visibility=["read", "create", "update", "delete", "query"] - ) - """Whether SSH admin access is enabled.""" - - @overload - def __init__( - self, - *, - ssh_public_key: Optional[str] = None, - admin_enabled: Optional[bool] = 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 SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata pertaining to creation and last modification of the resource. @@ -13281,6 +9876,59 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class TrustedCertificateSource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An Azure resource containing the CA certificate bundles trusted by supported features in the + account. + + :ivar type: Type of resource containing the certificate bundles. Currently only AzureKeyVault + is supported. Required. "AzureKeyVault" + :vartype type: str or ~azure.mgmt.cognitiveservices.models.TrustedCertificateSourceType + :ivar resource_id: Azure resource ID of the Key Vault containing the referenced secrets. The + account identity must have permission to read these secrets. Required. + :vartype resource_id: str + :ivar certificate_bundle_references: References to secrets containing one or more PEM-encoded + CA certificates. Each secret name and version pair must be unique within the source, using + case-insensitive comparison. The same secret name can be referenced with different versions. + Required. + :vartype certificate_bundle_references: + list[~azure.mgmt.cognitiveservices.models.CertificateBundleReference] + """ + + type: Union[str, "_models.TrustedCertificateSourceType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of resource containing the certificate bundles. Currently only AzureKeyVault is supported. + Required. \"AzureKeyVault\"""" + resource_id: str = rest_field(name="resourceId", visibility=["read", "create", "update", "delete", "query"]) + """Azure resource ID of the Key Vault containing the referenced secrets. The account identity must + have permission to read these secrets. Required.""" + certificate_bundle_references: list["_models.CertificateBundleReference"] = rest_field( + name="certificateBundleReferences", visibility=["read", "create", "update", "delete", "query"] + ) + """References to secrets containing one or more PEM-encoded CA certificates. Each secret name and + version pair must be unique within the source, using case-insensitive comparison. The same + secret name can be referenced with different versions. Required.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.TrustedCertificateSourceType"], + resource_id: str, + certificate_bundle_references: list["_models.CertificateBundleReference"], + ) -> 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 Usage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The usage data for a usage request. @@ -13444,11 +10092,11 @@ class UsernamePasswordAuthTypeConnectionProperties( "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -13483,7 +10131,7 @@ class UsernamePasswordAuthTypeConnectionProperties( :ivar credentials: :vartype credentials: ~azure.mgmt.cognitiveservices.models.ConnectionUsernamePassword :ivar auth_type: Authentication type of the connection target. Required. USERNAME_PASSWORD. - :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.USERNAME_PASSWORD + :vartype auth_type: str or ~azure.mgmt.cognitiveservices.models.ConnectionAuthType """ credentials: Optional["_models.ConnectionUsernamePassword"] = rest_field( @@ -13672,276 +10320,3 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - - -class Workbench(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only - """Workbench resource under a Cognitive Services project. Provides interactive compute with data - access for AI development. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cognitiveservices.models.SystemData - :ivar properties: Properties of the workbench resource. Required. - :vartype properties: ~azure.mgmt.cognitiveservices.models.WorkbenchProperties - :ivar etag: Resource Etag. - :vartype etag: str - :ivar identity: Identity for the resource. - :vartype identity: ~azure.mgmt.cognitiveservices.models.Identity - """ - - properties: "_models.WorkbenchProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Properties of the workbench resource. Required.""" - etag: Optional[str] = rest_field(visibility=["read"]) - """Resource Etag.""" - identity: Optional["_models.Identity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identity for the resource.""" - - @overload - def __init__( - self, - *, - properties: "_models.WorkbenchProperties", - identity: Optional["_models.Identity"] = 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 WorkbenchProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Properties for a Workbench resource. - - :ivar target_cluster_id: Resource ID of the Foundry Compute or virtual cluster that hosts this - workbench. Changing the cluster requires the workbench to be stopped. Required. - :vartype target_cluster_id: str - :ivar image_link: Container image URI (e.g., MCR or ACR image path) for the workbench. - Immutable after creation. Required. - :vartype image_link: str - :ivar instance_type: For virtual clusters, an exact Singularity instance type or a full-node - Azure VM size. If omitted on creation, defaults to Singularity.D4_v3. Foundry Compute ignores - this override and uses the pool configuration. Changing the instance type requires the - workbench to be stopped. - :vartype instance_type: str - :ivar gpu_count: GPU count for GPU pools or vCPU count for CPU pools. Must be 1, 2, 4, 8, or a - positive multiple of 8. A full-node Azure VM size permits partition selection; omission uses - the full node. For an exact Singularity instance type, a supplied count must match that type; - the Singularity.D4_v3 fallback accepts 4. - :vartype gpu_count: int - :ivar idle_time_before_shutdown: ISO 8601 duration before the idle workbench is automatically - shut down (e.g., 'PT30M'). - :vartype idle_time_before_shutdown: str - :ivar dataset_id: The dataset ID to mount for the workbench. Set only during creation. - :vartype dataset_id: str - :ivar ssh_settings: SSH configuration for remote access to the workbench. Set only during - creation. - :vartype ssh_settings: ~azure.mgmt.cognitiveservices.models.SshSettings - :ivar connectivity_endpoints: Network connectivity endpoints assigned to the workbench. - :vartype connectivity_endpoints: ~azure.mgmt.cognitiveservices.models.ConnectivityEndpoints - :ivar web_endpoint: The web endpoint URL for accessing the workbench. - :vartype web_endpoint: str - :ivar provisioning_state: Provisioning state of the workbench resource, independent of runtime - lifecycle status. Known values are: "Creating", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.cognitiveservices.models.WorkbenchProvisioningState - :ivar status: Runtime lifecycle status of the workbench. Independent of resource provisioning; - start, stop, restart, and runtime health changes do not change provisioningState. Known values - are: "Unknown", "Creating", "Starting", "Running", "Stopping", "Stopped", "Restarting", - "Updating", "Deleting", and "Failed". - :vartype status: str or ~azure.mgmt.cognitiveservices.models.WorkbenchStatus - :ivar errors: Error details for the workbench resource. - :vartype errors: list[~azure.mgmt.cognitiveservices.models.ErrorDetail] - :ivar creation_time: Creation time of the workbench resource. - :vartype creation_time: ~datetime.datetime - """ - - target_cluster_id: str = rest_field( - name="targetClusterId", visibility=["read", "create", "update", "delete", "query"] - ) - """Resource ID of the Foundry Compute or virtual cluster that hosts this workbench. Changing the - cluster requires the workbench to be stopped. Required.""" - image_link: str = rest_field(name="imageLink", visibility=["read", "create"]) - """Container image URI (e.g., MCR or ACR image path) for the workbench. Immutable after creation. - Required.""" - instance_type: Optional[str] = rest_field( - name="instanceType", visibility=["read", "create", "update", "delete", "query"] - ) - """For virtual clusters, an exact Singularity instance type or a full-node Azure VM size. If - omitted on creation, defaults to Singularity.D4_v3. Foundry Compute ignores this override and - uses the pool configuration. Changing the instance type requires the workbench to be stopped.""" - gpu_count: Optional[int] = rest_field(name="gpuCount", visibility=["read", "create", "update", "delete", "query"]) - """GPU count for GPU pools or vCPU count for CPU pools. Must be 1, 2, 4, 8, or a positive multiple - of 8. A full-node Azure VM size permits partition selection; omission uses the full node. For - an exact Singularity instance type, a supplied count must match that type; the - Singularity.D4_v3 fallback accepts 4.""" - idle_time_before_shutdown: Optional[str] = rest_field( - name="idleTimeBeforeShutdown", visibility=["read", "create", "update", "delete", "query"] - ) - """ISO 8601 duration before the idle workbench is automatically shut down (e.g., 'PT30M').""" - dataset_id: Optional[str] = rest_field(name="datasetId", visibility=["read", "create"]) - """The dataset ID to mount for the workbench. Set only during creation.""" - ssh_settings: Optional["_models.SshSettings"] = rest_field(name="sshSettings", visibility=["read", "create"]) - """SSH configuration for remote access to the workbench. Set only during creation.""" - connectivity_endpoints: Optional["_models.ConnectivityEndpoints"] = rest_field( - name="connectivityEndpoints", visibility=["read"] - ) - """Network connectivity endpoints assigned to the workbench.""" - web_endpoint: Optional[str] = rest_field(name="webEndpoint", visibility=["read"]) - """The web endpoint URL for accessing the workbench.""" - provisioning_state: Optional[Union[str, "_models.WorkbenchProvisioningState"]] = rest_field( - name="provisioningState", visibility=["read"] - ) - """Provisioning state of the workbench resource, independent of runtime lifecycle status. Known - values are: \"Creating\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - status: Optional[Union[str, "_models.WorkbenchStatus"]] = rest_field(visibility=["read"]) - """Runtime lifecycle status of the workbench. Independent of resource provisioning; start, stop, - restart, and runtime health changes do not change provisioningState. Known values are: - \"Unknown\", \"Creating\", \"Starting\", \"Running\", \"Stopping\", \"Stopped\", - \"Restarting\", \"Updating\", \"Deleting\", and \"Failed\".""" - errors: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) - """Error details for the workbench resource.""" - creation_time: Optional[datetime.datetime] = rest_field(name="creationTime", visibility=["read"], format="rfc3339") - """Creation time of the workbench resource.""" - - @overload - def __init__( - self, - *, - target_cluster_id: str, - image_link: str, - instance_type: Optional[str] = None, - gpu_count: Optional[int] = None, - idle_time_before_shutdown: Optional[str] = None, - dataset_id: Optional[str] = None, - ssh_settings: Optional["_models.SshSettings"] = 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 WorkbenchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """The mutable fields of a workbench resource. - - :ivar properties: Properties of the workbench to update. - :vartype properties: ~azure.mgmt.cognitiveservices.models.WorkbenchUpdateProperties - :ivar identity: Identity for the resource. May be changed while the workbench is running only - when properties is omitted or null; the change takes effect after restart. If a properties - object is supplied, including an empty object or timeout-only update, changing identity - requires the workbench to be stopped. - :vartype identity: ~azure.mgmt.cognitiveservices.models.Identity - """ - - properties: Optional["_models.WorkbenchUpdateProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Properties of the workbench to update.""" - identity: Optional["_models.Identity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identity for the resource. May be changed while the workbench is running only when properties - is omitted or null; the change takes effect after restart. If a properties object is supplied, - including an empty object or timeout-only update, changing identity requires the workbench to - be stopped.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.WorkbenchUpdateProperties"] = None, - identity: Optional["_models.Identity"] = 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 WorkbenchUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only - """Mutable properties for a Workbench resource. - - :ivar target_cluster_id: Resource ID of the Foundry Compute or virtual cluster that hosts this - workbench. Changing the cluster requires the workbench to be stopped. - :vartype target_cluster_id: str - :ivar idle_time_before_shutdown: ISO 8601 duration before the idle workbench is automatically - shut down (e.g., 'PT30M'). - :vartype idle_time_before_shutdown: str - :ivar instance_type: For virtual clusters, an exact Singularity instance type or a full-node - Azure VM size. Omit to preserve the current value; null resets to the Singularity.D4_v3 - fallback. Foundry Compute ignores this override and uses the pool configuration. An actual - instance type change requires the workbench to be stopped. - :vartype instance_type: str - :ivar gpu_count: GPU count for GPU pools or vCPU count for CPU pools. Must be 1, 2, 4, 8, or a - positive multiple of 8. Omit to preserve the current value; null clears the override to use the - full node or the instance type's default count. Full-node Azure VM sizes permit partition - selection. A supplied count must match an exact Singularity instance type; the - Singularity.D4_v3 fallback accepts 4. - :vartype gpu_count: int - """ - - target_cluster_id: Optional[str] = rest_field( - name="targetClusterId", visibility=["read", "create", "update", "delete", "query"] - ) - """Resource ID of the Foundry Compute or virtual cluster that hosts this workbench. Changing the - cluster requires the workbench to be stopped.""" - idle_time_before_shutdown: Optional[str] = rest_field( - name="idleTimeBeforeShutdown", visibility=["read", "create", "update", "delete", "query"] - ) - """ISO 8601 duration before the idle workbench is automatically shut down (e.g., 'PT30M').""" - instance_type: Optional[str] = rest_field( - name="instanceType", visibility=["read", "create", "update", "delete", "query"] - ) - """For virtual clusters, an exact Singularity instance type or a full-node Azure VM size. Omit to - preserve the current value; null resets to the Singularity.D4_v3 fallback. Foundry Compute - ignores this override and uses the pool configuration. An actual instance type change requires - the workbench to be stopped.""" - gpu_count: Optional[int] = rest_field(name="gpuCount", visibility=["read", "create", "update", "delete", "query"]) - """GPU count for GPU pools or vCPU count for CPU pools. Must be 1, 2, 4, 8, or a positive multiple - of 8. Omit to preserve the current value; null clears the override to use the full node or the - instance type's default count. Full-node Azure VM sizes permit partition selection. A supplied - count must match an exact Singularity instance type; the Singularity.D4_v3 fallback accepts 4.""" - - @overload - def __init__( - self, - *, - target_cluster_id: Optional[str] = None, - idle_time_before_shutdown: Optional[str] = None, - instance_type: Optional[str] = None, - gpu_count: Optional[int] = 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) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py index c2f726879a1b..5dd41a3598b2 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py @@ -22,8 +22,6 @@ from ._operations import EncryptionScopesOperations # type: ignore from ._operations import RaiPoliciesOperations # type: ignore from ._operations import SubscriptionRaiPolicyOperations # type: ignore -from ._operations import RaiRegosOperations # type: ignore -from ._operations import RaiBindingsOperations # type: ignore from ._operations import RaiBlocklistItemsOperations # type: ignore from ._operations import RaiBlocklistsOperations # type: ignore from ._operations import RaiTopicsOperations # type: ignore @@ -35,16 +33,8 @@ from ._operations import ProjectConnectionsOperations # type: ignore from ._operations import ProjectCapabilityHostsOperations # type: ignore from ._operations import QuotaTiersOperations # type: ignore -from ._operations import ArcDeploymentsOperations # type: ignore from ._operations import AgentApplicationsOperations # type: ignore -from ._operations import ManagedComputeDeploymentsOperations # type: ignore -from ._operations import AdapterDeploymentsOperations # type: ignore -from ._operations import ComputeOperationsOperations # type: ignore -from ._operations import ManagedComputeUsagesOperationGroupOperations # type: ignore -from ._operations import ComputesOperations # type: ignore -from ._operations import WorkbenchesOperations # type: ignore from ._operations import ManagedComputeCapacitiesOperations # type: ignore -from ._operations import CostControlsOperations # type: ignore from ._operations import PrivateLinkResourcesOperations # type: ignore from ._operations import TestRaiExternalSafetyProviderOperations # type: ignore from ._operations import RaiExternalSafetyProviderOperations # type: ignore @@ -78,8 +68,6 @@ "EncryptionScopesOperations", "RaiPoliciesOperations", "SubscriptionRaiPolicyOperations", - "RaiRegosOperations", - "RaiBindingsOperations", "RaiBlocklistItemsOperations", "RaiBlocklistsOperations", "RaiTopicsOperations", @@ -91,16 +79,8 @@ "ProjectConnectionsOperations", "ProjectCapabilityHostsOperations", "QuotaTiersOperations", - "ArcDeploymentsOperations", "AgentApplicationsOperations", - "ManagedComputeDeploymentsOperations", - "AdapterDeploymentsOperations", - "ComputeOperationsOperations", - "ManagedComputeUsagesOperationGroupOperations", - "ComputesOperations", - "WorkbenchesOperations", "ManagedComputeCapacitiesOperations", - "CostControlsOperations", "PrivateLinkResourcesOperations", "TestRaiExternalSafetyProviderOperations", "RaiExternalSafetyProviderOperations", diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_operations.py index 6f5dc3f035dc..2a116a6568bf 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_operations.py @@ -12,12 +12,11 @@ from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse -from azure.core import MatchConditions, PipelineClient +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, - ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, StreamClosedError, @@ -37,7 +36,7 @@ from .._configuration import CognitiveServicesManagementClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer -from .._utils.utils import ClientMixinABC, prep_if_match, prep_if_none_match +from .._utils.utils import ClientMixinABC from .._validation import api_version_validation T = TypeVar("T") @@ -52,7 +51,7 @@ def build_operations_list_request(**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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +72,7 @@ def build_accounts_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +101,7 @@ def build_accounts_create_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +132,7 @@ def build_accounts_update_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +161,7 @@ def build_accounts_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}" path_format_arguments = { @@ -185,7 +184,7 @@ def build_accounts_list_by_resource_group_request( # pylint: disable=name-too-l _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +209,7 @@ def build_accounts_list_request(subscription_id: str, **kwargs: Any) -> HttpRequ _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -236,7 +235,7 @@ def build_accounts_list_keys_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +264,7 @@ def build_accounts_regenerate_key_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -295,7 +294,7 @@ def build_accounts_list_skus_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -323,7 +322,7 @@ def build_accounts_list_usages_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -353,7 +352,7 @@ def build_accounts_list_models_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -375,42 +374,11 @@ def build_accounts_list_models_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_accounts_evaluate_deployment_policies_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/evaluateDeploymentPolicies" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_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_deleted_accounts_list_request(subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -436,7 +404,7 @@ def build_deleted_accounts_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -464,7 +432,7 @@ def build_deleted_accounts_purge_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}" path_format_arguments = { @@ -492,7 +460,7 @@ def build_private_endpoint_connections_get_request( # pylint: disable=name-too- _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -528,7 +496,7 @@ def build_private_endpoint_connections_create_or_update_request( # pylint: disa _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -564,7 +532,7 @@ def build_private_endpoint_connections_delete_request( # pylint: disable=name-t ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { @@ -590,7 +558,7 @@ def build_private_endpoint_connections_list_request( # pylint: disable=name-too _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -618,7 +586,7 @@ def build_deployments_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -648,7 +616,7 @@ def build_deployments_create_or_update_request( # pylint: disable=name-too-long _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -680,7 +648,7 @@ def build_deployments_update_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -710,7 +678,7 @@ def build_deployments_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}" path_format_arguments = { @@ -734,7 +702,7 @@ def build_deployments_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -762,7 +730,7 @@ def build_deployments_list_skus_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -791,7 +759,7 @@ def build_deployments_pause_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -820,7 +788,7 @@ def build_deployments_resume_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -849,7 +817,7 @@ def build_commitment_plans_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -879,7 +847,7 @@ def build_commitment_plans_create_or_update_request( # pylint: disable=name-too _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -909,7 +877,7 @@ def build_commitment_plans_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}" path_format_arguments = { @@ -933,7 +901,7 @@ def build_commitment_plans_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -961,7 +929,7 @@ def build_commitment_plans_get_plan_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -990,7 +958,7 @@ def build_commitment_plans_create_or_update_plan_request( # pylint: disable=nam _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1021,7 +989,7 @@ def build_commitment_plans_update_plan_request( # pylint: disable=name-too-long _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1050,7 +1018,7 @@ def build_commitment_plans_delete_plan_request( # pylint: disable=name-too-long ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}" path_format_arguments = { @@ -1073,7 +1041,7 @@ def build_commitment_plans_list_plans_by_resource_group_request( # pylint: disa _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1100,7 +1068,7 @@ def build_commitment_plans_list_plans_by_subscription_request( # pylint: disabl _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1130,7 +1098,7 @@ def build_commitment_plans_get_association_request( # pylint: disable=name-too- _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1166,7 +1134,7 @@ def build_commitment_plans_create_or_update_association_request( # pylint: disa _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1202,7 +1170,7 @@ def build_commitment_plans_delete_association_request( # pylint: disable=name-t ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}" path_format_arguments = { @@ -1228,7 +1196,7 @@ def build_commitment_plans_list_associations_request( # pylint: disable=name-to _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1256,7 +1224,7 @@ def build_encryption_scopes_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1286,7 +1254,7 @@ def build_encryption_scopes_create_or_update_request( # pylint: disable=name-to _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1316,7 +1284,7 @@ def build_encryption_scopes_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}" path_format_arguments = { @@ -1340,7 +1308,7 @@ def build_encryption_scopes_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1368,7 +1336,7 @@ def build_rai_policies_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1392,20 +1360,13 @@ def build_rai_policies_get_request( def build_rai_policies_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - rai_policy_name: str, - subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + resource_group_name: str, account_name: str, rai_policy_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1426,30 +1387,16 @@ def build_rai_policies_create_or_update_request( # pylint: disable=name-too-lon if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_rai_policies_delete_request( - resource_group_name: str, - account_name: str, - rai_policy_name: str, - subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + resource_group_name: str, account_name: str, rai_policy_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}" path_format_arguments = { @@ -1464,15 +1411,7 @@ def build_rai_policies_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - if_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_rai_policies_list_request( @@ -1481,7 +1420,7 @@ def build_rai_policies_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1509,7 +1448,7 @@ def build_subscription_rai_policy_get_request( # pylint: disable=name-too-long _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1537,7 +1476,7 @@ def build_subscription_rai_policy_create_or_update_request( # pylint: disable=n _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1565,7 +1504,7 @@ def build_subscription_rai_policy_delete_request( # pylint: disable=name-too-lo ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}" path_format_arguments = { @@ -1581,292 +1520,6 @@ def build_subscription_rai_policy_delete_request( # pylint: disable=name-too-lo return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_rai_regos_get_request( - resource_group_name: str, account_name: str, rai_rego_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiRegos/{raiRegoName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "raiRegoName": _SERIALIZER.url("rai_rego_name", rai_rego_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_regos_create_or_update_request( - resource_group_name: str, - account_name: str, - rai_rego_name: str, - subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiRegos/{raiRegoName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "raiRegoName": _SERIALIZER.url("rai_rego_name", rai_rego_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") - if_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_regos_delete_request( - resource_group_name: str, - account_name: str, - rai_rego_name: str, - subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **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", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiRegos/{raiRegoName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "raiRegoName": _SERIALIZER.url("rai_rego_name", rai_rego_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_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_regos_list_request( - resource_group_name: str, account_name: str, subscription_id: str, *, top: Optional[int] = None, **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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiRegos" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_bindings_get_request( - resource_group_name: str, account_name: str, rai_binding_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBindings/{raiBindingName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "raiBindingName": _SERIALIZER.url("rai_binding_name", rai_binding_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_bindings_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - rai_binding_name: str, - subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBindings/{raiBindingName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "raiBindingName": _SERIALIZER.url("rai_binding_name", rai_binding_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") - if_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_bindings_delete_request( - resource_group_name: str, - account_name: str, - rai_binding_name: str, - subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **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", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBindings/{raiBindingName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "raiBindingName": _SERIALIZER.url("rai_binding_name", rai_binding_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_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rai_bindings_list_request( - resource_group_name: str, account_name: str, subscription_id: str, *, top: Optional[int] = None, **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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBindings" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - def build_rai_blocklist_items_get_request( resource_group_name: str, account_name: str, @@ -1878,7 +1531,7 @@ def build_rai_blocklist_items_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1914,7 +1567,7 @@ def build_rai_blocklist_items_create_or_update_request( # pylint: disable=name- _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1950,7 +1603,7 @@ def build_rai_blocklist_items_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}" path_format_arguments = { @@ -1975,7 +1628,7 @@ def build_rai_blocklist_items_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2005,7 +1658,7 @@ def build_rai_blocklist_items_batch_add_request( # pylint: disable=name-too-lon _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2037,7 +1690,7 @@ def build_rai_blocklist_items_batch_delete_request( # pylint: disable=name-too- _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems" path_format_arguments = { @@ -2065,7 +1718,7 @@ def build_rai_blocklists_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2095,7 +1748,7 @@ def build_rai_blocklists_create_or_update_request( # pylint: disable=name-too-l _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2125,7 +1778,7 @@ def build_rai_blocklists_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}" path_format_arguments = { @@ -2149,7 +1802,7 @@ def build_rai_blocklists_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2177,7 +1830,7 @@ def build_rai_topics_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2207,7 +1860,7 @@ def build_rai_topics_create_or_update_request( # pylint: disable=name-too-long _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2237,7 +1890,7 @@ def build_rai_topics_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}" path_format_arguments = { @@ -2261,7 +1914,7 @@ def build_rai_topics_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2289,7 +1942,7 @@ def build_rai_tool_labels_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2319,7 +1972,7 @@ def build_rai_tool_labels_create_or_update_request( # pylint: disable=name-too- _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2349,7 +2002,7 @@ def build_rai_tool_labels_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}" path_format_arguments = { @@ -2373,7 +2026,7 @@ def build_rai_tool_labels_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2401,7 +2054,7 @@ def build_rai_content_filters_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2427,7 +2080,7 @@ def build_rai_content_filters_list_request(location: str, subscription_id: str, _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2456,7 +2109,7 @@ def build_network_security_perimeter_configurations_get_request( # pylint: disa _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2485,7 +2138,7 @@ def build_network_security_perimeter_configurations_list_request( # pylint: dis _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2513,7 +2166,7 @@ def build_network_security_perimeter_configurations_reconcile_request( # pylint _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2542,7 +2195,7 @@ def build_defender_for_ai_settings_get_request( # pylint: disable=name-too-long _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2574,7 +2227,7 @@ def build_defender_for_ai_settings_create_or_update_request( # pylint: disable= _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2608,7 +2261,7 @@ def build_defender_for_ai_settings_update_request( # pylint: disable=name-too-l _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2641,7 +2294,7 @@ def build_defender_for_ai_settings_list_request( # pylint: disable=name-too-lon _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2669,7 +2322,7 @@ def build_projects_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2699,7 +2352,7 @@ def build_projects_create_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2731,7 +2384,7 @@ def build_projects_update_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2761,7 +2414,7 @@ def build_projects_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}" path_format_arguments = { @@ -2785,7 +2438,7 @@ def build_projects_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2818,7 +2471,7 @@ def build_project_connections_get_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2854,7 +2507,7 @@ def build_project_connections_create_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2892,7 +2545,7 @@ def build_project_connections_update_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -2928,7 +2581,7 @@ def build_project_connections_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}" path_format_arguments = { @@ -2961,7 +2614,7 @@ def build_project_connections_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3001,7 +2654,7 @@ def build_project_capability_hosts_get_request( # pylint: disable=name-too-long _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3037,7 +2690,7 @@ def build_project_capability_hosts_create_or_update_request( # pylint: disable= _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3073,7 +2726,7 @@ def build_project_capability_hosts_delete_request( # pylint: disable=name-too-l ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}" path_format_arguments = { @@ -3098,7 +2751,7 @@ def build_project_capability_hosts_list_request( # pylint: disable=name-too-lon _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3125,7 +2778,7 @@ def build_quota_tiers_get_request(default: str, subscription_id: str, **kwargs: _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3153,7 +2806,7 @@ def build_quota_tiers_create_or_update_request( # pylint: disable=name-too-long _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3181,7 +2834,7 @@ def build_quota_tiers_update_request(default: str, subscription_id: str, **kwarg _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3210,7 +2863,7 @@ def build_quota_tiers_list_by_subscription_request( # pylint: disable=name-too- _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3230,157 +2883,13 @@ def build_quota_tiers_list_by_subscription_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_arc_deployments_get_request( - resource_group_name: str, account_name: str, deployment_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/arcDeployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_arc_deployments_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, deployment_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/arcDeployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_arc_deployments_update_request( - resource_group_name: str, account_name: str, deployment_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/arcDeployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_arc_deployments_delete_request( - resource_group_name: str, account_name: str, deployment_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/arcDeployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_arc_deployments_list_request( - resource_group_name: str, account_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/arcDeployments" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - def build_agent_applications_get_request( resource_group_name: str, account_name: str, project_name: str, name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3411,7 +2920,7 @@ def build_agent_applications_create_or_update_request( # pylint: disable=name-t _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3442,7 +2951,7 @@ def build_agent_applications_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}" path_format_arguments = { @@ -3479,7 +2988,7 @@ def build_agent_applications_list_request( _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3522,7 +3031,7 @@ def build_agent_applications_list_agents_request( # pylint: disable=name-too-lo _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -3551,7 +3060,7 @@ def build_agent_applications_enable_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/enable" path_format_arguments = { @@ -3575,7 +3084,7 @@ def build_agent_applications_disable_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/disable" path_format_arguments = { @@ -3594,28 +3103,38 @@ def build_agent_applications_disable_request( return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_managed_compute_deployments_get_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, deployment_name: str, subscription_id: str, **kwargs: Any +def build_managed_compute_capacities_list_request( # pylint: disable=name-too-long + subscription_id: str, + *, + offer: str, + accelerator_type: Optional[str] = None, + deployment_id: Optional[str] = None, + location: Optional[str] = None, + **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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/managedComputeCapacities" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["offer"] = _SERIALIZER.query("offer", offer, "str") + if accelerator_type is not None: + _params["acceleratorType"] = _SERIALIZER.query("accelerator_type", accelerator_type, "str") + if deployment_id is not None: + _params["deploymentId"] = _SERIALIZER.query("deployment_id", deployment_id, "str") + if location is not None: + _params["location"] = _SERIALIZER.query("location", location, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3623,23 +3142,21 @@ def build_managed_compute_deployments_get_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_managed_compute_deployments_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, deployment_name: str, subscription_id: str, **kwargs: Any +def build_private_link_resources_list_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3648,30 +3165,28 @@ def build_managed_compute_deployments_create_or_update_request( # pylint: disab _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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_managed_compute_deployments_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, deployment_name: str, subscription_id: str, **kwargs: Any +def build_test_rai_external_safety_provider_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, safety_provider_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/testRaiExternalSafetyProvider/{safetyProviderName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + "safetyProviderName": _SERIALIZER.url("safety_provider_name", safety_provider_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3684,22 +3199,23 @@ def build_managed_compute_deployments_update_request( # pylint: disable=name-to _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_managed_compute_deployments_delete_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, deployment_name: str, subscription_id: str, **kwargs: Any +def build_rai_external_safety_provider_get_request( # pylint: disable=name-too-long + safety_provider_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + "safetyProviderName": _SERIALIZER.url("safety_provider_name", safety_provider_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3707,24 +3223,27 @@ def build_managed_compute_deployments_delete_request( # pylint: disable=name-to # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_managed_compute_deployments_list_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any + +def build_rai_external_safety_provider_create_or_update_request( # pylint: disable=name-too-long + safety_provider_name: str, subscription_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", "2026-09-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "safetyProviderName": _SERIALIZER.url("safety_provider_name", safety_provider_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3733,27 +3252,24 @@ def build_managed_compute_deployments_list_request( # pylint: disable=name-too- _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_adapter_deployments_get_request( - resource_group_name: str, account_name: str, adapter_deployment_name: str, subscription_id: str, **kwargs: Any +def build_rai_external_safety_provider_delete_request( # pylint: disable=name-too-long + safety_provider_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/adapterDeployments/{adapterDeploymentName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "adapterDeploymentName": _SERIALIZER.url("adapter_deployment_name", adapter_deployment_name, "str"), + "safetyProviderName": _SERIALIZER.url("safety_provider_name", safety_provider_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3761,36 +3277,22 @@ def build_adapter_deployments_get_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_adapter_deployments_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any +def build_rai_external_safety_providers_list_request( # pylint: disable=name-too-long + subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/adapterDeployments/{adapterDeploymentName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "adapterDeploymentName": _SERIALIZER.url("adapter_deployment_name", adapter_deployment_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3799,34 +3301,27 @@ def build_adapter_deployments_create_or_update_request( # pylint: disable=name- _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") - if_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_adapter_deployments_list_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any +def build_account_connections_get_request( + resource_group_name: str, account_name: str, connection_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/adapterDeployments" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3840,27 +3335,23 @@ def build_adapter_deployments_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_adapter_deployments_delete_request( - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any +def build_account_connections_create_request( + resource_group_name: str, account_name: str, connection_name: str, subscription_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", "2026-09-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/adapterDeployments/{adapterDeploymentName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "adapterDeploymentName": _SERIALIZER.url("adapter_deployment_name", adapter_deployment_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3869,31 +3360,30 @@ def build_adapter_deployments_delete_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_compute_operations_get_request( - location: str, operation_id: str, subscription_id: str, **kwargs: Any +def build_account_connections_update_request( + resource_group_name: str, account_name: str, connection_name: str, subscription_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", "2026-09-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/computeOperations/{operationId}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3902,25 +3392,26 @@ def build_compute_operations_get_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_managed_compute_usages_operation_group_list_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any +def build_account_connections_delete_request( + resource_group_name: str, account_name: str, connection_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/managedComputeUsages" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3928,34 +3419,43 @@ def build_managed_compute_usages_operation_group_list_request( # pylint: disabl # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_computes_get_request( - resource_group_name: str, account_name: str, compute_name: str, subscription_id: str, **kwargs: Any +def build_account_connections_list_request( + resource_group_name: str, + account_name: str, + subscription_id: str, + *, + target: Optional[str] = None, + category: Optional[str] = None, + include_all: bool = False, + **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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if target is not None: + _params["target"] = _SERIALIZER.query("target", target, "str") + if category is not None: + _params["category"] = _SERIALIZER.query("category", category, "str") + if include_all is not None: + _params["includeAll"] = _SERIALIZER.query("include_all", include_all, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -3963,21 +3463,22 @@ def build_computes_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_computes_create_or_update_request( - resource_group_name: str, account_name: str, compute_name: str, subscription_id: str, **kwargs: Any +def build_account_capability_hosts_get_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, capability_host_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), + "capabilityHostName": _SERIALIZER.url("capability_host_name", capability_host_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -3986,50 +3487,28 @@ def build_computes_create_or_update_request( _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") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_computes_delete_request( - resource_group_name: str, account_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_computes_list_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any +def build_account_capability_hosts_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, capability_host_name: str, subscription_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", "2026-09-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "capabilityHostName": _SERIALIZER.url("capability_host_name", capability_host_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4038,24 +3517,26 @@ def build_computes_list_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_computes_start_request( - resource_group_name: str, account_name: str, compute_name: str, subscription_id: str, **kwargs: Any +def build_account_capability_hosts_delete_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, capability_host_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}/start" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), + "capabilityHostName": _SERIALIZER.url("capability_host_name", capability_host_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4063,45 +3544,24 @@ def build_computes_start_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_computes_stop_request( - resource_group_name: str, account_name: str, compute_name: str, subscription_id: str, **kwargs: Any +def build_account_capability_hosts_list_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, subscription_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", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}/stop" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_computes_restart_request( - resource_group_name: str, account_name: str, compute_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}/restart" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "computeName": _SERIALIZER.url("compute_name", compute_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4109,31 +3569,34 @@ def build_computes_restart_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_workbenches_get_request( +def build_outbound_rule_get_request( resource_group_name: str, account_name: str, - project_name: str, - workbench_name: str, + managed_network_name: str, + rule_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "workbenchName": _SERIALIZER.url("workbench_name", workbench_name, "str"), + "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), + "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4147,11 +3610,11 @@ def build_workbenches_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_workbenches_create_or_update_request( # pylint: disable=name-too-long +def build_outbound_rule_create_or_update_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, - project_name: str, - workbench_name: str, + managed_network_name: str, + rule_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: @@ -4159,17 +3622,17 @@ def build_workbenches_create_or_update_request( # pylint: disable=name-too-long _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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "workbenchName": _SERIALIZER.url("workbench_name", workbench_name, "str"), + "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), + "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4185,29 +3648,25 @@ def build_workbenches_create_or_update_request( # pylint: disable=name-too-long return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_workbenches_update_request( +def build_outbound_rule_delete_request( resource_group_name: str, account_name: str, - project_name: str, - workbench_name: str, + managed_network_name: str, + rule_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "workbenchName": _SERIALIZER.url("workbench_name", workbench_name, "str"), + "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), + "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4215,33 +3674,25 @@ def build_workbenches_update_request( # 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_workbenches_delete_request( - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - subscription_id: str, - **kwargs: Any +def build_outbound_rule_list_request( + resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "workbenchName": _SERIALIZER.url("workbench_name", workbench_name, "str"), + "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4249,25 +3700,28 @@ def build_workbenches_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_workbenches_list_request( - resource_group_name: str, account_name: str, project_name: str, subscription_id: str, **kwargs: Any + +def build_managed_network_settings_get_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), + "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4281,25 +3735,23 @@ def build_workbenches_list_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_workbenches_start_request( - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - subscription_id: str, - **kwargs: Any +def build_managed_network_settings_put_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}/start" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "workbenchName": _SERIALIZER.url("workbench_name", workbench_name, "str"), + "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4307,28 +3759,31 @@ def build_workbenches_start_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # 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="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_workbenches_stop_request( - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - subscription_id: str, - **kwargs: Any + +def build_managed_network_settings_patch_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}/stop" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "workbenchName": _SERIALIZER.url("workbench_name", workbench_name, "str"), + "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4336,28 +3791,27 @@ def build_workbenches_stop_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_workbenches_restart_request( - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - subscription_id: str, - **kwargs: Any + +def build_managed_network_settings_delete_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, managed_network_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}/restart" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "workbenchName": _SERIALIZER.url("workbench_name", workbench_name, "str"), + "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4365,38 +3819,30 @@ def build_workbenches_restart_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_managed_compute_capacities_list_request( # pylint: disable=name-too-long - subscription_id: str, - *, - offer: str, - accelerator_type: Optional[str] = None, - deployment_id: Optional[str] = None, - **kwargs: Any +def build_managed_network_settings_list_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/managedComputeCapacities" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accountName": _SERIALIZER.url("account_name", account_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _params["offer"] = _SERIALIZER.query("offer", offer, "str") - if accelerator_type is not None: - _params["acceleratorType"] = _SERIALIZER.query("accelerator_type", accelerator_type, "str") - if deployment_id is not None: - _params["deploymentId"] = _SERIALIZER.query("deployment_id", deployment_id, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4404,22 +3850,23 @@ def build_managed_compute_capacities_list_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_cost_controls_get_request( - resource_group_name: str, account_name: str, cost_control_name: str, subscription_id: str, **kwargs: Any +def build_outbound_rules_post_request( + resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/costControls/{costControlName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/batchOutboundRules" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "costControlName": _SERIALIZER.url("cost_control_name", cost_control_name, "str"), + "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4428,35 +3875,30 @@ def build_cost_controls_get_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_cost_controls_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - cost_control_name: str, - subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any +def build_managed_network_provisions_provision_managed_network_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/costControls/{costControlName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/provision" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "costControlName": _SERIALIZER.url("cost_control_name", cost_control_name, "str"), + "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4468,40 +3910,34 @@ def build_cost_controls_create_or_update_request( # pylint: disable=name-too-lo if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_cost_controls_update_request( +def build_agent_deployments_get_request( resource_group_name: str, account_name: str, - cost_control_name: str, + project_name: str, + app_name: str, + deployment_name: str, subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/costControls/{costControlName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "costControlName": _SERIALIZER.url("cost_control_name", cost_control_name, "str"), + "projectName": _SERIALIZER.url("project_name", project_name, "str"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4510,40 +3946,36 @@ def build_cost_controls_update_request( _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") - if_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_cost_controls_delete_request( +def build_agent_deployments_create_or_update_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, - cost_control_name: str, + project_name: str, + app_name: str, + deployment_name: str, subscription_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **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", "2026-09-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/costControls/{costControlName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "costControlName": _SERIALIZER.url("cost_control_name", cost_control_name, "str"), + "projectName": _SERIALIZER.url("project_name", project_name, "str"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4552,31 +3984,34 @@ def build_cost_controls_delete_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if_match = prep_if_match(etag, match_condition) - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if_none_match = prep_if_none_match(etag, match_condition) - if if_none_match is not None: - _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_cost_controls_list_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any +def build_agent_deployments_delete_request( + resource_group_name: str, + account_name: str, + project_name: str, + app_name: str, + deployment_name: str, + subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/costControls" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "projectName": _SERIALIZER.url("project_name", project_name, "str"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4584,33 +4019,53 @@ def build_cost_controls_list_request( # 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) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_private_link_resources_list_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any +def build_agent_deployments_list_request( + resource_group_name: str, + account_name: str, + project_name: str, + app_name: str, + subscription_id: str, + *, + count: int = 30, + skip_token: Optional[str] = None, + names: Optional[List[str]] = None, + order_by: Optional[str] = None, + order_by_asc: bool = False, + **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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "projectName": _SERIALIZER.url("project_name", project_name, "str"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if count is not None: + _params["count"] = _SERIALIZER.query("count", count, "int") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if names is not None: + _params["names"] = [_SERIALIZER.query("names", q, "str") if q is not None else "" for q in names] + if order_by is not None: + _params["orderBy"] = _SERIALIZER.query("order_by", order_by, "str") + if order_by_asc is not None: + _params["orderByAsc"] = _SERIALIZER.query("order_by_asc", order_by_asc, "bool") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4618,23 +4073,27 @@ def build_private_link_resources_list_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_test_rai_external_safety_provider_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, safety_provider_name: str, subscription_id: str, **kwargs: Any +def build_agent_deployments_start_request( + resource_group_name: str, + account_name: str, + project_name: str, + app_name: str, + deployment_name: str, + subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/testRaiExternalSafetyProvider/{safetyProviderName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/start" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "safetyProviderName": _SERIALIZER.url("safety_provider_name", safety_provider_name, "str"), + "projectName": _SERIALIZER.url("project_name", project_name, "str"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4642,28 +4101,51 @@ def build_test_rai_external_safety_provider_create_or_update_request( # pylint: # 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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) -def build_rai_external_safety_provider_get_request( # pylint: disable=name-too-long - safety_provider_name: str, subscription_id: str, **kwargs: Any +def build_agent_deployments_stop_request( + resource_group_name: str, + account_name: str, + project_name: str, + app_name: str, + deployment_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/stop" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "accountName": _SERIALIZER.url("account_name", account_name, "str"), + "projectName": _SERIALIZER.url("project_name", project_name, "str"), + "appName": _SERIALIZER.url("app_name", app_name, "str"), + "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_resource_skus_list_request(subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "safetyProviderName": _SERIALIZER.url("safety_provider_name", safety_provider_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4677,47 +4159,47 @@ def build_rai_external_safety_provider_get_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_rai_external_safety_provider_create_or_update_request( # pylint: disable=name-too-long - safety_provider_name: str, subscription_id: str, **kwargs: Any +def build_usages_list_request( + location: str, subscription_id: str, *, filter: Optional[str] = None, **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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "safetyProviderName": _SERIALIZER.url("safety_provider_name", safety_provider_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_rai_external_safety_provider_delete_request( # pylint: disable=name-too-long - safety_provider_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: +def build_commitment_tiers_list_request(location: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "safetyProviderName": _SERIALIZER.url("safety_provider_name", safety_provider_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4725,22 +4207,24 @@ def build_rai_external_safety_provider_delete_request( # pylint: disable=name-t # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_rai_external_safety_providers_list_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any -) -> HttpRequest: +def build_models_list_request(location: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4754,28 +4238,29 @@ def build_rai_external_safety_providers_list_request( # pylint: disable=name-to return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_account_connections_get_request( - resource_group_name: str, account_name: str, connection_name: str, subscription_id: str, **kwargs: Any +def build_location_based_model_capacities_list_request( # pylint: disable=name-too-long + location: str, subscription_id: str, *, model_format: str, model_name: str, model_version: 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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/modelCapacities" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["modelFormat"] = _SERIALIZER.query("model_format", model_format, "str") + _params["modelName"] = _SERIALIZER.query("model_name", model_name, "str") + _params["modelVersion"] = _SERIALIZER.query("model_version", model_version, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -4783,55 +4268,50 @@ def build_account_connections_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_account_connections_create_request( - resource_group_name: str, account_name: str, connection_name: str, subscription_id: str, **kwargs: Any +def build_model_capacities_list_request( + subscription_id: str, *, model_format: str, model_name: str, model_version: 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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/modelCapacities" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["modelFormat"] = _SERIALIZER.query("model_format", model_format, "str") + _params["modelName"] = _SERIALIZER.query("model_name", model_name, "str") + _params["modelVersion"] = _SERIALIZER.query("model_version", model_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_account_connections_update_request( - resource_group_name: str, account_name: str, connection_name: str, subscription_id: str, **kwargs: Any +def build_cognitive_services_management_check_sku_availability_request( # pylint: disable=name-too-long + location: str, subscription_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", "2026-09-15-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4844,22 +4324,23 @@ def build_account_connections_update_request( _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_account_connections_delete_request( - resource_group_name: str, account_name: str, connection_name: str, subscription_id: str, **kwargs: Any +def build_cognitive_services_management_check_domain_availability_request( # pylint: disable=name-too-long + subscription_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", "2026-09-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "connectionName": _SERIALIZER.url("connection_name", connection_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -4867,7368 +4348,276 @@ def build_account_connections_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_account_connections_list_request( - resource_group_name: str, - account_name: str, - subscription_id: str, - *, - target: Optional[str] = None, - category: Optional[str] = None, - include_all: bool = False, - **kwargs: Any + +def build_cognitive_services_management_calculate_model_capacity_request( # pylint: disable=name-too-long + subscription_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", "2026-09-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/calculateModelCapacity" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if target is not None: - _params["target"] = _SERIALIZER.query("target", target, "str") - if category is not None: - _params["category"] = _SERIALIZER.query("category", category, "str") - if include_all is not None: - _params["includeAll"] = _SERIALIZER.query("include_all", include_all, "bool") # 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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_account_capability_hosts_get_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, capability_host_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`operations` attribute. + """ - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "capabilityHostName": _SERIALIZER.url("capability_host_name", capability_host_name, "str"), - } + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - _url: str = _url.format(**path_format_arguments) # type: ignore + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """Lists all the available Cognitive Services account operations. - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): + if not next_link: -def build_account_capability_hosts_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, capability_host_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "capabilityHostName": _SERIALIZER.url("capability_host_name", capability_host_name, "str"), - } + return _request - _url: str = _url.format(**path_format_arguments) # type: ignore + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + def get_next(next_link=None): + _request = prepare_request(next_link) - # 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") + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + return pipeline_response -def build_account_capability_hosts_delete_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, capability_host_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + return ItemPaged(get_next, extract_data) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "capabilityHostName": _SERIALIZER.url("capability_host_name", capability_host_name, "str"), - } - _url: str = _url.format(**path_format_arguments) # type: ignore +class AccountsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`accounts` attribute. + """ - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.Account: + """Returns a Cognitive Services account specified by the parameters. -def build_account_capability_hosts_list_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: Account. The Account is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.Account + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - } + cls: ClsType[_models.Account] = kwargs.pop("cls", None) - _url: str = _url.format(**path_format_arguments) # type: ignore + _request = build_accounts_get_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _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 + ) - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + response = pipeline_response.http_response - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + 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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - -def build_outbound_rule_get_request( - resource_group_name: str, - account_name: str, - managed_network_name: str, - rule_name: str, - subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - "ruleName": _SERIALIZER.url("rule_name", rule_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_outbound_rule_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - managed_network_name: str, - rule_name: str, - subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - "ruleName": _SERIALIZER.url("rule_name", rule_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_outbound_rule_delete_request( - resource_group_name: str, - account_name: str, - managed_network_name: str, - rule_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - "ruleName": _SERIALIZER.url("rule_name", rule_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_outbound_rule_list_request( - resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_get_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_put_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_patch_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_managed_network_settings_delete_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, managed_network_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_managed_network_settings_list_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_outbound_rules_post_request( - resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/batchOutboundRules" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_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_managed_network_provisions_provision_managed_network_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, managed_network_name: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/provision" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "managedNetworkName": _SERIALIZER.url("managed_network_name", managed_network_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_agent_deployments_get_request( - resource_group_name: str, - account_name: str, - project_name: str, - app_name: str, - deployment_name: str, - subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "appName": _SERIALIZER.url("app_name", app_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_deployments_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - project_name: str, - app_name: str, - deployment_name: str, - subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "appName": _SERIALIZER.url("app_name", app_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_deployments_delete_request( - resource_group_name: str, - account_name: str, - project_name: str, - app_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "appName": _SERIALIZER.url("app_name", app_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_agent_deployments_list_request( - resource_group_name: str, - account_name: str, - project_name: str, - app_name: str, - subscription_id: str, - *, - count: int = 30, - skip_token: Optional[str] = None, - names: Optional[List[str]] = None, - order_by: Optional[str] = None, - order_by_asc: bool = False, - **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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "appName": _SERIALIZER.url("app_name", app_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if count is not None: - _params["count"] = _SERIALIZER.query("count", count, "int") - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if names is not None: - _params["names"] = [_SERIALIZER.query("names", q, "str") if q is not None else "" for q in names] - if order_by is not None: - _params["orderBy"] = _SERIALIZER.query("order_by", order_by, "str") - if order_by_asc is not None: - _params["orderByAsc"] = _SERIALIZER.query("order_by_asc", order_by_asc, "bool") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_agent_deployments_start_request( - resource_group_name: str, - account_name: str, - project_name: str, - app_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/start" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "appName": _SERIALIZER.url("app_name", app_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_agent_deployments_stop_request( - resource_group_name: str, - account_name: str, - project_name: str, - app_name: str, - deployment_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-09-15-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/stop" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "accountName": _SERIALIZER.url("account_name", account_name, "str"), - "projectName": _SERIALIZER.url("project_name", project_name, "str"), - "appName": _SERIALIZER.url("app_name", app_name, "str"), - "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_resource_skus_list_request(subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_usages_list_request( - location: str, subscription_id: str, *, filter: Optional[str] = None, **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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_commitment_tiers_list_request(location: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "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_models_list_request(location: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "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_location_based_model_capacities_list_request( # pylint: disable=name-too-long - location: str, subscription_id: str, *, model_format: str, model_name: str, model_version: 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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/modelCapacities" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _params["modelFormat"] = _SERIALIZER.query("model_format", model_format, "str") - _params["modelName"] = _SERIALIZER.query("model_name", model_name, "str") - _params["modelVersion"] = _SERIALIZER.query("model_version", model_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_model_capacities_list_request( - subscription_id: str, *, model_format: str, model_name: str, model_version: 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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/modelCapacities" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _params["modelFormat"] = _SERIALIZER.query("model_format", model_format, "str") - _params["modelName"] = _SERIALIZER.query("model_name", model_name, "str") - _params["modelVersion"] = _SERIALIZER.query("model_version", model_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cognitive_services_management_check_sku_availability_request( # pylint: disable=name-too-long - location: str, subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "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_cognitive_services_management_check_domain_availability_request( # pylint: disable=name-too-long - subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_cognitive_services_management_calculate_model_capacity_request( # pylint: disable=name-too-long - subscription_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", "2026-09-15-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/calculateModelCapacity" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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) - - -class Operations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: - """Lists all the available Cognitive Services account operations. - - :return: An iterator like instance of Operation - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Operation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_operations_list_request( - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Operation], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class AccountsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`accounts` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.Account: - """Returns a Cognitive Services account specified by the parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: Account. The Account is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Account - :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.Account] = kwargs.pop("cls", None) - - _request = build_accounts_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Account, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - account_name: str, - account: Union[_models.Account, _types.Account, 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(account, (IOBase, bytes)): - _content = account - else: - _content = json.dumps(account, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_accounts_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_create( - self, - resource_group_name: str, - account_name: str, - account: _models.Account, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Account]: - """Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds - the keys for developer to access intelligent APIs. It's also the resource type for billing. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param account: The parameters to provide for the created account. Required. - :type account: ~azure.mgmt.cognitiveservices.models.Account - :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 Account. The Account is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - account: _types.Account, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Account]: - """Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds - the keys for developer to access intelligent APIs. It's also the resource type for billing. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param account: The parameters to provide for the created account. Required. - :type account: ~azure.mgmt.cognitiveservices.types.Account - :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 Account. The Account is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - account: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Account]: - """Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds - the keys for developer to access intelligent APIs. It's also the resource type for billing. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param account: The parameters to provide for the created account. Required. - :type account: 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 Account. The Account is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - account_name: str, - account: Union[_models.Account, _types.Account, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Account]: - """Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds - the keys for developer to access intelligent APIs. It's also the resource type for billing. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param account: The parameters to provide for the created account. Is either a Account type or - a IO[bytes] type. Required. - :type account: ~azure.mgmt.cognitiveservices.models.Account or - ~azure.mgmt.cognitiveservices.types.Account or IO[bytes] - :return: An instance of LROPoller that returns Account. The Account is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] - :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.Account] = 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._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - account=account, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.Account, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.Account].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Account]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - account_name: str, - account: Union[_models.Account, _types.Account, 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(account, (IOBase, bytes)): - _content = account - else: - _content = json.dumps(account, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_accounts_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_update( - self, - resource_group_name: str, - account_name: str, - account: _models.Account, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Account]: - """Updates a Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param account: The parameters to provide for the created account. Required. - :type account: ~azure.mgmt.cognitiveservices.models.Account - :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 Account. The Account is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - account: _types.Account, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Account]: - """Updates a Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param account: The parameters to provide for the created account. Required. - :type account: ~azure.mgmt.cognitiveservices.types.Account - :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 Account. The Account is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - account: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Account]: - """Updates a Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param account: The parameters to provide for the created account. Required. - :type account: 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 Account. The Account is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - account_name: str, - account: Union[_models.Account, _types.Account, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Account]: - """Updates a Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param account: The parameters to provide for the created account. Is either a Account type or - a IO[bytes] type. Required. - :type account: ~azure.mgmt.cognitiveservices.models.Account or - ~azure.mgmt.cognitiveservices.types.Account or IO[bytes] - :return: An instance of LROPoller that returns Account. The Account is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] - :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.Account] = 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._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - account=account, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.Account, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.Account].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Account]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, account_name: 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_accounts_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 [200, 202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Cognitive Services account from the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Account"]: - """Returns all the resources of a particular type belonging to a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of Account - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Account] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Account]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_accounts_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Account], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Account"]: - """Returns all the resources of a particular type belonging to a subscription. - - :return: An iterator like instance of Account - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Account] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Account]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_accounts_list_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Account], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_keys(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.ApiKeys: - """Lists the account keys for the specified Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: ApiKeys. The ApiKeys is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys - :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.ApiKeys] = kwargs.pop("cls", None) - - _request = build_accounts_list_keys_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ApiKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def regenerate_key( - self, - resource_group_name: str, - account_name: str, - parameters: _models.RegenerateKeyParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ApiKeys: - """Regenerates the specified account key for the specified Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param parameters: regenerate key parameters. Required. - :type parameters: ~azure.mgmt.cognitiveservices.models.RegenerateKeyParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ApiKeys. The ApiKeys is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def regenerate_key( - self, - resource_group_name: str, - account_name: str, - parameters: _types.RegenerateKeyParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ApiKeys: - """Regenerates the specified account key for the specified Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param parameters: regenerate key parameters. Required. - :type parameters: ~azure.mgmt.cognitiveservices.types.RegenerateKeyParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ApiKeys. The ApiKeys is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def regenerate_key( - self, - resource_group_name: str, - account_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ApiKeys: - """Regenerates the specified account key for the specified Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param parameters: regenerate key parameters. Required. - :type parameters: 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: ApiKeys. The ApiKeys is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def regenerate_key( - self, - resource_group_name: str, - account_name: str, - parameters: Union[_models.RegenerateKeyParameters, _types.RegenerateKeyParameters, IO[bytes]], - **kwargs: Any - ) -> _models.ApiKeys: - """Regenerates the specified account key for the specified Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param parameters: regenerate key parameters. Is either a RegenerateKeyParameters type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.cognitiveservices.models.RegenerateKeyParameters or - ~azure.mgmt.cognitiveservices.types.RegenerateKeyParameters or IO[bytes] - :return: ApiKeys. The ApiKeys is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys - :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.ApiKeys] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_accounts_regenerate_key_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ApiKeys, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_skus(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.AccountSkuListResult: - """List available SKUs for the requested Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: AccountSkuListResult. The AccountSkuListResult is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.AccountSkuListResult - :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.AccountSkuListResult] = kwargs.pop("cls", None) - - _request = build_accounts_list_skus_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.AccountSkuListResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_usages( - self, resource_group_name: str, account_name: str, *, filter: Optional[str] = None, **kwargs: Any - ) -> _models.UsageListResult: - """Get usages for the requested Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :keyword filter: An OData filter expression that describes a subset of usages to return. The - supported parameter is name.value (name of the metric, can have an or of multiple names). - Default value is None. - :paramtype filter: str - :return: UsageListResult. The UsageListResult is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.UsageListResult - :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.UsageListResult] = kwargs.pop("cls", None) - - _request = build_accounts_list_usages_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.UsageListResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_models( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.AccountModel"]: - """List available Models for the requested Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of AccountModel - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.AccountModel] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.AccountModel]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_accounts_list_models_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.AccountModel], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: _models.EvaluateDeploymentPoliciesRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EvaluateDeploymentPoliciesResponse: - """Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EvaluateDeploymentPoliciesResponse. The EvaluateDeploymentPoliciesResponse is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: _types.EvaluateDeploymentPoliciesRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EvaluateDeploymentPoliciesResponse: - """Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.cognitiveservices.types.EvaluateDeploymentPoliciesRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EvaluateDeploymentPoliciesResponse. The EvaluateDeploymentPoliciesResponse is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EvaluateDeploymentPoliciesResponse: - """Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param body: The content of the action request. 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: EvaluateDeploymentPoliciesResponse. The EvaluateDeploymentPoliciesResponse is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def evaluate_deployment_policies( - self, - resource_group_name: str, - account_name: str, - body: Union[_models.EvaluateDeploymentPoliciesRequest, _types.EvaluateDeploymentPoliciesRequest, IO[bytes]], - **kwargs: Any - ) -> _models.EvaluateDeploymentPoliciesResponse: - """Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param body: The content of the action request. Is either a EvaluateDeploymentPoliciesRequest - type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesRequest or - ~azure.mgmt.cognitiveservices.types.EvaluateDeploymentPoliciesRequest or IO[bytes] - :return: EvaluateDeploymentPoliciesResponse. The EvaluateDeploymentPoliciesResponse is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EvaluateDeploymentPoliciesResponse - :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.EvaluateDeploymentPoliciesResponse] = 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_accounts_evaluate_deployment_policies_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EvaluateDeploymentPoliciesResponse, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class DeletedAccountsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`deleted_accounts` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Account"]: - """Returns all the resources of a particular type belonging to a subscription. - - :return: An iterator like instance of Account - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Account] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Account]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_deleted_accounts_list_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Account], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, location: str, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.Account: - """Returns a Cognitive Services account specified by the parameters. - - :param location: The location name. Required. - :type location: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: Account. The Account is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Account - :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.Account] = kwargs.pop("cls", None) - - _request = build_deleted_accounts_get_request( - location=location, - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Account, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _purge_initial( - self, location: str, resource_group_name: str, account_name: 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_deleted_accounts_purge_request( - location=location, - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 [200, 202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_purge(self, location: str, resource_group_name: str, account_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Cognitive Services account from the resource group. - - :param location: The location name. Required. - :type location: str - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._purge_initial( - location=location, - resource_group_name=resource_group_name, - account_name=account_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class PrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Gets the specified private endpoint connection associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Cognitive Services Account. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with - MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection - :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.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_private_endpoint_connections_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, 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(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_private_endpoint_connections_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_create_or_update( - self, - resource_group_name: str, - account_name: str, - private_endpoint_connection_name: str, - properties: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the Cognitive - Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Cognitive Services Account. Required. - :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection - :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 PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - private_endpoint_connection_name: str, - properties: _types.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the Cognitive - Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Cognitive Services Account. Required. - :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. Required. - :type properties: ~azure.mgmt.cognitiveservices.types.PrivateEndpointConnection - :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 PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - private_endpoint_connection_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the Cognitive - Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Cognitive Services Account. Required. - :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. Required. - :type properties: 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 PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of specified private endpoint connection associated with the Cognitive - Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Cognitive Services Account. Required. - :type private_endpoint_connection_name: str - :param properties: The private endpoint connection properties. Is either a - PrivateEndpointConnection type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection or - ~azure.mgmt.cognitiveservices.types.PrivateEndpointConnection or IO[bytes] - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] - :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.PrivateEndpointConnection] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - private_endpoint_connection_name=private_endpoint_connection_name, - properties=properties, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.PrivateEndpointConnection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PrivateEndpointConnection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, account_name: str, private_endpoint_connection_name: 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_private_endpoint_connections_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 [200, 202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_delete( - self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified private endpoint connection associated with the Cognitive Services - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Cognitive Services Account. Required. - :type private_endpoint_connection_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - private_endpoint_connection_name=private_endpoint_connection_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnectionListResult: - """Gets the private endpoint connections associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: PrivateEndpointConnectionListResult. The PrivateEndpointConnectionListResult is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionListResult - :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.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - _request = build_private_endpoint_connections_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PrivateEndpointConnectionListResult, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class DeploymentsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`deployments` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> _models.Deployment: - """Gets the specified deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Deployment - :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.Deployment] = kwargs.pop("cls", None) - - _request = build_deployments_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Deployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - deployment: Union[_models.Deployment, _types.Deployment, 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(deployment, (IOBase, bytes)): - _content = deployment - else: - _content = json.dumps(deployment, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_deployments_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("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_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - deployment: _models.Deployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Deployment]: - """Update the state of specified deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :param deployment: The deployment properties. Required. - :type deployment: ~azure.mgmt.cognitiveservices.models.Deployment - :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 Deployment. The Deployment is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - deployment: _types.Deployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Deployment]: - """Update the state of specified deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :param deployment: The deployment properties. Required. - :type deployment: ~azure.mgmt.cognitiveservices.types.Deployment - :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 Deployment. The Deployment is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - deployment: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Deployment]: - """Update the state of specified deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :param deployment: The deployment properties. Required. - :type deployment: 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 Deployment. The Deployment is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Deployment]: - """Update the state of specified deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :param deployment: The deployment properties. Is either a Deployment type or a IO[bytes] type. - Required. - :type deployment: ~azure.mgmt.cognitiveservices.models.Deployment or - ~azure.mgmt.cognitiveservices.types.Deployment or IO[bytes] - :return: An instance of LROPoller that returns Deployment. The Deployment is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] - :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.Deployment] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - deployment=deployment, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.Deployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.Deployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Deployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - deployment: Union[_models.PatchResourceTagsAndSku, _types.PatchResourceTagsAndSku, 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(deployment, (IOBase, bytes)): - _content = deployment - else: - _content = json.dumps(deployment, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_deployments_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - deployment: _models.PatchResourceTagsAndSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Deployment]: - """Update specified deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :param deployment: The deployment properties. Required. - :type deployment: ~azure.mgmt.cognitiveservices.models.PatchResourceTagsAndSku - :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 Deployment. The Deployment is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - deployment: _types.PatchResourceTagsAndSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Deployment]: - """Update specified deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :param deployment: The deployment properties. Required. - :type deployment: ~azure.mgmt.cognitiveservices.types.PatchResourceTagsAndSku - :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 Deployment. The Deployment is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - deployment: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Deployment]: - """Update specified deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :param deployment: The deployment properties. Required. - :type deployment: 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 Deployment. The Deployment is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - deployment: Union[_models.PatchResourceTagsAndSku, _types.PatchResourceTagsAndSku, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Deployment]: - """Update specified deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :param deployment: The deployment properties. Is either a PatchResourceTagsAndSku type or a - IO[bytes] type. Required. - :type deployment: ~azure.mgmt.cognitiveservices.models.PatchResourceTagsAndSku or - ~azure.mgmt.cognitiveservices.types.PatchResourceTagsAndSku or IO[bytes] - :return: An instance of LROPoller that returns Deployment. The Deployment is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] - :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.Deployment] = 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._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - deployment=deployment, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.Deployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.Deployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Deployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, account_name: str, deployment_name: 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_deployments_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 [200, 202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_delete( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.Deployment"]: - """Gets the deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of Deployment - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Deployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_deployments_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Deployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_skus( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> ItemPaged["_models.SkuResource"]: - """Lists the specified deployments skus associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :return: An iterator like instance of SkuResource - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.SkuResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.SkuResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_deployments_list_skus_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SkuResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def pause( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> _models.Deployment: - """Pause a deployment. - - Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, - DataZoneStandard, and GlobalStandard SKUs support this operation. Inference requests to the - paused deployment endpoint will receive HTTP 423 (Locked). This operation is idempotent. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Deployment - :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.Deployment] = kwargs.pop("cls", None) - - _request = build_deployments_pause_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Deployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def resume( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> _models.Deployment: - """Resume a deployment. - - Resumes inferencing on a previously paused deployment by setting the deploymentState to - 'Running' (see #/definitions/DeploymentProperties/properties/deploymentState). This operation - is idempotent and can be safely called on already running deployments. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the deployment associated with the Cognitive Services - Account. Required. - :type deployment_name: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Deployment - :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.Deployment] = kwargs.pop("cls", None) - - _request = build_deployments_resume_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Deployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class CommitmentPlansOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`commitment_plans` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, commitment_plan_name: str, **kwargs: Any - ) -> _models.CommitmentPlan: - """Gets the specified commitmentPlans associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan - :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.CommitmentPlan] = kwargs.pop("cls", None) - - _request = build_commitment_plans_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - commitment_plan_name=commitment_plan_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CommitmentPlan, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - commitment_plan_name: str, - commitment_plan: _models.CommitmentPlan, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CommitmentPlan: - """Update the state of specified commitmentPlans associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The commitmentPlan properties. Required. - :type commitment_plan: ~azure.mgmt.cognitiveservices.models.CommitmentPlan - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - commitment_plan_name: str, - commitment_plan: _types.CommitmentPlan, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CommitmentPlan: - """Update the state of specified commitmentPlans associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The commitmentPlan properties. Required. - :type commitment_plan: ~azure.mgmt.cognitiveservices.types.CommitmentPlan - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - commitment_plan_name: str, - commitment_plan: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.CommitmentPlan: - """Update the state of specified commitmentPlans associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The commitmentPlan properties. Required. - :type commitment_plan: 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: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - account_name: str, - commitment_plan_name: str, - commitment_plan: Union[_models.CommitmentPlan, _types.CommitmentPlan, IO[bytes]], - **kwargs: Any - ) -> _models.CommitmentPlan: - """Update the state of specified commitmentPlans associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The commitmentPlan properties. Is either a CommitmentPlan type or a - IO[bytes] type. Required. - :type commitment_plan: ~azure.mgmt.cognitiveservices.models.CommitmentPlan or - ~azure.mgmt.cognitiveservices.types.CommitmentPlan or IO[bytes] - :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan - :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.CommitmentPlan] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(commitment_plan, (IOBase, bytes)): - _content = commitment_plan - else: - _content = json.dumps(commitment_plan, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_commitment_plans_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - commitment_plan_name=commitment_plan_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CommitmentPlan, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, account_name: str, commitment_plan_name: 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_commitment_plans_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - commitment_plan_name=commitment_plan_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 [200, 202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_delete( - self, resource_group_name: str, account_name: str, commitment_plan_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified commitmentPlan associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - commitment_plan_name=commitment_plan_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.CommitmentPlan"]: - """Gets the commitmentPlans associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of CommitmentPlan - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CommitmentPlan]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_commitment_plans_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CommitmentPlan], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_plan(self, resource_group_name: str, commitment_plan_name: str, **kwargs: Any) -> _models.CommitmentPlan: - """Returns a Cognitive Services commitment plan specified by the parameters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan - :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.CommitmentPlan] = kwargs.pop("cls", None) - - _request = build_commitment_plans_get_plan_request( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CommitmentPlan, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_plan_initial( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan: Union[_models.CommitmentPlan, _types.CommitmentPlan, 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(commitment_plan, (IOBase, bytes)): - _content = commitment_plan - else: - _content = json.dumps(commitment_plan, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_commitment_plans_create_or_update_plan_request( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("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_create_or_update_plan( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan: _models.CommitmentPlan, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlan]: - """Create Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The parameters to provide for the created commitment plan. Required. - :type commitment_plan: ~azure.mgmt.cognitiveservices.models.CommitmentPlan - :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 CommitmentPlan. The CommitmentPlan is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update_plan( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan: _types.CommitmentPlan, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlan]: - """Create Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The parameters to provide for the created commitment plan. Required. - :type commitment_plan: ~azure.mgmt.cognitiveservices.types.CommitmentPlan - :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 CommitmentPlan. The CommitmentPlan is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update_plan( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlan]: - """Create Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The parameters to provide for the created commitment plan. Required. - :type commitment_plan: 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 CommitmentPlan. The CommitmentPlan is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update_plan( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan: Union[_models.CommitmentPlan, _types.CommitmentPlan, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlan]: - """Create Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The parameters to provide for the created commitment plan. Is either a - CommitmentPlan type or a IO[bytes] type. Required. - :type commitment_plan: ~azure.mgmt.cognitiveservices.models.CommitmentPlan or - ~azure.mgmt.cognitiveservices.types.CommitmentPlan or IO[bytes] - :return: An instance of LROPoller that returns CommitmentPlan. The CommitmentPlan is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :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.CommitmentPlan] = 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._create_or_update_plan_initial( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - commitment_plan=commitment_plan, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.CommitmentPlan, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.CommitmentPlan].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CommitmentPlan]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_plan_initial( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan: Union[_models.PatchResourceTagsAndSku, _types.PatchResourceTagsAndSku, 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(commitment_plan, (IOBase, bytes)): - _content = commitment_plan - else: - _content = json.dumps(commitment_plan, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_commitment_plans_update_plan_request( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_update_plan( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan: _models.PatchResourceTagsAndSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlan]: - """Create Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The parameters to provide for the created commitment plan. Required. - :type commitment_plan: ~azure.mgmt.cognitiveservices.models.PatchResourceTagsAndSku - :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 CommitmentPlan. The CommitmentPlan is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_plan( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan: _types.PatchResourceTagsAndSku, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlan]: - """Create Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The parameters to provide for the created commitment plan. Required. - :type commitment_plan: ~azure.mgmt.cognitiveservices.types.PatchResourceTagsAndSku - :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 CommitmentPlan. The CommitmentPlan is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_plan( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlan]: - """Create Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The parameters to provide for the created commitment plan. Required. - :type commitment_plan: 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 CommitmentPlan. The CommitmentPlan is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_plan( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan: Union[_models.PatchResourceTagsAndSku, _types.PatchResourceTagsAndSku, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlan]: - """Create Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan: The parameters to provide for the created commitment plan. Is either a - PatchResourceTagsAndSku type or a IO[bytes] type. Required. - :type commitment_plan: ~azure.mgmt.cognitiveservices.models.PatchResourceTagsAndSku or - ~azure.mgmt.cognitiveservices.types.PatchResourceTagsAndSku or IO[bytes] - :return: An instance of LROPoller that returns CommitmentPlan. The CommitmentPlan is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :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.CommitmentPlan] = 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._update_plan_initial( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - commitment_plan=commitment_plan, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.CommitmentPlan, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.CommitmentPlan].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CommitmentPlan]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_plan_initial( - self, resource_group_name: str, commitment_plan_name: 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_commitment_plans_delete_plan_request( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 [200, 202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_delete_plan(self, resource_group_name: str, commitment_plan_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a Cognitive Services commitment plan from the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_plan_initial( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_plans_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.CommitmentPlan"]: - """Returns all the resources of a particular type belonging to a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of CommitmentPlan - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CommitmentPlan]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_commitment_plans_list_plans_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CommitmentPlan], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_plans_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.CommitmentPlan"]: - """Returns all the resources of a particular type belonging to a subscription. - - :return: An iterator like instance of CommitmentPlan - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.CommitmentPlan] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CommitmentPlan]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_commitment_plans_list_plans_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CommitmentPlan], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_association( - self, resource_group_name: str, commitment_plan_name: str, commitment_plan_association_name: str, **kwargs: Any - ) -> _models.CommitmentPlanAccountAssociation: - """Gets the association of the Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan_association_name: The name of the commitment plan association with the - Cognitive Services Account. Required. - :type commitment_plan_association_name: str - :return: CommitmentPlanAccountAssociation. The CommitmentPlanAccountAssociation is compatible - with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation - :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.CommitmentPlanAccountAssociation] = kwargs.pop("cls", None) - - _request = build_commitment_plans_get_association_request( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - commitment_plan_association_name=commitment_plan_association_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CommitmentPlanAccountAssociation, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_association_initial( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan_association_name: str, - association: Union[ - _models.CommitmentPlanAccountAssociation, _types.CommitmentPlanAccountAssociation, 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(association, (IOBase, bytes)): - _content = association - else: - _content = json.dumps(association, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_commitment_plans_create_or_update_association_request( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - commitment_plan_association_name=commitment_plan_association_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("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_create_or_update_association( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan_association_name: str, - association: _models.CommitmentPlanAccountAssociation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlanAccountAssociation]: - """Create or update the association of the Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan_association_name: The name of the commitment plan association with the - Cognitive Services Account. Required. - :type commitment_plan_association_name: str - :param association: The commitmentPlan properties. Required. - :type association: ~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation - :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 CommitmentPlanAccountAssociation. The - CommitmentPlanAccountAssociation is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update_association( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan_association_name: str, - association: _types.CommitmentPlanAccountAssociation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlanAccountAssociation]: - """Create or update the association of the Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan_association_name: The name of the commitment plan association with the - Cognitive Services Account. Required. - :type commitment_plan_association_name: str - :param association: The commitmentPlan properties. Required. - :type association: ~azure.mgmt.cognitiveservices.types.CommitmentPlanAccountAssociation - :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 CommitmentPlanAccountAssociation. The - CommitmentPlanAccountAssociation is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update_association( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan_association_name: str, - association: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlanAccountAssociation]: - """Create or update the association of the Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan_association_name: The name of the commitment plan association with the - Cognitive Services Account. Required. - :type commitment_plan_association_name: str - :param association: The commitmentPlan properties. Required. - :type association: 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 CommitmentPlanAccountAssociation. The - CommitmentPlanAccountAssociation is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update_association( - self, - resource_group_name: str, - commitment_plan_name: str, - commitment_plan_association_name: str, - association: Union[ - _models.CommitmentPlanAccountAssociation, _types.CommitmentPlanAccountAssociation, IO[bytes] - ], - **kwargs: Any - ) -> LROPoller[_models.CommitmentPlanAccountAssociation]: - """Create or update the association of the Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan_association_name: The name of the commitment plan association with the - Cognitive Services Account. Required. - :type commitment_plan_association_name: str - :param association: The commitmentPlan properties. Is either a CommitmentPlanAccountAssociation - type or a IO[bytes] type. Required. - :type association: ~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation or - ~azure.mgmt.cognitiveservices.types.CommitmentPlanAccountAssociation or IO[bytes] - :return: An instance of LROPoller that returns CommitmentPlanAccountAssociation. The - CommitmentPlanAccountAssociation is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation] - :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.CommitmentPlanAccountAssociation] = 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._create_or_update_association_initial( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - commitment_plan_association_name=commitment_plan_association_name, - association=association, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.CommitmentPlanAccountAssociation, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.CommitmentPlanAccountAssociation].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CommitmentPlanAccountAssociation]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_association_initial( - self, resource_group_name: str, commitment_plan_name: str, commitment_plan_association_name: 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_commitment_plans_delete_association_request( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - commitment_plan_association_name=commitment_plan_association_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 [200, 202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_delete_association( - self, resource_group_name: str, commitment_plan_name: str, commitment_plan_association_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the association of the Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :param commitment_plan_association_name: The name of the commitment plan association with the - Cognitive Services Account. Required. - :type commitment_plan_association_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_association_initial( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - commitment_plan_association_name=commitment_plan_association_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_associations( - self, resource_group_name: str, commitment_plan_name: str, **kwargs: Any - ) -> ItemPaged["_models.CommitmentPlanAccountAssociation"]: - """Gets the associations of the Cognitive Services commitment plan. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive - Services Account. Required. - :type commitment_plan_name: str - :return: An iterator like instance of CommitmentPlanAccountAssociation - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.CommitmentPlanAccountAssociation]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_commitment_plans_list_associations_request( - resource_group_name=resource_group_name, - commitment_plan_name=commitment_plan_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.CommitmentPlanAccountAssociation], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class EncryptionScopesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`encryption_scopes` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, encryption_scope_name: str, **kwargs: Any - ) -> _models.EncryptionScope: - """Gets the specified EncryptionScope associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive - Services Account. Required. - :type encryption_scope_name: str - :return: EncryptionScope. The EncryptionScope is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EncryptionScope - :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.EncryptionScope] = kwargs.pop("cls", None) - - _request = build_encryption_scopes_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - encryption_scope_name=encryption_scope_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EncryptionScope, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - encryption_scope_name: str, - encryption_scope: _models.EncryptionScope, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EncryptionScope: - """Update the state of specified encryptionScope associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive - Services Account. Required. - :type encryption_scope_name: str - :param encryption_scope: The encryptionScope properties. Required. - :type encryption_scope: ~azure.mgmt.cognitiveservices.models.EncryptionScope - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EncryptionScope. The EncryptionScope is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EncryptionScope - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - encryption_scope_name: str, - encryption_scope: _types.EncryptionScope, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EncryptionScope: - """Update the state of specified encryptionScope associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive - Services Account. Required. - :type encryption_scope_name: str - :param encryption_scope: The encryptionScope properties. Required. - :type encryption_scope: ~azure.mgmt.cognitiveservices.types.EncryptionScope - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: EncryptionScope. The EncryptionScope is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EncryptionScope - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - encryption_scope_name: str, - encryption_scope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.EncryptionScope: - """Update the state of specified encryptionScope associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive - Services Account. Required. - :type encryption_scope_name: str - :param encryption_scope: The encryptionScope properties. Required. - :type encryption_scope: 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: EncryptionScope. The EncryptionScope is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EncryptionScope - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - account_name: str, - encryption_scope_name: str, - encryption_scope: Union[_models.EncryptionScope, _types.EncryptionScope, IO[bytes]], - **kwargs: Any - ) -> _models.EncryptionScope: - """Update the state of specified encryptionScope associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive - Services Account. Required. - :type encryption_scope_name: str - :param encryption_scope: The encryptionScope properties. Is either a EncryptionScope type or a - IO[bytes] type. Required. - :type encryption_scope: ~azure.mgmt.cognitiveservices.models.EncryptionScope or - ~azure.mgmt.cognitiveservices.types.EncryptionScope or IO[bytes] - :return: EncryptionScope. The EncryptionScope is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.EncryptionScope - :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.EncryptionScope] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(encryption_scope, (IOBase, bytes)): - _content = encryption_scope - else: - _content = json.dumps(encryption_scope, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_encryption_scopes_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - encryption_scope_name=encryption_scope_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.EncryptionScope, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, account_name: str, encryption_scope_name: 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_encryption_scopes_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - encryption_scope_name=encryption_scope_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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_delete( - self, resource_group_name: str, account_name: str, encryption_scope_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified encryptionScope associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive - Services Account. Required. - :type encryption_scope_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - encryption_scope_name=encryption_scope_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.EncryptionScope"]: - """Gets the content filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of EncryptionScope - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.EncryptionScope] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.EncryptionScope]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_encryption_scopes_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.EncryptionScope], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RaiPoliciesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`rai_policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_policy_name", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def get( - self, resource_group_name: str, account_name: str, rai_policy_name: str, **kwargs: Any - ) -> _models.RaiPolicy: - """Gets the specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy - :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.RaiPolicy] = kwargs.pop("cls", None) - - _request = build_rai_policies_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiPolicy, response.json()) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Account, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_policy_name: str, - rai_policy: _models.RaiPolicy, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.RaiPolicy: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :param rai_policy: Properties describing the Content Filters. Required. - :type rai_policy: ~azure.mgmt.cognitiveservices.models.RaiPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_policy_name: str, - rai_policy: _types.RaiPolicy, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.RaiPolicy: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :param rai_policy: Properties describing the Content Filters. Required. - :type rai_policy: ~azure.mgmt.cognitiveservices.types.RaiPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_policy_name: str, - rai_policy: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.RaiPolicy: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :param rai_policy: Properties describing the Content Filters. Required. - :type rai_policy: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_policy_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def create_or_update( + def _create_initial( self, resource_group_name: str, account_name: str, - rai_policy_name: str, - rai_policy: Union[_models.RaiPolicy, _types.RaiPolicy, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + account: Union[_models.Account, _types.Account, IO[bytes]], **kwargs: Any - ) -> _models.RaiPolicy: - """Update the state of specified Content Filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :param rai_policy: Properties describing the Content Filters. Is either a RaiPolicy type or a - IO[bytes] type. Required. - :type rai_policy: ~azure.mgmt.cognitiveservices.models.RaiPolicy or - ~azure.mgmt.cognitiveservices.types.RaiPolicy or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError 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.RaiPolicy] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(rai_policy, (IOBase, bytes)): - _content = rai_policy + if isinstance(account, (IOBase, bytes)): + _content = account else: - _content = json.dumps(rai_policy, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(account, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_rai_policies_create_or_update_request( + _request = build_accounts_create_request( resource_group_name=resource_group_name, account_name=account_name, - rai_policy_name=rai_policy_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -12241,19 +4630,18 @@ def create_or_update( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 201, 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.ErrorResponse, @@ -12262,169 +4650,146 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiPolicy, response.json()) + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("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 - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_policy_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def _delete_initial( + @overload + def begin_create( self, resource_group_name: str, account_name: str, - rai_policy_name: str, + account: _models.Account, *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + content_type: str = "application/json", **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError - 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_rai_policies_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 + ) -> LROPoller[_models.Account]: + """Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds + the keys for developer to access intelligent APIs. It's also the resource type for billing. - if response.status_code not in [202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param account: The parameters to provide for the created account. Required. + :type account: ~azure.mgmt.cognitiveservices.models.Account + :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 Account. The Account is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + @overload + def begin_create( + self, + resource_group_name: str, + account_name: str, + account: _types.Account, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Account]: + """Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds + the keys for developer to access intelligent APIs. It's also the resource type for billing. - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param account: The parameters to provide for the created account. Required. + :type account: ~azure.mgmt.cognitiveservices.types.Account + :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 Account. The Account is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + @overload + def begin_create( + self, + resource_group_name: str, + account_name: str, + account: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Account]: + """Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds + the keys for developer to access intelligent APIs. It's also the resource type for billing. - return deserialized # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param account: The parameters to provide for the created account. Required. + :type account: 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 Account. The Account is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_policy_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def begin_delete( + def begin_create( self, resource_group_name: str, account_name: str, - rai_policy_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + account: Union[_models.Account, _types.Account, IO[bytes]], **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified Content Filters associated with the Azure OpenAI account. + ) -> LROPoller[_models.Account]: + """Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds + the keys for developer to access intelligent APIs. It's also the resource type for billing. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param account: The parameters to provide for the created account. Is either a Account type or + a IO[bytes] type. Required. + :type account: ~azure.mgmt.cognitiveservices.models.Account or + ~azure.mgmt.cognitiveservices.types.Account or IO[bytes] + :return: An instance of LROPoller that returns Account. The Account is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Account] = 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._delete_initial( + raw_result = self._create_initial( resource_group_name=resource_group_name, account_name=account_name, - rai_policy_name=rai_policy_name, - etag=etag, - match_condition=match_condition, + account=account, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -12433,162 +4798,43 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.RaiPolicy"]: - """Gets the content filters associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of RaiPolicy - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiPolicy]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_rai_policies_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiPolicy], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def get_long_running_output(pipeline_response): response = pipeline_response.http_response + deserialized = _deserialize(_models.Account, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class SubscriptionRaiPolicyOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`subscription_rai_policy` attribute. - """ + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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.Account].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Account]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, rai_policy_name: str, **kwargs: Any) -> _models.RaiPolicy: - """Gets the specified Content Filters associated with the Subscription. - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _update_initial( + self, + resource_group_name: str, + account_name: str, + account: Union[_models.Account, _types.Account, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -12597,15 +4843,26 @@ def get(self, rai_policy_name: str, **kwargs: Any) -> _models.RaiPolicy: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiPolicy] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_subscription_rai_policy_get_request( - rai_policy_name=rai_policy_name, + content_type = content_type or "application/json" + _content = None + if isinstance(account, (IOBase, bytes)): + _content = account + else: + _content = json.dumps(account, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_accounts_update_request( + resource_group_name=resource_group_name, + account_name=account_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -12615,19 +4872,18 @@ def get(self, rai_policy_name: str, **kwargs: Any) -> _models.RaiPolicy: _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 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.ErrorResponse, @@ -12635,167 +4891,179 @@ def get(self, rai_policy_name: str, **kwargs: Any) -> _models.RaiPolicy: ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiPolicy, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - def create_or_update( + def begin_update( self, - rai_policy_name: str, - rai_policy: _models.RaiPolicy, + resource_group_name: str, + account_name: str, + account: _models.Account, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiPolicy: - """Update the state of specified Content Filters associated with the subscription. + ) -> LROPoller[_models.Account]: + """Updates a Cognitive Services account. - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :param rai_policy: Properties describing the Content Filters. Required. - :type rai_policy: ~azure.mgmt.cognitiveservices.models.RaiPolicy + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param account: The parameters to provide for the created account. Required. + :type account: ~azure.mgmt.cognitiveservices.models.Account :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy + :return: An instance of LROPoller that returns Account. The Account is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_update( self, - rai_policy_name: str, - rai_policy: _types.RaiPolicy, + resource_group_name: str, + account_name: str, + account: _types.Account, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiPolicy: - """Update the state of specified Content Filters associated with the subscription. + ) -> LROPoller[_models.Account]: + """Updates a Cognitive Services account. - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :param rai_policy: Properties describing the Content Filters. Required. - :type rai_policy: ~azure.mgmt.cognitiveservices.types.RaiPolicy + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param account: The parameters to provide for the created account. Required. + :type account: ~azure.mgmt.cognitiveservices.types.Account :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy + :return: An instance of LROPoller that returns Account. The Account is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( - self, rai_policy_name: str, rai_policy: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiPolicy: - """Update the state of specified Content Filters associated with the subscription. + def begin_update( + self, + resource_group_name: str, + account_name: str, + account: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Account]: + """Updates a Cognitive Services account. - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :param rai_policy: Properties describing the Content Filters. Required. - :type rai_policy: IO[bytes] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param account: The parameters to provide for the created account. Required. + :type account: 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: RaiPolicy. The RaiPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy + :return: An instance of LROPoller that returns Account. The Account is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_or_update( - self, rai_policy_name: str, rai_policy: Union[_models.RaiPolicy, _types.RaiPolicy, IO[bytes]], **kwargs: Any - ) -> _models.RaiPolicy: - """Update the state of specified Content Filters associated with the subscription. + def begin_update( + self, + resource_group_name: str, + account_name: str, + account: Union[_models.Account, _types.Account, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Account]: + """Updates a Cognitive Services account. - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :param rai_policy: Properties describing the Content Filters. Is either a RaiPolicy type or a - IO[bytes] type. Required. - :type rai_policy: ~azure.mgmt.cognitiveservices.models.RaiPolicy or - ~azure.mgmt.cognitiveservices.types.RaiPolicy or IO[bytes] - :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param account: The parameters to provide for the created account. Is either a Account type or + a IO[bytes] type. Required. + :type account: ~azure.mgmt.cognitiveservices.models.Account or + ~azure.mgmt.cognitiveservices.types.Account or IO[bytes] + :return: An instance of LROPoller that returns Account. The Account is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Account] :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.RaiPolicy] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(rai_policy, (IOBase, bytes)): - _content = rai_policy - else: - _content = json.dumps(rai_policy, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.Account] = 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._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account=account, + 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 = pipeline_response.http_response + deserialized = _deserialize(_models.Account, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_subscription_rai_policy_create_or_update_request( - rai_policy_name=rai_policy_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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, 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.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.RaiPolicy, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.Account].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Account]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _delete_initial(self, rai_policy_name: str, **kwargs: Any) -> Iterator[bytes]: + def _delete_initial(self, resource_group_name: str, account_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -12809,8 +5077,9 @@ def _delete_initial(self, rai_policy_name: str, **kwargs: Any) -> Iterator[bytes cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_subscription_rai_policy_delete_request( - rai_policy_name=rai_policy_name, + _request = build_accounts_delete_request( + resource_group_name=resource_group_name, + account_name=account_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -12829,7 +5098,7 @@ def _delete_initial(self, rai_policy_name: str, **kwargs: Any) -> Iterator[bytes response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -12854,102 +5123,263 @@ def _delete_initial(self, rai_policy_name: str, **kwargs: Any) -> Iterator[bytes return deserialized # type: ignore @distributed_trace - def begin_delete(self, rai_policy_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the specified Content Filters associated with the subscription. + def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a Cognitive Services account from the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = 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._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + 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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Account"]: + """Returns all the resources of a particular type belonging to a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Account + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Account]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_accounts_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Account], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Account"]: + """Returns all the resources of a particular type belonging to a subscription. + + :return: An iterator like instance of Account + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Account] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Account]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_accounts_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services - Account. Required. - :type rai_policy_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + return _request - cls: ClsType[None] = 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._delete_initial( - rai_policy_name=rai_policy_name, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Account], + deserialized.get("value", []), ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, None, {}) # type: ignore + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + def get_next(next_link=None): + _request = prepare_request(next_link) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - + response = pipeline_response.http_response -class RaiRegosOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`rai_regos` attribute. - """ + return pipeline_response - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return ItemPaged(get_next, extract_data) @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_rego_name", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def get(self, resource_group_name: str, account_name: str, rai_rego_name: str, **kwargs: Any) -> _models.RaiRego: - """Gets one reusable Rego artifact. + def list_keys(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.ApiKeys: + """Lists the account keys for the specified Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :return: RaiRego. The RaiRego is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiRego + :return: ApiKeys. The ApiKeys is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12963,12 +5393,11 @@ def get(self, resource_group_name: str, account_name: str, rai_rego_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiRego] = kwargs.pop("cls", None) + cls: ClsType[_models.ApiKeys] = kwargs.pop("cls", None) - _request = build_rai_regos_get_request( + _request = build_accounts_list_keys_request( resource_group_name=resource_group_name, account_name=account_name, - rai_rego_name=rai_rego_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -13000,179 +5429,118 @@ def get(self, resource_group_name: str, account_name: str, rai_rego_name: str, * ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiRego, response.json()) + deserialized = _deserialize(_models.ApiKeys, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - def create_or_update( + def regenerate_key( self, resource_group_name: str, account_name: str, - rai_rego_name: str, - rai_rego: _models.RaiRego, + parameters: _models.RegenerateKeyParameters, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.RaiRego: - """Creates or replaces one reusable Rego artifact. + ) -> _models.ApiKeys: + """Regenerates the specified account key for the specified Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :param rai_rego: The reusable Rego artifact. Required. - :type rai_rego: ~azure.mgmt.cognitiveservices.models.RaiRego + :param parameters: regenerate key parameters. Required. + :type parameters: ~azure.mgmt.cognitiveservices.models.RegenerateKeyParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiRego. The RaiRego is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiRego + :return: ApiKeys. The ApiKeys is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def regenerate_key( self, resource_group_name: str, account_name: str, - rai_rego_name: str, - rai_rego: _types.RaiRego, + parameters: _types.RegenerateKeyParameters, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.RaiRego: - """Creates or replaces one reusable Rego artifact. + ) -> _models.ApiKeys: + """Regenerates the specified account key for the specified Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :param rai_rego: The reusable Rego artifact. Required. - :type rai_rego: ~azure.mgmt.cognitiveservices.types.RaiRego + :param parameters: regenerate key parameters. Required. + :type parameters: ~azure.mgmt.cognitiveservices.types.RegenerateKeyParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiRego. The RaiRego is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiRego + :return: ApiKeys. The ApiKeys is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def regenerate_key( self, resource_group_name: str, account_name: str, - rai_rego_name: str, - rai_rego: IO[bytes], + parameters: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.RaiRego: - """Creates or replaces one reusable Rego artifact. + ) -> _models.ApiKeys: + """Regenerates the specified account key for the specified Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :param rai_rego: The reusable Rego artifact. Required. - :type rai_rego: IO[bytes] + :param parameters: regenerate key parameters. Required. + :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiRego. The RaiRego is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiRego + :return: ApiKeys. The ApiKeys is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_rego_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def create_or_update( + def regenerate_key( self, resource_group_name: str, account_name: str, - rai_rego_name: str, - rai_rego: Union[_models.RaiRego, _types.RaiRego, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + parameters: Union[_models.RegenerateKeyParameters, _types.RegenerateKeyParameters, IO[bytes]], **kwargs: Any - ) -> _models.RaiRego: - """Creates or replaces one reusable Rego artifact. + ) -> _models.ApiKeys: + """Regenerates the specified account key for the specified Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :param rai_rego: The reusable Rego artifact. Is either a RaiRego type or a IO[bytes] type. - Required. - :type rai_rego: ~azure.mgmt.cognitiveservices.models.RaiRego or - ~azure.mgmt.cognitiveservices.types.RaiRego or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiRego. The RaiRego is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiRego + :param parameters: regenerate key parameters. Is either a RegenerateKeyParameters type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.cognitiveservices.models.RegenerateKeyParameters or + ~azure.mgmt.cognitiveservices.types.RegenerateKeyParameters or IO[bytes] + :return: ApiKeys. The ApiKeys is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ApiKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13181,34 +5549,25 @@ def create_or_update( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError 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.RaiRego] = kwargs.pop("cls", None) + cls: ClsType[_models.ApiKeys] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(rai_rego, (IOBase, bytes)): - _content = rai_rego + if isinstance(parameters, (IOBase, bytes)): + _content = parameters else: - _content = json.dumps(rai_rego, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_rai_regos_create_or_update_request( + _request = build_accounts_regenerate_key_request( resource_group_name=resource_group_name, account_name=account_name, - rai_rego_name=rai_rego_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -13228,7 +5587,7 @@ def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -13241,61 +5600,103 @@ def create_or_update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiRego, response.json()) + deserialized = _deserialize(_models.ApiKeys, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_rego_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - account_name: str, - rai_rego_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> None: - """Deletes one reusable Rego artifact. + def list_skus(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.AccountSkuListResult: + """List available SKUs for the requested Cognitive Services account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: AccountSkuListResult. The AccountSkuListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.AccountSkuListResult + :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.AccountSkuListResult] = kwargs.pop("cls", None) + + _request = build_accounts_list_skus_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AccountSkuListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_usages( + self, resource_group_name: str, account_name: str, *, filter: Optional[str] = None, **kwargs: Any + ) -> _models.UsageListResult: + """Get usages for the requested Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_rego_name: The name of the reusable Rego artifact. Required. - :type rai_rego_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: None - :rtype: None + :keyword filter: An OData filter expression that describes a subset of usages to return. The + supported parameter is name.value (name of the metric, can have an or of multiple names). + Default value is None. + :paramtype filter: str + :return: UsageListResult. The UsageListResult is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.UsageListResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13304,26 +5705,18 @@ def delete( # pylint: disable=inconsistent-return-statements 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) - _request = build_rai_regos_delete_request( + _request = build_accounts_list_usages_request( resource_group_name=resource_group_name, account_name=account_name, - rai_rego_name=rai_rego_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, + filter=filter, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13333,14 +5726,20 @@ def delete( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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, 204]: + 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.ErrorResponse, @@ -13348,45 +5747,35 @@ def delete( # pylint: disable=inconsistent-return-statements ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.UsageListResult, response.json()) + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "top", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def list( - self, resource_group_name: str, account_name: str, *, top: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.RaiRego"]: - """Lists reusable Rego artifacts on an account. + def list_models( + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> ItemPaged["_models.AccountModel"]: + """List available Models for the requested Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :keyword top: The maximum number of reusable Rego artifacts to return. Defaults to 10. Default - value is None. - :paramtype top: int - :return: An iterator like instance of RaiRego - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiRego] + :return: An iterator like instance of AccountModel + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.AccountModel] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RaiRego]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AccountModel]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13399,11 +5788,10 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_rai_regos_list_request( + _request = build_accounts_list_models_request( resource_group_name=resource_group_name, account_name=account_name, subscription_id=self._config.subscription_id, - top=top, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13443,7 +5831,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RaiRego], + List[_models.AccountModel], deserialized.get("value", []), ) if cls: @@ -13472,14 +5860,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class RaiBindingsOperations: # pylint: disable=docstring-missing-param +class DeletedAccountsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`rai_bindings` attribute. + :attr:`deleted_accounts` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -13492,36 +5880,18 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_binding_name", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def get( - self, resource_group_name: str, account_name: str, rai_binding_name: str, **kwargs: Any - ) -> _models.RaiBinding: - """Gets one RAI binding. + def list(self, **kwargs: Any) -> ItemPaged["_models.Account"]: + """Returns all the resources of a particular type belonging to a subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :return: RaiBinding. The RaiBinding is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBinding + :return: An iterator like instance of Account + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Account] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Account]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -13530,218 +5900,91 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.RaiBinding] = kwargs.pop("cls", None) + def prepare_request(next_link=None): + if not next_link: - _request = build_rai_bindings_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_binding_name=rai_binding_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_deleted_accounts_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "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 - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - 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.ErrorResponse, - response, + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Account], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiBinding, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: _models.RaiBinding, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.RaiBinding: - """Creates or replaces one RAI binding. + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :param rai_binding: The RAI binding. Required. - :type rai_binding: ~azure.mgmt.cognitiveservices.models.RaiBinding - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiBinding. The RaiBinding is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBinding - :raises ~azure.core.exceptions.HttpResponseError: - """ + def get_next(next_link=None): + _request = prepare_request(next_link) - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: _types.RaiBinding, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.RaiBinding: - """Creates or replaces one RAI binding. + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :param rai_binding: The RAI binding. Required. - :type rai_binding: ~azure.mgmt.cognitiveservices.types.RaiBinding - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiBinding. The RaiBinding is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBinding - :raises ~azure.core.exceptions.HttpResponseError: - """ + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.RaiBinding: - """Creates or replaces one RAI binding. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :param rai_binding: The RAI binding. Required. - :type rai_binding: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiBinding. The RaiBinding is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBinding - :raises ~azure.core.exceptions.HttpResponseError: - """ + return ItemPaged(get_next, extract_data) @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_binding_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def create_or_update( - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - rai_binding: Union[_models.RaiBinding, _types.RaiBinding, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.RaiBinding: - """Creates or replaces one RAI binding. + def get(self, location: str, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.Account: + """Returns a Cognitive Services account specified by the parameters. + :param location: The location name. Required. + :type location: str :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :param rai_binding: The RAI binding. Is either a RaiBinding type or a IO[bytes] type. Required. - :type rai_binding: ~azure.mgmt.cognitiveservices.models.RaiBinding or - ~azure.mgmt.cognitiveservices.types.RaiBinding or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: RaiBinding. The RaiBinding is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBinding + :return: Account. The Account is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.Account :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -13750,37 +5993,19 @@ def create_or_update( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.RaiBinding] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(rai_binding, (IOBase, bytes)): - _content = rai_binding - else: - _content = json.dumps(rai_binding, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.Account] = kwargs.pop("cls", None) - _request = build_rai_bindings_create_or_update_request( + _request = build_deleted_accounts_get_request( + location=location, resource_group_name=resource_group_name, account_name=account_name, - rai_binding_name=rai_binding_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -13797,7 +6022,7 @@ def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -13810,89 +6035,37 @@ def create_or_update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiBinding, response.json()) + deserialized = _deserialize(_models.Account, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "rai_binding_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - account_name: str, - rai_binding_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> None: - """Deletes one RAI binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_binding_name: The name of the RAI binding. Required. - :type rai_binding_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _purge_initial( + self, location: str, resource_group_name: str, account_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_rai_bindings_delete_request( + _request = build_deleted_accounts_purge_request( + location=location, resource_group_name=resource_group_name, account_name=account_name, - rai_binding_name=rai_binding_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, api_version=self._config.api_version, headers=_headers, params=_params, @@ -13902,14 +6075,19 @@ def delete( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [200, 204]: + if response.status_code not in [200, 202, 204]: + 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.ErrorResponse, @@ -13917,138 +6095,87 @@ def delete( # pylint: disable=inconsistent-return-statements ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "top", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def list( - self, resource_group_name: str, account_name: str, *, top: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.RaiBinding"]: - """Lists RAI bindings on an account. + def begin_purge(self, location: str, resource_group_name: str, account_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a Cognitive Services account from the resource group. + :param location: The location name. Required. + :type location: str :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :keyword top: The maximum number of RAI bindings to return. Defaults to 50. Default value is - None. - :paramtype top: int - :return: An iterator like instance of RaiBinding - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiBinding] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RaiBinding]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_rai_bindings_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - top=top, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiBinding], - deserialized.get("value", []), + cls: ClsType[None] = 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._purge_initial( + location=location, + resource_group_name=resource_group_name, + account_name=account_name, + 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): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + return cls(pipeline_response, None, {}) # type: ignore - def get_next(next_link=None): - _request = prepare_request(next_link) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class RaiBlocklistItemsOperations: # pylint: disable=docstring-missing-param +class PrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`rai_blocklist_items` attribute. + :attr:`private_endpoint_connections` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -14062,28 +6189,21 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any - ) -> _models.RaiBlocklistItem: - """Gets the specified custom blocklist Item associated with the custom blocklist. + self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets the specified private endpoint connection associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str - :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Cognitive Services Account. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -14097,13 +6217,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiBlocklistItem] = kwargs.pop("cls", None) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - _request = build_rai_blocklist_items_get_request( + _request = build_private_endpoint_connections_get_request( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, + private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -14138,225 +6257,277 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiBlocklistItem, response.json()) + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + def _create_or_update_initial( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + properties: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, 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(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_private_endpoint_connections_create_or_update_request( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("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 create_or_update( + def begin_create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - rai_blocklist_item: _models.RaiBlocklistItem, + private_endpoint_connection_name: str, + properties: _models.PrivateEndpointConnection, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklistItem: - """Update the state of specified blocklist item associated with the Azure OpenAI account. + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the Cognitive + Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str - :param rai_blocklist_item: Properties describing the custom blocklist. Required. - :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Cognitive Services Account. Required. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. Required. + :type properties: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - rai_blocklist_item: _types.RaiBlocklistItem, + private_endpoint_connection_name: str, + properties: _types.PrivateEndpointConnection, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklistItem: - """Update the state of specified blocklist item associated with the Azure OpenAI account. + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the Cognitive + Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str - :param rai_blocklist_item: Properties describing the custom blocklist. Required. - :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.types.RaiBlocklistItem + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Cognitive Services Account. Required. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. Required. + :type properties: ~azure.mgmt.cognitiveservices.types.PrivateEndpointConnection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - rai_blocklist_item: IO[bytes], + private_endpoint_connection_name: str, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklistItem: - """Update the state of specified blocklist item associated with the Azure OpenAI account. + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the Cognitive + Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str - :param rai_blocklist_item: Properties describing the custom blocklist. Required. - :type rai_blocklist_item: IO[bytes] + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Cognitive Services Account. Required. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. Required. + :type properties: 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: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - rai_blocklist_item: Union[_models.RaiBlocklistItem, _types.RaiBlocklistItem, IO[bytes]], + private_endpoint_connection_name: str, + properties: Union[_models.PrivateEndpointConnection, _types.PrivateEndpointConnection, IO[bytes]], **kwargs: Any - ) -> _models.RaiBlocklistItem: - """Update the state of specified blocklist item associated with the Azure OpenAI account. + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Update the state of specified private endpoint connection associated with the Cognitive + Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str - :param rai_blocklist_item: Properties describing the custom blocklist. Is either a - RaiBlocklistItem type or a IO[bytes] type. Required. - :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem or - ~azure.mgmt.cognitiveservices.types.RaiBlocklistItem or IO[bytes] - :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Cognitive Services Account. Required. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. Is either a + PrivateEndpointConnection type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection or + ~azure.mgmt.cognitiveservices.types.PrivateEndpointConnection or IO[bytes] + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.PrivateEndpointConnection] :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.RaiBlocklistItem] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(rai_blocklist_item, (IOBase, bytes)): - _content = rai_blocklist_item - else: - _content = json.dumps(rai_blocklist_item, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.PrivateEndpointConnection] = 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._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + private_endpoint_connection_name=private_endpoint_connection_name, + properties=properties, + 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 = pipeline_response.http_response + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_rai_blocklist_items_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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, 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.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.RaiBlocklistItem, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateEndpointConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any + self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -14371,11 +6542,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_rai_blocklist_items_delete_request( + _request = build_private_endpoint_connections_delete_request( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, + private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -14394,7 +6564,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -14420,26 +6590,19 @@ def _delete_initial( @distributed_trace def begin_delete( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_item_name: str, - **kwargs: Any + self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes the specified blocklist Item associated with the custom blocklist. + """Deletes the specified private endpoint connection associated with the Cognitive Services + account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom - blocklist. Required. - :type rai_blocklist_item_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Cognitive Services Account. Required. + :type private_endpoint_connection_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -14455,8 +6618,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, - rai_blocklist_item_name=rai_blocklist_item_name, + private_endpoint_connection_name=private_endpoint_connection_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -14492,27 +6654,20 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list( - self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any - ) -> ItemPaged["_models.RaiBlocklistItem"]: - """Gets the blocklist items associated with the custom blocklist. + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnectionListResult: + """Gets the private endpoint connections associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :return: An iterator like instance of RaiBlocklistItem - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiBlocklistItem] + :return: PrivateEndpointConnectionListResult. The PrivateEndpointConnectionListResult is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiBlocklistItem]] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -14521,206 +6676,159 @@ def list( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_rai_blocklist_items_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_private_endpoint_connections_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request + _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 + ) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiBlocklistItem], - deserialized.get("value", []), + 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.ErrorResponse, + response, ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - def get_next(next_link=None): - _request = prepare_request(next_link) + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnectionListResult, response.json()) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + return deserialized # type: ignore - return pipeline_response - return ItemPaged(get_next, extract_data) +class DeploymentsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - @overload - def batch_add( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_items: List[_models.RaiBlocklistItemBulkRequest], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RaiBlocklist: - """Batch operation to add blocklist items. + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`deployments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any + ) -> _models.Deployment: + """Gets the specified deployments associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param deployment_name: The name of the deployment associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items: Properties describing the custom blocklist items. Required. - :type rai_blocklist_items: - list[~azure.mgmt.cognitiveservices.models.RaiBlocklistItemBulkRequest] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :type deployment_name: str + :return: Deployment. The Deployment is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.Deployment :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - def batch_add( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_items: List[_types.RaiBlocklistItemBulkRequest], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RaiBlocklist: - """Batch operation to add blocklist items. + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items: Properties describing the custom blocklist items. Required. - :type rai_blocklist_items: - list[~azure.mgmt.cognitiveservices.types.RaiBlocklistItemBulkRequest] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist - :raises ~azure.core.exceptions.HttpResponseError: - """ + cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) - @overload - def batch_add( - self, - resource_group_name: str, - account_name: str, - rai_blocklist_name: str, - rai_blocklist_items: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RaiBlocklist: - """Batch operation to add blocklist items. + _request = build_deployments_get_request( + resource_group_name=resource_group_name, + account_name=account_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items: Properties describing the custom blocklist items. Required. - :type rai_blocklist_items: 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: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist - :raises ~azure.core.exceptions.HttpResponseError: - """ + _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 + ) - @distributed_trace - def batch_add( + 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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Deployment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_items: Union[ - List[_models.RaiBlocklistItemBulkRequest], List[_types.RaiBlocklistItemBulkRequest], IO[bytes] - ], + deployment_name: str, + deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], **kwargs: Any - ) -> _models.RaiBlocklist: - """Batch operation to add blocklist items. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items: Properties describing the custom blocklist items. Is either a - [RaiBlocklistItemBulkRequest] type or a IO[bytes] type. Required. - :type rai_blocklist_items: - list[~azure.mgmt.cognitiveservices.models.RaiBlocklistItemBulkRequest] or - list[~azure.mgmt.cognitiveservices.types.RaiBlocklistItemBulkRequest] or IO[bytes] - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -14733,19 +6841,19 @@ def batch_add( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiBlocklist] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(rai_blocklist_items, (IOBase, bytes)): - _content = rai_blocklist_items + if isinstance(deployment, (IOBase, bytes)): + _content = deployment else: - _content = json.dumps(rai_blocklist_items, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(deployment, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_rai_blocklist_items_batch_add_request( + _request = build_deployments_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, + deployment_name=deployment_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -14759,19 +6867,18 @@ def batch_add( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 201]: + 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.ErrorResponse, @@ -14779,197 +6886,205 @@ def batch_add( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiBlocklist, response.json()) + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - def batch_delete( + def begin_create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_items_names: List[str], + deployment_name: str, + deployment: _models.Deployment, *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Batch operation to delete blocklist items. + ) -> LROPoller[_models.Deployment]: + """Update the state of specified deployments associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param deployment_name: The name of the deployment associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Required. - :type rai_blocklist_items_names: list[str] + :type deployment_name: str + :param deployment: The deployment properties. Required. + :type deployment: ~azure.mgmt.cognitiveservices.models.Deployment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: None - :rtype: None + :return: An instance of LROPoller that returns Deployment. The Deployment is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def batch_delete( + def begin_create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_items_names: IO[bytes], + deployment_name: str, + deployment: _types.Deployment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Deployment]: + """Update the state of specified deployments associated with the Cognitive Services account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param deployment_name: The name of the deployment associated with the Cognitive Services + Account. Required. + :type deployment_name: str + :param deployment: The deployment properties. Required. + :type deployment: ~azure.mgmt.cognitiveservices.types.Deployment + :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 Deployment. The Deployment is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + deployment_name: str, + deployment: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> None: - """Batch operation to delete blocklist items. + ) -> LROPoller[_models.Deployment]: + """Update the state of specified deployments associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param deployment_name: The name of the deployment associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Required. - :type rai_blocklist_items_names: IO[bytes] + :type deployment_name: str + :param deployment: The deployment properties. Required. + :type deployment: 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: None - :rtype: None + :return: An instance of LROPoller that returns Deployment. The Deployment is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def batch_delete( # pylint: disable=inconsistent-return-statements + def begin_create_or_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist_items_names: Union[List[str], IO[bytes]], + deployment_name: str, + deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], **kwargs: Any - ) -> None: - """Batch operation to delete blocklist items. + ) -> LROPoller[_models.Deployment]: + """Update the state of specified deployments associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param deployment_name: The name of the deployment associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Is either a [str] type or - a IO[bytes] type. Required. - :type rai_blocklist_items_names: list[str] or IO[bytes] - :return: None - :rtype: None + :type deployment_name: str + :param deployment: The deployment properties. Is either a Deployment type or a IO[bytes] type. + Required. + :type deployment: ~azure.mgmt.cognitiveservices.models.Deployment or + ~azure.mgmt.cognitiveservices.types.Deployment or IO[bytes] + :return: An instance of LROPoller that returns Deployment. The Deployment is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] :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[None] = kwargs.pop("cls", None) + cls: ClsType[_models.Deployment] = 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._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + deployment_name=deployment_name, + deployment=deployment, + 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) - content_type = content_type or "application/json" - _content = None - if isinstance(rai_blocklist_items_names, (IOBase, bytes)): - _content = rai_blocklist_items_names - else: - _content = json.dumps(rai_blocklist_items_names, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Deployment, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_rai_blocklist_items_batch_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _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 [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - -class RaiBlocklistsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`rai_blocklists` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Deployment].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Deployment]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any - ) -> _models.RaiBlocklist: - """Gets the specified custom blocklist associated with the Azure OpenAI account. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _update_initial( + self, + resource_group_name: str, + account_name: str, + deployment_name: str, + deployment: Union[_models.PatchResourceTagsAndSku, _types.PatchResourceTagsAndSku, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -14978,17 +7093,27 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiBlocklist] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_rai_blocklists_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(deployment, (IOBase, bytes)): + _content = deployment + else: + _content = json.dumps(deployment, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_deployments_update_request( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, + deployment_name=deployment_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -14998,19 +7123,18 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 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.ErrorResponse, @@ -15018,206 +7142,197 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiBlocklist, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - def create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist: _models.RaiBlocklist, + deployment_name: str, + deployment: _models.PatchResourceTagsAndSku, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklist: - """Update the state of specified blocklist associated with the Azure OpenAI account. + ) -> LROPoller[_models.Deployment]: + """Update specified deployments associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param deployment_name: The name of the deployment associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist: Properties describing the custom blocklist. Required. - :type rai_blocklist: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :type deployment_name: str + :param deployment: The deployment properties. Required. + :type deployment: ~azure.mgmt.cognitiveservices.models.PatchResourceTagsAndSku :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :return: An instance of LROPoller that returns Deployment. The Deployment is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist: _types.RaiBlocklist, + deployment_name: str, + deployment: _types.PatchResourceTagsAndSku, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklist: - """Update the state of specified blocklist associated with the Azure OpenAI account. + ) -> LROPoller[_models.Deployment]: + """Update specified deployments associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services - Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist: Properties describing the custom blocklist. Required. - :type rai_blocklist: ~azure.mgmt.cognitiveservices.types.RaiBlocklist + :param deployment_name: The name of the deployment associated with the Cognitive Services + Account. Required. + :type deployment_name: str + :param deployment: The deployment properties. Required. + :type deployment: ~azure.mgmt.cognitiveservices.types.PatchResourceTagsAndSku :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :return: An instance of LROPoller that returns Deployment. The Deployment is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist: IO[bytes], + deployment_name: str, + deployment: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiBlocklist: - """Update the state of specified blocklist associated with the Azure OpenAI account. + ) -> LROPoller[_models.Deployment]: + """Update specified deployments associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param deployment_name: The name of the deployment associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist: Properties describing the custom blocklist. Required. - :type rai_blocklist: IO[bytes] + :type deployment_name: str + :param deployment: The deployment properties. Required. + :type deployment: 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: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :return: An instance of LROPoller that returns Deployment. The Deployment is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - rai_blocklist_name: str, - rai_blocklist: Union[_models.RaiBlocklist, _types.RaiBlocklist, IO[bytes]], + deployment_name: str, + deployment: Union[_models.PatchResourceTagsAndSku, _types.PatchResourceTagsAndSku, IO[bytes]], **kwargs: Any - ) -> _models.RaiBlocklist: - """Update the state of specified blocklist associated with the Azure OpenAI account. + ) -> LROPoller[_models.Deployment]: + """Update specified deployments associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param deployment_name: The name of the deployment associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str - :param rai_blocklist: Properties describing the custom blocklist. Is either a RaiBlocklist type - or a IO[bytes] type. Required. - :type rai_blocklist: ~azure.mgmt.cognitiveservices.models.RaiBlocklist or - ~azure.mgmt.cognitiveservices.types.RaiBlocklist or IO[bytes] - :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :type deployment_name: str + :param deployment: The deployment properties. Is either a PatchResourceTagsAndSku type or a + IO[bytes] type. Required. + :type deployment: ~azure.mgmt.cognitiveservices.models.PatchResourceTagsAndSku or + ~azure.mgmt.cognitiveservices.types.PatchResourceTagsAndSku or IO[bytes] + :return: An instance of LROPoller that returns Deployment. The Deployment is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Deployment] :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.RaiBlocklist] = kwargs.pop("cls", None) + cls: ClsType[_models.Deployment] = 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._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + deployment_name=deployment_name, + deployment=deployment, + 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) - content_type = content_type or "application/json" - _content = None - if isinstance(rai_blocklist, (IOBase, bytes)): - _content = rai_blocklist - else: - _content = json.dumps(rai_blocklist, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Deployment, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_rai_blocklists_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_blocklist_name=rai_blocklist_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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, 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.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.RaiBlocklist, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.Deployment].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Deployment]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) def _delete_initial( - self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15232,10 +7347,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_rai_blocklists_delete_request( + _request = build_deployments_delete_request( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, + deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -15254,7 +7369,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -15280,18 +7395,18 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes the specified custom blocklist associated with the Azure OpenAI account. + """Deletes the specified deployment associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + :param deployment_name: The name of the deployment associated with the Cognitive Services Account. Required. - :type rai_blocklist_name: str + :type deployment_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -15307,7 +7422,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - rai_blocklist_name=rai_blocklist_name, + deployment_name=deployment_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -15339,25 +7454,130 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.Deployment"]: + """Gets the deployments associated with the Cognitive Services account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: An iterator like instance of Deployment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Deployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_deployments_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Deployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.RaiBlocklist"]: - """Gets the custom blocklists associated with the Azure OpenAI account. + def list_skus( + self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any + ) -> ItemPaged["_models.SkuResource"]: + """Lists the specified deployments skus associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :return: An iterator like instance of RaiBlocklist - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiBlocklist] + :param deployment_name: The name of the deployment associated with the Cognitive Services + Account. Required. + :type deployment_name: str + :return: An iterator like instance of SkuResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.SkuResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RaiBlocklist]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SkuResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15370,9 +7590,10 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - _request = build_rai_blocklists_list_request( + _request = build_deployments_list_skus_request( resource_group_name=resource_group_name, account_name=account_name, + deployment_name=deployment_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -15413,7 +7634,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RaiBlocklist], + List[_models.SkuResource], deserialized.get("value", []), ) if cls: @@ -15441,15 +7662,176 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) + @distributed_trace + def pause( + self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any + ) -> _models.Deployment: + """Pause a deployment. -class RaiTopicsOperations: # pylint: disable=docstring-missing-param + Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, + DataZoneStandard, and GlobalStandard SKUs support this operation. Inference requests to the + paused deployment endpoint will receive HTTP 423 (Locked). This operation is idempotent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param deployment_name: The name of the deployment associated with the Cognitive Services + Account. Required. + :type deployment_name: str + :return: Deployment. The Deployment is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.Deployment + :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.Deployment] = kwargs.pop("cls", None) + + _request = build_deployments_pause_request( + resource_group_name=resource_group_name, + account_name=account_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Deployment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def resume( + self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any + ) -> _models.Deployment: + """Resume a deployment. + + Resumes inferencing on a previously paused deployment by setting the deploymentState to + 'Running' (see #/definitions/DeploymentProperties/properties/deploymentState). This operation + is idempotent and can be safely called on already running deployments. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param deployment_name: The name of the deployment associated with the Cognitive Services + Account. Required. + :type deployment_name: str + :return: Deployment. The Deployment is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.Deployment + :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.Deployment] = kwargs.pop("cls", None) + + _request = build_deployments_resume_request( + resource_group_name=resource_group_name, + account_name=account_name, + deployment_name=deployment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Deployment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class CommitmentPlansOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`rai_topics` attribute. + :attr:`commitment_plans` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -15462,19 +7844,21 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any) -> _models.RaiTopic: - """Gets the specified custom topic associated with the Azure OpenAI account. + def get( + self, resource_group_name: str, account_name: str, commitment_plan_name: str, **kwargs: Any + ) -> _models.CommitmentPlan: + """Gets the specified commitmentPlans associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :return: RaiTopic. The RaiTopic is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -15488,12 +7872,12 @@ def get(self, resource_group_name: str, account_name: str, rai_topic_name: str, _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiTopic] = kwargs.pop("cls", None) + cls: ClsType[_models.CommitmentPlan] = kwargs.pop("cls", None) - _request = build_rai_topics_get_request( + _request = build_commitment_plans_get_request( resource_group_name=resource_group_name, account_name=account_name, - rai_topic_name=rai_topic_name, + commitment_plan_name=commitment_plan_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -15528,7 +7912,7 @@ def get(self, resource_group_name: str, account_name: str, rai_topic_name: str, if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiTopic, response.json()) + deserialized = _deserialize(_models.CommitmentPlan, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -15540,29 +7924,29 @@ def create_or_update( self, resource_group_name: str, account_name: str, - rai_topic_name: str, - rai_topic: _models.RaiTopic, + commitment_plan_name: str, + commitment_plan: _models.CommitmentPlan, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiTopic: - """Create the rai topic associated with the Azure OpenAI account. + ) -> _models.CommitmentPlan: + """Update the state of specified commitmentPlans associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :param rai_topic: Properties describing the rai topic. Required. - :type rai_topic: ~azure.mgmt.cognitiveservices.models.RaiTopic + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The commitmentPlan properties. Required. + :type commitment_plan: ~azure.mgmt.cognitiveservices.models.CommitmentPlan :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiTopic. The RaiTopic is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic + :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan :raises ~azure.core.exceptions.HttpResponseError: """ @@ -15571,29 +7955,29 @@ def create_or_update( self, resource_group_name: str, account_name: str, - rai_topic_name: str, - rai_topic: _types.RaiTopic, + commitment_plan_name: str, + commitment_plan: _types.CommitmentPlan, *, content_type: str = "application/json", - **kwargs: Any - ) -> _models.RaiTopic: - """Create the rai topic associated with the Azure OpenAI account. + **kwargs: Any + ) -> _models.CommitmentPlan: + """Update the state of specified commitmentPlans associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :param rai_topic: Properties describing the rai topic. Required. - :type rai_topic: ~azure.mgmt.cognitiveservices.types.RaiTopic + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The commitmentPlan properties. Required. + :type commitment_plan: ~azure.mgmt.cognitiveservices.types.CommitmentPlan :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiTopic. The RaiTopic is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic + :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan :raises ~azure.core.exceptions.HttpResponseError: """ @@ -15602,29 +7986,29 @@ def create_or_update( self, resource_group_name: str, account_name: str, - rai_topic_name: str, - rai_topic: IO[bytes], + commitment_plan_name: str, + commitment_plan: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiTopic: - """Create the rai topic associated with the Azure OpenAI account. + ) -> _models.CommitmentPlan: + """Update the state of specified commitmentPlans associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :param rai_topic: Properties describing the rai topic. Required. - :type rai_topic: IO[bytes] + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The commitmentPlan properties. Required. + :type commitment_plan: 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: RaiTopic. The RaiTopic is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic + :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan :raises ~azure.core.exceptions.HttpResponseError: """ @@ -15633,26 +8017,26 @@ def create_or_update( self, resource_group_name: str, account_name: str, - rai_topic_name: str, - rai_topic: Union[_models.RaiTopic, _types.RaiTopic, IO[bytes]], + commitment_plan_name: str, + commitment_plan: Union[_models.CommitmentPlan, _types.CommitmentPlan, IO[bytes]], **kwargs: Any - ) -> _models.RaiTopic: - """Create the rai topic associated with the Azure OpenAI account. + ) -> _models.CommitmentPlan: + """Update the state of specified commitmentPlans associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str - :param rai_topic: Properties describing the rai topic. Is either a RaiTopic type or a IO[bytes] - type. Required. - :type rai_topic: ~azure.mgmt.cognitiveservices.models.RaiTopic or - ~azure.mgmt.cognitiveservices.types.RaiTopic or IO[bytes] - :return: RaiTopic. The RaiTopic is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The commitmentPlan properties. Is either a CommitmentPlan type or a + IO[bytes] type. Required. + :type commitment_plan: ~azure.mgmt.cognitiveservices.models.CommitmentPlan or + ~azure.mgmt.cognitiveservices.types.CommitmentPlan or IO[bytes] + :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -15667,19 +8051,19 @@ def create_or_update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RaiTopic] = kwargs.pop("cls", None) + cls: ClsType[_models.CommitmentPlan] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(rai_topic, (IOBase, bytes)): - _content = rai_topic + if isinstance(commitment_plan, (IOBase, bytes)): + _content = commitment_plan else: - _content = json.dumps(rai_topic, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(commitment_plan, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_rai_topics_create_or_update_request( + _request = build_commitment_plans_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - rai_topic_name=rai_topic_name, + commitment_plan_name=commitment_plan_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -15716,7 +8100,7 @@ def create_or_update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiTopic, response.json()) + deserialized = _deserialize(_models.CommitmentPlan, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -15724,7 +8108,7 @@ def create_or_update( return deserialized # type: ignore def _delete_initial( - self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, commitment_plan_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15739,10 +8123,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_rai_topics_delete_request( + _request = build_commitment_plans_delete_request( resource_group_name=resource_group_name, account_name=account_name, - rai_topic_name=rai_topic_name, + commitment_plan_name=commitment_plan_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -15761,7 +8145,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -15787,18 +8171,18 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, commitment_plan_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes the specified custom topic associated with the Azure OpenAI account. + """Deletes the specified commitmentPlan associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services - Account. Required. - :type rai_topic_name: str + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -15814,7 +8198,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - rai_topic_name=rai_topic_name, + commitment_plan_name=commitment_plan_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -15849,22 +8233,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.RaiTopic"]: - """Gets the custom topics associated with the Azure OpenAI account. + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.CommitmentPlan"]: + """Gets the commitmentPlans associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :return: An iterator like instance of RaiTopic - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiTopic] + :return: An iterator like instance of CommitmentPlan + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.CommitmentPlan] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.RaiTopic]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CommitmentPlan]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -15877,7 +8261,7 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - _request = build_rai_topics_list_request( + _request = build_commitment_plans_list_request( resource_group_name=resource_group_name, account_name=account_name, subscription_id=self._config.subscription_id, @@ -15920,7 +8304,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.RaiTopic], + List[_models.CommitmentPlan], deserialized.get("value", []), ) if cls: @@ -15948,41 +8332,18 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - -class RaiToolLabelsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`rai_tool_labels` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any - ) -> _models.RaiToolLabel: - """Gets the specified RAI Tool Label associated with the Azure OpenAI account. + def get_plan(self, resource_group_name: str, commitment_plan_name: str, **kwargs: Any) -> _models.CommitmentPlan: + """Returns a Cognitive Services commitment plan specified by the parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :return: CommitmentPlan. The CommitmentPlan is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlan :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -15996,12 +8357,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiToolLabel] = kwargs.pop("cls", None) + cls: ClsType[_models.CommitmentPlan] = kwargs.pop("cls", None) - _request = build_rai_tool_labels_get_request( + _request = build_commitment_plans_get_plan_request( resource_group_name=resource_group_name, - account_name=account_name, - rai_tool_connection_name=rai_tool_connection_name, + commitment_plan_name=commitment_plan_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -16036,199 +8396,260 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.RaiToolLabel, response.json()) + deserialized = _deserialize(_models.CommitmentPlan, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + def _create_or_update_plan_initial( + self, + resource_group_name: str, + commitment_plan_name: str, + commitment_plan: Union[_models.CommitmentPlan, _types.CommitmentPlan, 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(commitment_plan, (IOBase, bytes)): + _content = commitment_plan + else: + _content = json.dumps(commitment_plan, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_commitment_plans_create_or_update_plan_request( + resource_group_name=resource_group_name, + commitment_plan_name=commitment_plan_name, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: + 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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("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 create_or_update( + def begin_create_or_update_plan( self, resource_group_name: str, - account_name: str, - rai_tool_connection_name: str, - rai_tool_label: _models.RaiToolLabel, + commitment_plan_name: str, + commitment_plan: _models.CommitmentPlan, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiToolLabel: - """Creates the RAI Tool Label associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :param rai_tool_label: Properties describing the RAI Tool Label. Required. - :type rai_tool_label: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + ) -> LROPoller[_models.CommitmentPlan]: + """Create Cognitive Services commitment plan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The parameters to provide for the created commitment plan. Required. + :type commitment_plan: ~azure.mgmt.cognitiveservices.models.CommitmentPlan :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :return: An instance of LROPoller that returns CommitmentPlan. The CommitmentPlan is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_create_or_update_plan( self, resource_group_name: str, - account_name: str, - rai_tool_connection_name: str, - rai_tool_label: _types.RaiToolLabel, + commitment_plan_name: str, + commitment_plan: _types.CommitmentPlan, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiToolLabel: - """Creates the RAI Tool Label associated with the Azure OpenAI account. + ) -> LROPoller[_models.CommitmentPlan]: + """Create Cognitive Services commitment plan. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :param rai_tool_label: Properties describing the RAI Tool Label. Required. - :type rai_tool_label: ~azure.mgmt.cognitiveservices.types.RaiToolLabel + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The parameters to provide for the created commitment plan. Required. + :type commitment_plan: ~azure.mgmt.cognitiveservices.types.CommitmentPlan :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :return: An instance of LROPoller that returns CommitmentPlan. The CommitmentPlan is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_create_or_update_plan( self, resource_group_name: str, - account_name: str, - rai_tool_connection_name: str, - rai_tool_label: IO[bytes], + commitment_plan_name: str, + commitment_plan: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RaiToolLabel: - """Creates the RAI Tool Label associated with the Azure OpenAI account. + ) -> LROPoller[_models.CommitmentPlan]: + """Create Cognitive Services commitment plan. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :param rai_tool_label: Properties describing the RAI Tool Label. Required. - :type rai_tool_label: IO[bytes] + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The parameters to provide for the created commitment plan. Required. + :type commitment_plan: 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: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :return: An instance of LROPoller that returns CommitmentPlan. The CommitmentPlan is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_or_update( + def begin_create_or_update_plan( self, resource_group_name: str, - account_name: str, - rai_tool_connection_name: str, - rai_tool_label: Union[_models.RaiToolLabel, _types.RaiToolLabel, IO[bytes]], + commitment_plan_name: str, + commitment_plan: Union[_models.CommitmentPlan, _types.CommitmentPlan, IO[bytes]], **kwargs: Any - ) -> _models.RaiToolLabel: - """Creates the RAI Tool Label associated with the Azure OpenAI account. + ) -> LROPoller[_models.CommitmentPlan]: + """Create Cognitive Services commitment plan. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :param rai_tool_label: Properties describing the RAI Tool Label. Is either a RaiToolLabel type - or a IO[bytes] type. Required. - :type rai_tool_label: ~azure.mgmt.cognitiveservices.models.RaiToolLabel or - ~azure.mgmt.cognitiveservices.types.RaiToolLabel or IO[bytes] - :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The parameters to provide for the created commitment plan. Is either a + CommitmentPlan type or a IO[bytes] type. Required. + :type commitment_plan: ~azure.mgmt.cognitiveservices.models.CommitmentPlan or + ~azure.mgmt.cognitiveservices.types.CommitmentPlan or IO[bytes] + :return: An instance of LROPoller that returns CommitmentPlan. The CommitmentPlan is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] :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.RaiToolLabel] = kwargs.pop("cls", None) + cls: ClsType[_models.CommitmentPlan] = 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._create_or_update_plan_initial( + resource_group_name=resource_group_name, + commitment_plan_name=commitment_plan_name, + commitment_plan=commitment_plan, + 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) - content_type = content_type or "application/json" - _content = None - if isinstance(rai_tool_label, (IOBase, bytes)): - _content = rai_tool_label - else: - _content = json.dumps(rai_tool_label, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CommitmentPlan, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_rai_tool_labels_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - rai_tool_connection_name=rai_tool_connection_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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, 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.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.RaiToolLabel, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.CommitmentPlan].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommitmentPlan]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - def _delete_initial( - self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any + def _update_plan_initial( + self, + resource_group_name: str, + commitment_plan_name: str, + commitment_plan: Union[_models.PatchResourceTagsAndSku, _types.PatchResourceTagsAndSku, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -16238,17 +8659,26 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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) - _request = build_rai_tool_labels_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(commitment_plan, (IOBase, bytes)): + _content = commitment_plan + else: + _content = json.dumps(commitment_plan, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_commitment_plans_update_plan_request( resource_group_name=resource_group_name, - account_name=account_name, - rai_tool_connection_name=rai_tool_connection_name, + commitment_plan_name=commitment_plan_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -16265,7 +8695,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -16277,47 +8707,144 @@ def _delete_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("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_update_plan( + self, + resource_group_name: str, + commitment_plan_name: str, + commitment_plan: _models.PatchResourceTagsAndSku, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommitmentPlan]: + """Create Cognitive Services commitment plan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The parameters to provide for the created commitment plan. Required. + :type commitment_plan: ~azure.mgmt.cognitiveservices.models.PatchResourceTagsAndSku + :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 CommitmentPlan. The CommitmentPlan is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_plan( + self, + resource_group_name: str, + commitment_plan_name: str, + commitment_plan: _types.PatchResourceTagsAndSku, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommitmentPlan]: + """Create Cognitive Services commitment plan. - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The parameters to provide for the created commitment plan. Required. + :type commitment_plan: ~azure.mgmt.cognitiveservices.types.PatchResourceTagsAndSku + :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 CommitmentPlan. The CommitmentPlan is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + @overload + def begin_update_plan( + self, + resource_group_name: str, + commitment_plan_name: str, + commitment_plan: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CommitmentPlan]: + """Create Cognitive Services commitment plan. - return deserialized # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The parameters to provide for the created commitment plan. Required. + :type commitment_plan: 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 CommitmentPlan. The CommitmentPlan is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def begin_delete( - self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + def begin_update_plan( + self, + resource_group_name: str, + commitment_plan_name: str, + commitment_plan: Union[_models.PatchResourceTagsAndSku, _types.PatchResourceTagsAndSku, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CommitmentPlan]: + """Create Cognitive Services commitment plan. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param rai_tool_connection_name: The name of the Rai Tool Label. Required. - :type rai_tool_connection_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan: The parameters to provide for the created commitment plan. Is either a + PatchResourceTagsAndSku type or a IO[bytes] type. Required. + :type commitment_plan: ~azure.mgmt.cognitiveservices.models.PatchResourceTagsAndSku or + ~azure.mgmt.cognitiveservices.types.PatchResourceTagsAndSku or IO[bytes] + :return: An instance of LROPoller that returns CommitmentPlan. The CommitmentPlan is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlan] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CommitmentPlan] = 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._delete_initial( + raw_result = self._update_plan_initial( resource_group_name=resource_group_name, - account_name=account_name, - rai_tool_connection_name=rai_tool_connection_name, + commitment_plan_name=commitment_plan_name, + commitment_plan=commitment_plan, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -16326,163 +8853,39 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.RaiToolLabel"]: - """Lists all RAI Tool Labels associated with the Azure OpenAI account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of RaiToolLabel - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiToolLabel] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiToolLabel]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_rai_tool_labels_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiToolLabel], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def get_long_running_output(pipeline_response): response = pipeline_response.http_response + deserialized = _deserialize(_models.CommitmentPlan, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class RaiContentFiltersOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`rai_content_filters` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, location: str, filter_name: str, **kwargs: Any) -> _models.RaiContentFilter: - """Get Content Filters by Name. + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - :param location: The name of the Azure region. Required. - :type location: str - :param filter_name: The name of the RAI Content Filter. Required. - :type filter_name: str - :return: RaiContentFilter. The RaiContentFilter is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.RaiContentFilter - :raises ~azure.core.exceptions.HttpResponseError: - """ + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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.CommitmentPlan].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommitmentPlan]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_plan_initial( + self, resource_group_name: str, commitment_plan_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -16494,11 +8897,11 @@ def get(self, location: str, filter_name: str, **kwargs: Any) -> _models.RaiCont _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.RaiContentFilter] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_rai_content_filters_get_request( - location=location, - filter_name=filter_name, + _request = build_commitment_plans_delete_plan_request( + resource_group_name=resource_group_name, + commitment_plan_name=commitment_plan_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -16510,19 +8913,18 @@ def get(self, location: str, filter_name: str, **kwargs: Any) -> _models.RaiCont _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202, 204]: + 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.ErrorResponse, @@ -16530,228 +8932,93 @@ def get(self, location: str, filter_name: str, **kwargs: Any) -> _models.RaiCont ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.RaiContentFilter, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.RaiContentFilter"]: - """List Content Filters types. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of RaiContentFilter - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiContentFilter] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.RaiContentFilter]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_rai_content_filters_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.RaiContentFilter], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=docstring-missing-param,name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`network_security_perimeter_configurations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any - ) -> _models.NetworkSecurityPerimeterConfiguration: - """Gets the specified NSP configurations for an account. + def begin_delete_plan(self, resource_group_name: str, commitment_plan_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a Cognitive Services commitment plan from the resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param nsp_configuration_name: The name of the NSP Configuration. Required. - :type nsp_configuration_name: str - :return: NetworkSecurityPerimeterConfiguration. The NetworkSecurityPerimeterConfiguration is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :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.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) - - _request = build_network_security_perimeter_configurations_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - nsp_configuration_name=nsp_configuration_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, + cls: ClsType[None] = 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._delete_plan_initial( + resource_group_name=resource_group_name, + commitment_plan_name=commitment_plan_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return deserialized # type: ignore + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.NetworkSecurityPerimeterConfiguration"]: - """Gets a list of NSP configurations for an account. + def list_plans_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.CommitmentPlan"]: + """Returns all the resources of a particular type belonging to a resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of NetworkSecurityPerimeterConfiguration - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration] + :return: An iterator like instance of CommitmentPlan + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.CommitmentPlan] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.NetworkSecurityPerimeterConfiguration]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CommitmentPlan]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -16764,9 +9031,8 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_network_security_perimeter_configurations_list_request( + _request = build_commitment_plans_list_plans_by_resource_group_request( resource_group_name=resource_group_name, - account_name=account_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -16807,7 +9073,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.NetworkSecurityPerimeterConfiguration], + List[_models.CommitmentPlan], deserialized.get("value", []), ) if cls: @@ -16835,9 +9101,19 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - def _reconcile_initial( - self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any - ) -> Iterator[bytes]: + @distributed_trace + def list_plans_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.CommitmentPlan"]: + """Returns all the resources of a particular type belonging to a subscription. + + :return: An iterator like instance of CommitmentPlan + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.CommitmentPlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.CommitmentPlan]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -16846,161 +9122,96 @@ def _reconcile_initial( } 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_network_security_perimeter_configurations_reconcile_request( - resource_group_name=resource_group_name, - account_name=account_name, - nsp_configuration_name=nsp_configuration_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 [200, 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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 + def prepare_request(next_link=None): + if not next_link: - return deserialized # type: ignore + _request = build_commitment_plans_list_plans_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - @distributed_trace - def begin_reconcile( - self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any - ) -> LROPoller[_models.NetworkSecurityPerimeterConfiguration]: - """Reconcile the NSP configuration for an account. + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param nsp_configuration_name: The name of the NSP Configuration. Required. - :type nsp_configuration_name: str - :return: An instance of LROPoller that returns NetworkSecurityPerimeterConfiguration. The - NetworkSecurityPerimeterConfiguration is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + return _request - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = 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._reconcile_initial( - resource_group_name=resource_group_name, - account_name=account_name, - nsp_configuration_name=nsp_configuration_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.CommitmentPlan], + deserialized.get("value", []), ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + def get_next(next_link=None): + _request = prepare_request(next_link) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.NetworkSecurityPerimeterConfiguration].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return LROPoller[_models.NetworkSecurityPerimeterConfiguration]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -class DefenderForAISettingsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + response = pipeline_response.http_response - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`defender_for_ai_settings` attribute. - """ + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return pipeline_response + + return ItemPaged(get_next, extract_data) @distributed_trace - def get( - self, resource_group_name: str, account_name: str, defender_for_ai_setting_name: str, **kwargs: Any - ) -> _models.DefenderForAISetting: - """Gets the specified Defender for AI setting by name. + def get_association( + self, resource_group_name: str, commitment_plan_name: str, commitment_plan_association_name: str, **kwargs: Any + ) -> _models.CommitmentPlanAccountAssociation: + """Gets the association of the Cognitive Services commitment plan. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan_association_name: The name of the commitment plan association with the + Cognitive Services Account. Required. + :type commitment_plan_association_name: str + :return: CommitmentPlanAccountAssociation. The CommitmentPlanAccountAssociation is compatible + with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -17014,12 +9225,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) + cls: ClsType[_models.CommitmentPlanAccountAssociation] = kwargs.pop("cls", None) - _request = build_defender_for_ai_settings_get_request( + _request = build_commitment_plans_get_association_request( resource_group_name=resource_group_name, - account_name=account_name, - defender_for_ai_setting_name=defender_for_ai_setting_name, + commitment_plan_name=commitment_plan_name, + commitment_plan_association_name=commitment_plan_association_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -17054,129 +9265,23 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DefenderForAISetting, response.json()) + deserialized = _deserialize(_models.CommitmentPlanAccountAssociation, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: _models.DefenderForAISetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DefenderForAISetting: - """Creates or Updates the specified Defender for AI setting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: _types.DefenderForAISetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DefenderForAISetting: - """Creates or Updates the specified Defender for AI setting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.types.DefenderForAISetting - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DefenderForAISetting: - """Creates or Updates the specified Defender for AI setting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: 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: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( + def _create_or_update_association_initial( self, resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: Union[_models.DefenderForAISetting, _types.DefenderForAISetting, IO[bytes]], + commitment_plan_name: str, + commitment_plan_association_name: str, + association: Union[ + _models.CommitmentPlanAccountAssociation, _types.CommitmentPlanAccountAssociation, IO[bytes] + ], **kwargs: Any - ) -> _models.DefenderForAISetting: - """Creates or Updates the specified Defender for AI setting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Is either a - DefenderForAISetting type or a IO[bytes] type. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting or - ~azure.mgmt.cognitiveservices.types.DefenderForAISetting or IO[bytes] - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -17189,19 +9294,19 @@ def create_or_update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(defender_for_ai_settings, (IOBase, bytes)): - _content = defender_for_ai_settings + if isinstance(association, (IOBase, bytes)): + _content = association else: - _content = json.dumps(defender_for_ai_settings, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(association, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_defender_for_ai_settings_create_or_update_request( + _request = build_commitment_plans_create_or_update_association_request( resource_group_name=resource_group_name, - account_name=account_name, - defender_for_ai_setting_name=defender_for_ai_setting_name, + commitment_plan_name=commitment_plan_name, + commitment_plan_association_name=commitment_plan_association_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -17215,7 +9320,7 @@ def create_or_update( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -17223,11 +9328,10 @@ def create_or_update( response = pipeline_response.http_response if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -17235,132 +9339,210 @@ def create_or_update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DefenderForAISetting, response.json()) + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - def update( + def begin_create_or_update_association( self, resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: _models.DefenderForAISetting, + commitment_plan_name: str, + commitment_plan_association_name: str, + association: _models.CommitmentPlanAccountAssociation, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefenderForAISetting: - """Updates the specified Defender for AI setting. + ) -> LROPoller[_models.CommitmentPlanAccountAssociation]: + """Create or update the association of the Cognitive Services commitment plan. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan_association_name: The name of the commitment plan association with the + Cognitive Services Account. Required. + :type commitment_plan_association_name: str + :param association: The commitmentPlan properties. Required. + :type association: ~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :return: An instance of LROPoller that returns CommitmentPlanAccountAssociation. The + CommitmentPlanAccountAssociation is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( + def begin_create_or_update_association( self, resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: _types.DefenderForAISetting, + commitment_plan_name: str, + commitment_plan_association_name: str, + association: _types.CommitmentPlanAccountAssociation, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefenderForAISetting: - """Updates the specified Defender for AI setting. + ) -> LROPoller[_models.CommitmentPlanAccountAssociation]: + """Create or update the association of the Cognitive Services commitment plan. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.types.DefenderForAISetting + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan_association_name: The name of the commitment plan association with the + Cognitive Services Account. Required. + :type commitment_plan_association_name: str + :param association: The commitmentPlan properties. Required. + :type association: ~azure.mgmt.cognitiveservices.types.CommitmentPlanAccountAssociation :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :return: An instance of LROPoller that returns CommitmentPlanAccountAssociation. The + CommitmentPlanAccountAssociation is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( + def begin_create_or_update_association( self, resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: IO[bytes], + commitment_plan_name: str, + commitment_plan_association_name: str, + association: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DefenderForAISetting: - """Updates the specified Defender for AI setting. + ) -> LROPoller[_models.CommitmentPlanAccountAssociation]: + """Create or update the association of the Cognitive Services commitment plan. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. - :type defender_for_ai_settings: IO[bytes] + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan_association_name: The name of the commitment plan association with the + Cognitive Services Account. Required. + :type commitment_plan_association_name: str + :param association: The commitmentPlan properties. Required. + :type association: 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: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :return: An instance of LROPoller that returns CommitmentPlanAccountAssociation. The + CommitmentPlanAccountAssociation is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def update( + def begin_create_or_update_association( self, resource_group_name: str, - account_name: str, - defender_for_ai_setting_name: str, - defender_for_ai_settings: Union[_models.DefenderForAISetting, _types.DefenderForAISetting, IO[bytes]], + commitment_plan_name: str, + commitment_plan_association_name: str, + association: Union[ + _models.CommitmentPlanAccountAssociation, _types.CommitmentPlanAccountAssociation, IO[bytes] + ], **kwargs: Any - ) -> _models.DefenderForAISetting: - """Updates the specified Defender for AI setting. + ) -> LROPoller[_models.CommitmentPlanAccountAssociation]: + """Create or update the association of the Cognitive Services commitment plan. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. - :type defender_for_ai_setting_name: str - :param defender_for_ai_settings: Properties describing the Defender for AI setting. Is either a - DefenderForAISetting type or a IO[bytes] type. Required. - :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting or - ~azure.mgmt.cognitiveservices.types.DefenderForAISetting or IO[bytes] - :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan_association_name: The name of the commitment plan association with the + Cognitive Services Account. Required. + :type commitment_plan_association_name: str + :param association: The commitmentPlan properties. Is either a CommitmentPlanAccountAssociation + type or a IO[bytes] type. Required. + :type association: ~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation or + ~azure.mgmt.cognitiveservices.types.CommitmentPlanAccountAssociation or IO[bytes] + :return: An instance of LROPoller that returns CommitmentPlanAccountAssociation. The + CommitmentPlanAccountAssociation is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation] :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.CommitmentPlanAccountAssociation] = 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._create_or_update_association_initial( + resource_group_name=resource_group_name, + commitment_plan_name=commitment_plan_name, + commitment_plan_association_name=commitment_plan_association_name, + association=association, + 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 = pipeline_response.http_response + deserialized = _deserialize(_models.CommitmentPlanAccountAssociation, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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.CommitmentPlanAccountAssociation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CommitmentPlanAccountAssociation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_association_initial( + self, resource_group_name: str, commitment_plan_name: str, commitment_plan_association_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -17369,27 +9551,17 @@ def update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.DefenderForAISetting] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(defender_for_ai_settings, (IOBase, bytes)): - _content = defender_for_ai_settings - else: - _content = json.dumps(defender_for_ai_settings, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_defender_for_ai_settings_update_request( + _request = build_commitment_plans_delete_association_request( resource_group_name=resource_group_name, - account_name=account_name, - defender_for_ai_setting_name=defender_for_ai_setting_name, + commitment_plan_name=commitment_plan_name, + commitment_plan_association_name=commitment_plan_association_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -17399,19 +9571,18 @@ def update( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202, 204]: + 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.ErrorResponse, @@ -17419,35 +9590,103 @@ def update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.DefenderForAISetting, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.DefenderForAISetting"]: - """Lists the Defender for AI settings. + def begin_delete_association( + self, resource_group_name: str, commitment_plan_name: str, commitment_plan_association_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the association of the Cognitive Services commitment plan. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of DefenderForAISetting - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.DefenderForAISetting] + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :param commitment_plan_association_name: The name of the commitment plan association with the + Cognitive Services Account. Required. + :type commitment_plan_association_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = 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._delete_association_initial( + resource_group_name=resource_group_name, + commitment_plan_name=commitment_plan_name, + commitment_plan_association_name=commitment_plan_association_name, + 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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_associations( + self, resource_group_name: str, commitment_plan_name: str, **kwargs: Any + ) -> ItemPaged["_models.CommitmentPlanAccountAssociation"]: + """Gets the associations of the Cognitive Services commitment plan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param commitment_plan_name: The name of the commitmentPlan associated with the Cognitive + Services Account. Required. + :type commitment_plan_name: str + :return: An iterator like instance of CommitmentPlanAccountAssociation + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.CommitmentPlanAccountAssociation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.DefenderForAISetting]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CommitmentPlanAccountAssociation]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -17460,9 +9699,9 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_defender_for_ai_settings_list_request( + _request = build_commitment_plans_list_associations_request( resource_group_name=resource_group_name, - account_name=account_name, + commitment_plan_name=commitment_plan_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -17503,7 +9742,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.DefenderForAISetting], + List[_models.CommitmentPlanAccountAssociation], deserialized.get("value", []), ) if cls: @@ -17532,14 +9771,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ProjectsOperations: # pylint: disable=docstring-missing-param +class EncryptionScopesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`projects` attribute. + :attr:`encryption_scopes` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -17552,18 +9791,21 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any) -> _models.Project: - """Returns a Cognitive Services project specified by the parameters. + def get( + self, resource_group_name: str, account_name: str, encryption_scope_name: str, **kwargs: Any + ) -> _models.EncryptionScope: + """Gets the specified EncryptionScope associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :return: Project. The Project is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Project + :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive + Services Account. Required. + :type encryption_scope_name: str + :return: EncryptionScope. The EncryptionScope is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.EncryptionScope :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -17577,12 +9819,12 @@ def get(self, resource_group_name: str, account_name: str, project_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Project] = kwargs.pop("cls", None) + cls: ClsType[_models.EncryptionScope] = kwargs.pop("cls", None) - _request = build_projects_get_request( + _request = build_encryption_scopes_get_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, + encryption_scope_name=encryption_scope_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -17617,21 +9859,133 @@ def get(self, resource_group_name: str, account_name: str, project_name: str, ** if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Project, response.json()) + deserialized = _deserialize(_models.EncryptionScope, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_initial( + @overload + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - project: Union[_models.Project, _types.Project, IO[bytes]], + encryption_scope_name: str, + encryption_scope: _models.EncryptionScope, + *, + content_type: str = "application/json", **kwargs: Any - ) -> Iterator[bytes]: + ) -> _models.EncryptionScope: + """Update the state of specified encryptionScope associated with the Cognitive Services account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive + Services Account. Required. + :type encryption_scope_name: str + :param encryption_scope: The encryptionScope properties. Required. + :type encryption_scope: ~azure.mgmt.cognitiveservices.models.EncryptionScope + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EncryptionScope. The EncryptionScope is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.EncryptionScope + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + account_name: str, + encryption_scope_name: str, + encryption_scope: _types.EncryptionScope, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EncryptionScope: + """Update the state of specified encryptionScope associated with the Cognitive Services account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive + Services Account. Required. + :type encryption_scope_name: str + :param encryption_scope: The encryptionScope properties. Required. + :type encryption_scope: ~azure.mgmt.cognitiveservices.types.EncryptionScope + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: EncryptionScope. The EncryptionScope is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.EncryptionScope + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + account_name: str, + encryption_scope_name: str, + encryption_scope: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.EncryptionScope: + """Update the state of specified encryptionScope associated with the Cognitive Services account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive + Services Account. Required. + :type encryption_scope_name: str + :param encryption_scope: The encryptionScope properties. Required. + :type encryption_scope: 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: EncryptionScope. The EncryptionScope is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.EncryptionScope + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + account_name: str, + encryption_scope_name: str, + encryption_scope: Union[_models.EncryptionScope, _types.EncryptionScope, IO[bytes]], + **kwargs: Any + ) -> _models.EncryptionScope: + """Update the state of specified encryptionScope associated with the Cognitive Services account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive + Services Account. Required. + :type encryption_scope_name: str + :param encryption_scope: The encryptionScope properties. Is either a EncryptionScope type or a + IO[bytes] type. Required. + :type encryption_scope: ~azure.mgmt.cognitiveservices.models.EncryptionScope or + ~azure.mgmt.cognitiveservices.types.EncryptionScope or IO[bytes] + :return: EncryptionScope. The EncryptionScope is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.EncryptionScope + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -17644,19 +9998,19 @@ def _create_initial( _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) + cls: ClsType[_models.EncryptionScope] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(project, (IOBase, bytes)): - _content = project + if isinstance(encryption_scope, (IOBase, bytes)): + _content = encryption_scope else: - _content = json.dumps(project, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(encryption_scope, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_projects_create_request( + _request = build_encryption_scopes_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, + encryption_scope_name=encryption_scope_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -17670,18 +10024,19 @@ def _create_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 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.ErrorResponse, @@ -17689,163 +10044,108 @@ def _create_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.EncryptionScope, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - project: _models.Project, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Project]: - """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give - AI developer it's individual container to work on. + def _delete_initial( + self, resource_group_name: str, account_name: str, encryption_scope_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: ~azure.mgmt.cognitiveservices.models.Project - :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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] - :raises ~azure.core.exceptions.HttpResponseError: - """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_encryption_scopes_delete_request( + resource_group_name=resource_group_name, + account_name=account_name, + encryption_scope_name=encryption_scope_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - project: _types.Project, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Project]: - """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give - AI developer it's individual container to work on. + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: ~azure.mgmt.cognitiveservices.types.Project - :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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] - :raises ~azure.core.exceptions.HttpResponseError: - """ + response = pipeline_response.http_response - @overload - def begin_create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - project: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Project]: - """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give - AI developer it's individual container to work on. + if response.status_code not in [202, 204]: + 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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: 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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] - :raises ~azure.core.exceptions.HttpResponseError: - """ + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("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_create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - project: Union[_models.Project, _types.Project, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Project]: - """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give - AI developer it's individual container to work on. + def begin_delete( + self, resource_group_name: str, account_name: str, encryption_scope_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified encryptionScope associated with the Cognitive Services account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Is either a Project type or - a IO[bytes] type. Required. - :type project: ~azure.mgmt.cognitiveservices.models.Project or - ~azure.mgmt.cognitiveservices.types.Project or IO[bytes] - :return: An instance of LROPoller that returns Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] + :param encryption_scope_name: The name of the encryptionScope associated with the Cognitive + Services Account. Required. + :type encryption_scope_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.Project] = kwargs.pop("cls", None) + cls: ClsType[None] = 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._create_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, - project=project, - content_type=content_type, + encryption_scope_name=encryption_scope_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -17854,12 +10154,9 @@ def begin_create( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Project, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -17874,24 +10171,166 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Project].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Project]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.EncryptionScope"]: + """Gets the content filters associated with the Azure OpenAI account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: An iterator like instance of EncryptionScope + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.EncryptionScope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EncryptionScope]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_encryption_scopes_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.EncryptionScope], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RaiPoliciesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`rai_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def _update_initial( - self, - resource_group_name: str, - account_name: str, - project_name: str, - project: Union[_models.Project, _types.Project, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + @distributed_trace + @api_version_validation( + method_added_on="2026-09-15-preview", + params_added_on={ + "2026-09-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "account_name", + "rai_policy_name", + "accept", + ] + }, + api_versions_list=["2026-09-15-preview", "2026-11-01"], + ) + def get( + self, resource_group_name: str, account_name: str, rai_policy_name: str, **kwargs: Any + ) -> _models.RaiPolicy: + """Gets the specified Content Filters associated with the Azure OpenAI account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -17900,27 +10339,17 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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(project, (IOBase, bytes)): - _content = project - else: - _content = json.dumps(project, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RaiPolicy] = kwargs.pop("cls", None) - _request = build_projects_update_request( + _request = build_rai_policies_get_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, + rai_policy_name=rai_policy_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -17930,18 +10359,19 @@ def _update_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -17949,192 +10379,234 @@ def _update_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RaiPolicy, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - def begin_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - project: _models.Project, + rai_policy_name: str, + rai_policy: _models.RaiPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Project]: - """Updates a Cognitive Services Project. + ) -> _models.RaiPolicy: + """Update the state of specified Content Filters associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: ~azure.mgmt.cognitiveservices.models.Project + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :param rai_policy: Properties describing the Content Filters. Required. + :type rai_policy: ~azure.mgmt.cognitiveservices.models.RaiPolicy :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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] + :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - project: _types.Project, + rai_policy_name: str, + rai_policy: _types.RaiPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Project]: - """Updates a Cognitive Services Project. + ) -> _models.RaiPolicy: + """Update the state of specified Content Filters associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: ~azure.mgmt.cognitiveservices.types.Project + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :param rai_policy: Properties describing the Content Filters. Required. + :type rai_policy: ~azure.mgmt.cognitiveservices.types.RaiPolicy :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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] + :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - project: IO[bytes], + rai_policy_name: str, + rai_policy: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Project]: - """Updates a Cognitive Services Project. + ) -> _models.RaiPolicy: + """Update the state of specified Content Filters associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Required. - :type project: IO[bytes] + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :param rai_policy: Properties describing the Content Filters. Required. + :type rai_policy: 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 Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] + :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update( + @api_version_validation( + method_added_on="2026-09-15-preview", + params_added_on={ + "2026-09-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "account_name", + "rai_policy_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-09-15-preview", "2026-11-01"], + ) + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - project: Union[_models.Project, _types.Project, IO[bytes]], + rai_policy_name: str, + rai_policy: Union[_models.RaiPolicy, _types.RaiPolicy, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Project]: - """Updates a Cognitive Services Project. + ) -> _models.RaiPolicy: + """Update the state of specified Content Filters associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param project: The parameters to provide for the created project. Is either a Project type or - a IO[bytes] type. Required. - :type project: ~azure.mgmt.cognitiveservices.models.Project or - ~azure.mgmt.cognitiveservices.types.Project or IO[bytes] - :return: An instance of LROPoller that returns Project. The Project is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :param rai_policy: Properties describing the Content Filters. Is either a RaiPolicy type or a + IO[bytes] type. Required. + :type rai_policy: ~azure.mgmt.cognitiveservices.models.RaiPolicy or + ~azure.mgmt.cognitiveservices.types.RaiPolicy or IO[bytes] + :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :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.Project] = 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._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - project=project, - 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) + cls: ClsType[_models.RaiPolicy] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Project, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(rai_policy, (IOBase, bytes)): + _content = rai_policy + else: + _content = json.dumps(rai_policy, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_rai_policies_create_or_update_request( + resource_group_name=resource_group_name, + account_name=account_name, + rai_policy_name=rai_policy_name, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if response.status_code not in [200, 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.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.Project].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Project]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.RaiPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @api_version_validation( + method_added_on="2026-09-15-preview", + params_added_on={ + "2026-09-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "account_name", + "rai_policy_name", + ] + }, + api_versions_list=["2026-09-15-preview", "2026-11-01"], + ) def _delete_initial( - self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, rai_policy_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -18149,10 +10621,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_projects_delete_request( + _request = build_rai_policies_delete_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, + rai_policy_name=rai_policy_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -18171,7 +10643,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -18185,10 +10657,7 @@ def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["location"] = self._deserialize("str", response.headers.get("location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -18199,18 +10668,32 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace + @api_version_validation( + method_added_on="2026-09-15-preview", + params_added_on={ + "2026-09-15-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "account_name", + "rai_policy_name", + ] + }, + api_versions_list=["2026-09-15-preview", "2026-11-01"], + ) def begin_delete( - self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, rai_policy_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes a Cognitive Services project from the resource group. + """Deletes the specified Content Filters associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -18226,7 +10709,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, + rai_policy_name=rai_policy_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -18261,22 +10744,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.Project"]: - """Returns all the projects in a Cognitive Services account. + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.RaiPolicy"]: + """Gets the content filters associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :return: An iterator like instance of Project - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Project] + :return: An iterator like instance of RaiPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiPolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Project]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RaiPolicy]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -18289,7 +10772,7 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - _request = build_projects_list_request( + _request = build_rai_policies_list_request( resource_group_name=resource_group_name, account_name=account_name, subscription_id=self._config.subscription_id, @@ -18332,278 +10815,63 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Project], + List[_models.RaiPolicy], deserialized.get("value", []), ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class ProjectConnectionsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`project_connections` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, project_name: str, connection_name: str, **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Lists Cognitive Services project connection by name. - - Lists Cognitive Services project connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :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.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - _request = build_project_connections_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - connection_name=connection_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[_models.ConnectionPropertiesV2BasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Create or update Cognitive Services project connection under the specified project. - - Create or update Cognitive Services project connection under the specified project. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: The object for creating or updating a new account connection. Default value - is None. - :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ + def get_next(next_link=None): + _request = prepare_request(next_link) - @overload - def create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[_types.ConnectionPropertiesV2BasicResource] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Create or update Cognitive Services project connection under the specified project. + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - Create or update Cognitive Services project connection under the specified project. + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: The object for creating or updating a new account connection. Default value - is None. - :type connection: ~azure.mgmt.cognitiveservices.types.ConnectionPropertiesV2BasicResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ + return pipeline_response - @overload - def create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Create or update Cognitive Services project connection under the specified project. + return ItemPaged(get_next, extract_data) - Create or update Cognitive Services project connection under the specified project. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: The object for creating or updating a new account connection. Default value - is None. - :type connection: 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: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource - :raises ~azure.core.exceptions.HttpResponseError: - """ +class SubscriptionRaiPolicyOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - @distributed_trace - def create( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[ - Union[_models.ConnectionPropertiesV2BasicResource, _types.ConnectionPropertiesV2BasicResource, IO[bytes]] - ] = None, - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Create or update Cognitive Services project connection under the specified project. + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`subscription_rai_policy` attribute. + """ - Create or update Cognitive Services project connection under the specified project. + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: The object for creating or updating a new account connection. Is either a - ConnectionPropertiesV2BasicResource type or a IO[bytes] type. Default value is None. - :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource or - ~azure.mgmt.cognitiveservices.types.ConnectionPropertiesV2BasicResource or IO[bytes] - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + @distributed_trace + def get(self, rai_policy_name: str, **kwargs: Any) -> _models.RaiPolicy: + """Gets the specified Content Filters associated with the Subscription. + + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -18614,32 +10882,15 @@ def create( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if connection else None - cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" if connection else None - _content = None - if isinstance(connection, (IOBase, bytes)): - _content = connection - else: - if connection is not None: - _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + cls: ClsType[_models.RaiPolicy] = kwargs.pop("cls", None) - _request = build_project_connections_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - connection_name=connection_name, + _request = build_subscription_rai_policy_get_request( + rai_policy_name=rai_policy_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -18672,7 +10923,7 @@ def create( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) + deserialized = _deserialize(_models.RaiPolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -18680,143 +10931,87 @@ def create( return deserialized # type: ignore @overload - def update( + def create_or_update( self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[_models.ConnectionUpdateContent] = None, + rai_policy_name: str, + rai_policy: _models.RaiPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Update Cognitive Services project connection under the specified project. - - Update Cognitive Services project connection under the specified project. + ) -> _models.RaiPolicy: + """Update the state of specified Content Filters associated with the subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: Parameters for account connection update. Default value is None. - :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionUpdateContent + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :param rai_policy: Properties describing the Content Filters. Required. + :type rai_policy: ~azure.mgmt.cognitiveservices.models.RaiPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( + def create_or_update( self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[_types.ConnectionUpdateContent] = None, + rai_policy_name: str, + rai_policy: _types.RaiPolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Update Cognitive Services project connection under the specified project. - - Update Cognitive Services project connection under the specified project. + ) -> _models.RaiPolicy: + """Update the state of specified Content Filters associated with the subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: Parameters for account connection update. Default value is None. - :type connection: ~azure.mgmt.cognitiveservices.types.ConnectionUpdateContent + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :param rai_policy: Properties describing the Content Filters. Required. + :type rai_policy: ~azure.mgmt.cognitiveservices.types.RaiPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Update Cognitive Services project connection under the specified project. - - Update Cognitive Services project connection under the specified project. + def create_or_update( + self, rai_policy_name: str, rai_policy: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RaiPolicy: + """Update the state of specified Content Filters associated with the subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: Parameters for account connection update. Default value is None. - :type connection: IO[bytes] + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :param rai_policy: Properties describing the Content Filters. Required. + :type rai_policy: 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: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - connection_name: str, - connection: Optional[Union[_models.ConnectionUpdateContent, _types.ConnectionUpdateContent, IO[bytes]]] = None, - **kwargs: Any - ) -> _models.ConnectionPropertiesV2BasicResource: - """Update Cognitive Services project connection under the specified project. - - Update Cognitive Services project connection under the specified project. + def create_or_update( + self, rai_policy_name: str, rai_policy: Union[_models.RaiPolicy, _types.RaiPolicy, IO[bytes]], **kwargs: Any + ) -> _models.RaiPolicy: + """Update the state of specified Content Filters associated with the subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :param connection: Parameters for account connection update. Is either a - ConnectionUpdateContent type or a IO[bytes] type. Default value is None. - :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionUpdateContent or - ~azure.mgmt.cognitiveservices.types.ConnectionUpdateContent or IO[bytes] - :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is - compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :param rai_policy: Properties describing the Content Filters. Is either a RaiPolicy type or a + IO[bytes] type. Required. + :type rai_policy: ~azure.mgmt.cognitiveservices.models.RaiPolicy or + ~azure.mgmt.cognitiveservices.types.RaiPolicy or IO[bytes] + :return: RaiPolicy. The RaiPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiPolicy :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -18831,24 +11026,17 @@ def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - content_type = content_type if connection else None - cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) + cls: ClsType[_models.RaiPolicy] = kwargs.pop("cls", None) - content_type = content_type or "application/json" if connection else None + content_type = content_type or "application/json" _content = None - if isinstance(connection, (IOBase, bytes)): - _content = connection + if isinstance(rai_policy, (IOBase, bytes)): + _content = rai_policy else: - if connection is not None: - _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - else: - _content = None + _content = json.dumps(rai_policy, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_project_connections_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - connection_name=connection_name, + _request = build_subscription_rai_policy_create_or_update_request( + rai_policy_name=rai_policy_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -18869,7 +11057,7 @@ def update( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -18885,34 +11073,14 @@ def update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) + deserialized = _deserialize(_models.RaiPolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, account_name: str, project_name: str, connection_name: str, **kwargs: Any - ) -> None: - """Delete Cognitive Services project connection by name. - - Delete Cognitive Services project connection by name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param connection_name: Friendly name of the connection. Required. - :type connection_name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _delete_initial(self, rai_policy_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -18924,13 +11092,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_project_connections_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - connection_name=connection_name, + _request = build_subscription_rai_policy_delete_request( + rai_policy_name=rai_policy_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -18941,14 +11106,19 @@ def delete( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [200, 204]: + if response.status_code not in [202, 204]: + 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.ErrorResponse, @@ -18956,144 +11126,77 @@ def delete( # pylint: disable=inconsistent-return-statements ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - project_name: str, - *, - target: Optional[str] = None, - category: Optional[str] = None, - include_all: bool = False, - **kwargs: Any - ) -> ItemPaged["_models.ConnectionPropertiesV2BasicResource"]: - """Lists all the available Cognitive Services project connections under the specified project. + return deserialized # type: ignore - Lists all the available Cognitive Services project connections under the specified project. + @distributed_trace + def begin_delete(self, rai_policy_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified Content Filters associated with the subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :keyword target: Target of the connection. Default value is None. - :paramtype target: str - :keyword category: Category of the connection. Default value is None. - :paramtype category: str - :keyword include_all: query parameter that indicates if get connection call should return both - connections and datastores. Default value is False. - :paramtype include_all: bool - :return: An iterator like instance of ConnectionPropertiesV2BasicResource - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource] + :param rai_policy_name: The name of the RaiPolicy associated with the Cognitive Services + Account. Required. + :type rai_policy_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ConnectionPropertiesV2BasicResource]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_project_connections_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - subscription_id=self._config.subscription_id, - target=target, - category=category, - include_all=include_all, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.ConnectionPropertiesV2BasicResource], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + cls: ClsType[None] = 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._delete_initial( + rai_policy_name=rai_policy_name, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - response = pipeline_response.http_response + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return ItemPaged(get_next, extract_data) + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class ProjectCapabilityHostsOperations: # pylint: disable=docstring-missing-param +class RaiBlocklistItemsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`project_capability_hosts` attribute. + :attr:`rai_blocklist_items` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -19107,24 +11210,28 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get( - self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any - ) -> _models.ProjectCapabilityHost: - """Get project capabilityHost. - - Get project capabilityHost. + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_item_name: str, + **kwargs: Any + ) -> _models.RaiBlocklistItem: + """Gets the specified custom blocklist Item associated with the custom blocklist. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :return: ProjectCapabilityHost. The ProjectCapabilityHost is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -19138,13 +11245,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ProjectCapabilityHost] = kwargs.pop("cls", None) + cls: ClsType[_models.RaiBlocklistItem] = kwargs.pop("cls", None) - _request = build_project_capability_hosts_get_request( + _request = build_rai_blocklist_items_get_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, - capability_host_name=capability_host_name, + rai_blocklist_name=rai_blocklist_name, + rai_blocklist_item_name=rai_blocklist_item_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -19179,300 +11286,225 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ProjectCapabilityHost, response.json()) + deserialized = _deserialize(_models.RaiBlocklistItem, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - project_name: str, - capability_host_name: str, - capability_host: Union[_models.ProjectCapabilityHost, _types.ProjectCapabilityHost, 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(capability_host, (IOBase, bytes)): - _content = capability_host - else: - _content = json.dumps(capability_host, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_project_capability_hosts_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - capability_host_name=capability_host_name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "str", response.headers.get("x-ms-async-operation-timeout") - ) - - 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_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - capability_host_name: str, - capability_host: _models.ProjectCapabilityHost, + rai_blocklist_name: str, + rai_blocklist_item_name: str, + rai_blocklist_item: _models.RaiBlocklistItem, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ProjectCapabilityHost]: - """Create or update project capabilityHost. - - Create or update project capabilityHost. + ) -> _models.RaiBlocklistItem: + """Update the state of specified blocklist item associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :param capability_host: CapabilityHost definition. Required. - :type capability_host: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :param rai_blocklist_item: Properties describing the custom blocklist. Required. + :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :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 ProjectCapabilityHost. The ProjectCapabilityHost - is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] + :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - capability_host_name: str, - capability_host: _types.ProjectCapabilityHost, + rai_blocklist_name: str, + rai_blocklist_item_name: str, + rai_blocklist_item: _types.RaiBlocklistItem, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ProjectCapabilityHost]: - """Create or update project capabilityHost. - - Create or update project capabilityHost. + ) -> _models.RaiBlocklistItem: + """Update the state of specified blocklist item associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :param capability_host: CapabilityHost definition. Required. - :type capability_host: ~azure.mgmt.cognitiveservices.types.ProjectCapabilityHost + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :param rai_blocklist_item: Properties describing the custom blocklist. Required. + :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.types.RaiBlocklistItem :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 ProjectCapabilityHost. The ProjectCapabilityHost - is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] + :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - capability_host_name: str, - capability_host: IO[bytes], + rai_blocklist_name: str, + rai_blocklist_item_name: str, + rai_blocklist_item: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ProjectCapabilityHost]: - """Create or update project capabilityHost. - - Create or update project capabilityHost. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :param capability_host: CapabilityHost definition. Required. - :type capability_host: IO[bytes] + ) -> _models.RaiBlocklistItem: + """Update the state of specified blocklist item associated with the Azure OpenAI account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :param rai_blocklist_item: Properties describing the custom blocklist. Required. + :type rai_blocklist_item: 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 ProjectCapabilityHost. The ProjectCapabilityHost - is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] + :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - capability_host_name: str, - capability_host: Union[_models.ProjectCapabilityHost, _types.ProjectCapabilityHost, IO[bytes]], + rai_blocklist_name: str, + rai_blocklist_item_name: str, + rai_blocklist_item: Union[_models.RaiBlocklistItem, _types.RaiBlocklistItem, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ProjectCapabilityHost]: - """Create or update project capabilityHost. - - Create or update project capabilityHost. + ) -> _models.RaiBlocklistItem: + """Update the state of specified blocklist item associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str - :param capability_host: CapabilityHost definition. Is either a ProjectCapabilityHost type or a - IO[bytes] type. Required. - :type capability_host: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost or - ~azure.mgmt.cognitiveservices.types.ProjectCapabilityHost or IO[bytes] - :return: An instance of LROPoller that returns ProjectCapabilityHost. The ProjectCapabilityHost - is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str + :param rai_blocklist_item: Properties describing the custom blocklist. Is either a + RaiBlocklistItem type or a IO[bytes] type. Required. + :type rai_blocklist_item: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem or + ~azure.mgmt.cognitiveservices.types.RaiBlocklistItem or IO[bytes] + :return: RaiBlocklistItem. The RaiBlocklistItem is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklistItem :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.ProjectCapabilityHost] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - capability_host_name=capability_host_name, - capability_host=capability_host, - 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) + cls: ClsType[_models.RaiBlocklistItem] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ProjectCapabilityHost, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(rai_blocklist_item, (IOBase, bytes)): + _content = rai_blocklist_item + else: + _content = json.dumps(rai_blocklist_item, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_rai_blocklist_items_create_or_update_request( + resource_group_name=resource_group_name, + account_name=account_name, + rai_blocklist_name=rai_blocklist_name, + rai_blocklist_item_name=rai_blocklist_item_name, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _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, 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.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.ProjectCapabilityHost].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ProjectCapabilityHost]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.RaiBlocklistItem, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore def _delete_initial( - self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_item_name: str, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -19487,11 +11519,11 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_project_capability_hosts_delete_request( + _request = build_rai_blocklist_items_delete_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, - capability_host_name=capability_host_name, + rai_blocklist_name=rai_blocklist_name, + rai_blocklist_item_name=rai_blocklist_item_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -19525,9 +11557,7 @@ def _delete_initial( response_headers = {} if response.status_code == 202: response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "str", response.headers.get("x-ms-async-operation-timeout") - ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -19538,22 +11568,26 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_item_name: str, + **kwargs: Any ) -> LROPoller[None]: - """Delete project capabilityHost. - - Delete project capabilityHost. + """Deletes the specified blocklist Item associated with the custom blocklist. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param capability_host_name: The name of the capability host associated with the Cognitive - Services Resource. Required. - :type capability_host_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_item_name: The name of the RaiBlocklist Item associated with the custom + blocklist. Required. + :type rai_blocklist_item_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -19569,8 +11603,8 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, - capability_host_name=capability_host_name, + rai_blocklist_name=rai_blocklist_name, + rai_blocklist_item_name=rai_blocklist_item_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -19606,28 +11640,26 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list( - self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any - ) -> ItemPaged["_models.ProjectCapabilityHost"]: - """List capabilityHost. - - List capabilityHost. + self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any + ) -> ItemPaged["_models.RaiBlocklistItem"]: + """Gets the blocklist items associated with the custom blocklist. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :return: An iterator like instance of ProjectCapabilityHost - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :return: An iterator like instance of RaiBlocklistItem + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiBlocklistItem] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ProjectCapabilityHost]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RaiBlocklistItem]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -19640,10 +11672,10 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_project_capability_hosts_list_request( + _request = build_rai_blocklist_items_list_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, + rai_blocklist_name=rai_blocklist_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -19684,7 +11716,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ProjectCapabilityHost], + List[_models.RaiBlocklistItem], deserialized.get("value", []), ) if cls: @@ -19712,37 +11744,129 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) + @overload + def batch_add( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_items: List[_models.RaiBlocklistItemBulkRequest], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RaiBlocklist: + """Batch operation to add blocklist items. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items: Properties describing the custom blocklist items. Required. + :type rai_blocklist_items: + list[~azure.mgmt.cognitiveservices.models.RaiBlocklistItemBulkRequest] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def batch_add( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_items: List[_types.RaiBlocklistItemBulkRequest], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RaiBlocklist: + """Batch operation to add blocklist items. -class QuotaTiersOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items: Properties describing the custom blocklist items. Required. + :type rai_blocklist_items: + list[~azure.mgmt.cognitiveservices.types.RaiBlocklistItemBulkRequest] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`quota_tiers` attribute. - """ + @overload + def batch_add( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_items: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RaiBlocklist: + """Batch operation to add blocklist items. - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items: Properties describing the custom blocklist items. Required. + :type rai_blocklist_items: 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: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - def get(self, default: str, **kwargs: Any) -> _models.QuotaTier: - """Gets the Quota Tier for a subscription. - - Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. + def batch_add( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_items: Union[ + List[_models.RaiBlocklistItemBulkRequest], List[_types.RaiBlocklistItemBulkRequest], IO[bytes] + ], + **kwargs: Any + ) -> _models.RaiBlocklist: + """Batch operation to add blocklist items. - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items: Properties describing the custom blocklist items. Is either a + [RaiBlocklistItemBulkRequest] type or a IO[bytes] type. Required. + :type rai_blocklist_items: + list[~azure.mgmt.cognitiveservices.models.RaiBlocklistItemBulkRequest] or + list[~azure.mgmt.cognitiveservices.types.RaiBlocklistItemBulkRequest] or IO[bytes] + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -19753,15 +11877,27 @@ def get(self, default: str, **kwargs: Any) -> _models.QuotaTier: } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.QuotaTier] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RaiBlocklist] = kwargs.pop("cls", None) - _request = build_quota_tiers_get_request( - default=default, + content_type = content_type or "application/json" + _content = None + if isinstance(rai_blocklist_items, (IOBase, bytes)): + _content = rai_blocklist_items + else: + _content = json.dumps(rai_blocklist_items, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_rai_blocklist_items_batch_add_request( + resource_group_name=resource_group_name, + account_name=account_name, + rai_blocklist_name=rai_blocklist_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -19794,7 +11930,7 @@ def get(self, default: str, **kwargs: Any) -> _models.QuotaTier: if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.QuotaTier, response.json()) + deserialized = _deserialize(_models.RaiBlocklist, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -19802,85 +11938,91 @@ def get(self, default: str, **kwargs: Any) -> _models.QuotaTier: return deserialized # type: ignore @overload - def create_or_update( - self, default: str, tier: _models.QuotaTier, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, default: str, tier: _types.QuotaTier, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. + def batch_delete( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_items_names: List[str], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Batch operation to delete blocklist items. - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: ~azure.mgmt.cognitiveservices.types.QuotaTier + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Required. + :type rai_blocklist_items_names: list[str] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( - self, default: str, tier: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. + def batch_delete( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_items_names: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Batch operation to delete blocklist items. - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: IO[bytes] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Required. + :type rai_blocklist_items_names: 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: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_or_update( - self, default: str, tier: Union[_models.QuotaTier, _types.QuotaTier, IO[bytes]], **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. + def batch_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist_items_names: Union[List[str], IO[bytes]], + **kwargs: Any + ) -> None: + """Batch operation to delete blocklist items. - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Is either a QuotaTier type - or a IO[bytes] type. Required. - :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier or - ~azure.mgmt.cognitiveservices.types.QuotaTier or IO[bytes] - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist_items_names: List of RAI Blocklist Items Names. Is either a [str] type or + a IO[bytes] type. Required. + :type rai_blocklist_items_names: list[str] or IO[bytes] + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -19895,17 +12037,19 @@ def create_or_update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.QuotaTier] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(tier, (IOBase, bytes)): - _content = tier + if isinstance(rai_blocklist_items_names, (IOBase, bytes)): + _content = rai_blocklist_items_names else: - _content = json.dumps(tier, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(rai_blocklist_items_names, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_quota_tiers_create_or_update_request( - default=default, + _request = build_rai_blocklist_items_batch_delete_request( + resource_group_name=resource_group_name, + account_name=account_name, + rai_blocklist_name=rai_blocklist_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -19918,20 +12062,14 @@ def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -19939,100 +12077,45 @@ def create_or_update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.QuotaTier, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, default: str, tier: _models.QuotaTier, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. The only properties that can be updated are - "tierUpgradePolicy". - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. - - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, default: str, tier: _types.QuotaTier, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. The only properties that can be updated are - "tierUpgradePolicy". - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. + return cls(pipeline_response, None, {}) # type: ignore - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: ~azure.mgmt.cognitiveservices.types.QuotaTier - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def update( - self, default: str, tier: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. The only properties that can be updated are - "tierUpgradePolicy". +class RaiBlocklistsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`rai_blocklists` attribute. + """ - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Required. - :type tier: 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: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier - :raises ~azure.core.exceptions.HttpResponseError: - """ + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def update( - self, default: str, tier: Union[_models.QuotaTier, _types.QuotaTier, IO[bytes]], **kwargs: Any - ) -> _models.QuotaTier: - """Updates the Quota Tier resource for a subscription. The only properties that can be updated are - "tierUpgradePolicy". - - Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide - resource type. It holds current tier information. + def get( + self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any + ) -> _models.RaiBlocklist: + """Gets the specified custom blocklist associated with the Azure OpenAI account. - :param default: Default parameter. Leave the value as default. Required. - :type default: str - :param tier: The parameters to provide for the quota tier resource. Is either a QuotaTier type - or a IO[bytes] type. Required. - :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier or - ~azure.mgmt.cognitiveservices.types.QuotaTier or IO[bytes] - :return: QuotaTier. The QuotaTier is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -20043,25 +12126,17 @@ def update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.QuotaTier] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(tier, (IOBase, bytes)): - _content = tier - else: - _content = json.dumps(tier, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RaiBlocklist] = kwargs.pop("cls", None) - _request = build_quota_tiers_update_request( - default=default, + _request = build_rai_blocklists_get_request( + resource_group_name=resource_group_name, + account_name=account_name, + rai_blocklist_name=rai_blocklist_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -20094,157 +12169,131 @@ def update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.QuotaTier, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.QuotaTier"]: - """Returns all the resources of a particular type belonging to a subscription. - - :return: An iterator like instance of QuotaTier - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.QuotaTier] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.QuotaTier]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_quota_tiers_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.QuotaTier], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + deserialized = _deserialize(_models.RaiBlocklist, response.json()) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return pipeline_response + return deserialized # type: ignore - return ItemPaged(get_next, extract_data) + @overload + def create_or_update( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist: _models.RaiBlocklist, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RaiBlocklist: + """Update the state of specified blocklist associated with the Azure OpenAI account. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist: Properties describing the custom blocklist. Required. + :type rai_blocklist: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :raises ~azure.core.exceptions.HttpResponseError: + """ -class ArcDeploymentsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. + @overload + def create_or_update( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist: _types.RaiBlocklist, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RaiBlocklist: + """Update the state of specified blocklist associated with the Azure OpenAI account. - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`arc_deployments` attribute. - """ + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist: Properties describing the custom blocklist. Required. + :type rai_blocklist: ~azure.mgmt.cognitiveservices.types.RaiBlocklist + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :raises ~azure.core.exceptions.HttpResponseError: + """ - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload + def create_or_update( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RaiBlocklist: + """Update the state of specified blocklist associated with the Azure OpenAI account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist: Properties describing the custom blocklist. Required. + :type rai_blocklist: 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: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "accept", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - def get( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> _models.ArcDeployment: - """Gets the specified Arc deployment associated with the Cognitive Services account. + def create_or_update( + self, + resource_group_name: str, + account_name: str, + rai_blocklist_name: str, + rai_blocklist: Union[_models.RaiBlocklist, _types.RaiBlocklist, IO[bytes]], + **kwargs: Any + ) -> _models.RaiBlocklist: + """Update the state of specified blocklist associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :return: ArcDeployment. The ArcDeployment is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ArcDeployment + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :param rai_blocklist: Properties describing the custom blocklist. Is either a RaiBlocklist type + or a IO[bytes] type. Required. + :type rai_blocklist: ~azure.mgmt.cognitiveservices.models.RaiBlocklist or + ~azure.mgmt.cognitiveservices.types.RaiBlocklist or IO[bytes] + :return: RaiBlocklist. The RaiBlocklist is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiBlocklist :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -20255,17 +12304,27 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ArcDeployment] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RaiBlocklist] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(rai_blocklist, (IOBase, bytes)): + _content = rai_blocklist + else: + _content = json.dumps(rai_blocklist, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_arc_deployments_get_request( + _request = build_rai_blocklists_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - deployment_name=deployment_name, + rai_blocklist_name=rai_blocklist_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -20282,7 +12341,7 @@ def get( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -20298,35 +12357,15 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.ArcDeployment, response.json()) + deserialized = _deserialize(_models.RaiBlocklist, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: Union[_models.ArcDeployment, _types.ArcDeployment, IO[bytes]], - **kwargs: Any + def _delete_initial( + self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -20336,27 +12375,17 @@ def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_arc_deployments_create_or_update_request( + _request = build_rai_blocklists_delete_request( resource_group_name=resource_group_name, account_name=account_name, - deployment_name=deployment_name, + rai_blocklist_name=rai_blocklist_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -20373,7 +12402,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -20386,177 +12415,47 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - 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_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: _models.ArcDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ArcDeployment]: - """Creates or updates an Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param resource: The Arc deployment properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.ArcDeployment - :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 ArcDeployment. The ArcDeployment is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: _types.ArcDeployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ArcDeployment]: - """Creates or updates an Arc deployment associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param resource: The Arc deployment properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.ArcDeployment - :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 ArcDeployment. The ArcDeployment is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ArcDeployment]: - """Creates or updates an Arc deployment associated with the Cognitive Services account. + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param resource: The Arc deployment properties. Required. - :type resource: 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 ArcDeployment. The ArcDeployment is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: Union[_models.ArcDeployment, _types.ArcDeployment, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ArcDeployment]: - """Creates or updates an Arc deployment associated with the Cognitive Services account. + def begin_delete( + self, resource_group_name: str, account_name: str, rai_blocklist_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified custom blocklist associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param resource: The Arc deployment properties. Is either a ArcDeployment type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.ArcDeployment or - ~azure.mgmt.cognitiveservices.types.ArcDeployment or IO[bytes] - :return: An instance of LROPoller that returns ArcDeployment. The ArcDeployment is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] + :param rai_blocklist_name: The name of the RaiBlocklist associated with the Cognitive Services + Account. Required. + :type rai_blocklist_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.ArcDeployment] = kwargs.pop("cls", None) + cls: ClsType[None] = 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._create_or_update_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - deployment_name=deployment_name, - resource=resource, - content_type=content_type, + rai_blocklist_name=rai_blocklist_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -20565,12 +12464,9 @@ def begin_create_or_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ArcDeployment, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -20585,39 +12481,150 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ArcDeployment].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ArcDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.RaiBlocklist"]: + """Gets the custom blocklists associated with the Azure OpenAI account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: An iterator like instance of RaiBlocklist + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiBlocklist] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RaiBlocklist]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_rai_blocklists_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RaiBlocklist], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RaiTopicsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`rai_topics` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - def _update_initial( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: Union[_models.ArcDeploymentUpdate, _types.ArcDeploymentUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + @distributed_trace + def get(self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any) -> _models.RaiTopic: + """Gets the specified custom topic associated with the Azure OpenAI account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services + Account. Required. + :type rai_topic_name: str + :return: RaiTopic. The RaiTopic is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -20626,27 +12633,17 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RaiTopic] = kwargs.pop("cls", None) - _request = build_arc_deployments_update_request( + _request = build_rai_topics_get_request( resource_group_name=resource_group_name, account_name=account_name, - deployment_name=deployment_name, + rai_topic_name=rai_topic_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -20656,18 +12653,19 @@ def _update_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -20675,231 +12673,206 @@ def _update_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RaiTopic, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - def begin_update( + def create_or_update( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: _models.ArcDeploymentUpdate, + rai_topic_name: str, + rai_topic: _models.RaiTopic, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ArcDeployment]: - """Updates the specified Arc deployment associated with the Cognitive Services account. + ) -> _models.RaiTopic: + """Create the rai topic associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param properties: The Arc deployment update properties. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.ArcDeploymentUpdate + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services + Account. Required. + :type rai_topic_name: str + :param rai_topic: Properties describing the rai topic. Required. + :type rai_topic: ~azure.mgmt.cognitiveservices.models.RaiTopic :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 ArcDeployment. The ArcDeployment is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] + :return: RaiTopic. The RaiTopic is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def create_or_update( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: _types.ArcDeploymentUpdate, + rai_topic_name: str, + rai_topic: _types.RaiTopic, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ArcDeployment]: - """Updates the specified Arc deployment associated with the Cognitive Services account. + ) -> _models.RaiTopic: + """Create the rai topic associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param properties: The Arc deployment update properties. Required. - :type properties: ~azure.mgmt.cognitiveservices.types.ArcDeploymentUpdate + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services + Account. Required. + :type rai_topic_name: str + :param rai_topic: Properties describing the rai topic. Required. + :type rai_topic: ~azure.mgmt.cognitiveservices.types.RaiTopic :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 ArcDeployment. The ArcDeployment is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] + :return: RaiTopic. The RaiTopic is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def create_or_update( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: IO[bytes], + rai_topic_name: str, + rai_topic: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ArcDeployment]: - """Updates the specified Arc deployment associated with the Cognitive Services account. + ) -> _models.RaiTopic: + """Create the rai topic associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param properties: The Arc deployment update properties. Required. - :type properties: IO[bytes] + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services + Account. Required. + :type rai_topic_name: str + :param rai_topic: Properties describing the rai topic. Required. + :type rai_topic: 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 ArcDeployment. The ArcDeployment is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] + :return: RaiTopic. The RaiTopic is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_update( + def create_or_update( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: Union[_models.ArcDeploymentUpdate, _types.ArcDeploymentUpdate, IO[bytes]], + rai_topic_name: str, + rai_topic: Union[_models.RaiTopic, _types.RaiTopic, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ArcDeployment]: - """Updates the specified Arc deployment associated with the Cognitive Services account. + ) -> _models.RaiTopic: + """Create the rai topic associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str - :param properties: The Arc deployment update properties. Is either a ArcDeploymentUpdate type - or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.ArcDeploymentUpdate or - ~azure.mgmt.cognitiveservices.types.ArcDeploymentUpdate or IO[bytes] - :return: An instance of LROPoller that returns ArcDeployment. The ArcDeployment is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ArcDeployment] + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services + Account. Required. + :type rai_topic_name: str + :param rai_topic: Properties describing the rai topic. Is either a RaiTopic type or a IO[bytes] + type. Required. + :type rai_topic: ~azure.mgmt.cognitiveservices.models.RaiTopic or + ~azure.mgmt.cognitiveservices.types.RaiTopic or IO[bytes] + :return: RaiTopic. The RaiTopic is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiTopic :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.ArcDeployment] = 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._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - properties=properties, - 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) + cls: ClsType[_models.RaiTopic] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.ArcDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(rai_topic, (IOBase, bytes)): + _content = rai_topic + else: + _content = json.dumps(rai_topic, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_rai_topics_create_or_update_request( + resource_group_name=resource_group_name, + account_name=account_name, + rai_topic_name=rai_topic_name, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _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, 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.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.ArcDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ArcDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.RaiTopic, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) def _delete_initial( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -20914,10 +12887,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_arc_deployments_delete_request( + _request = build_rai_topics_delete_request( resource_group_name=resource_group_name, account_name=account_name, - deployment_name=deployment_name, + rai_topic_name=rai_topic_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -20950,10 +12923,8 @@ def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -20963,33 +12934,19 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - ] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) def begin_delete( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, rai_topic_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes the specified Arc deployment associated with the Cognitive Services account. + """Deletes the specified custom topic associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the Arc deployment associated with the Cognitive Services - Account. The name must be unique within the account across deployments, - managedComputeDeployments, and arcDeployments. Required. - :type deployment_name: str + :param rai_topic_name: The name of the Rai Topic associated with the Cognitive Services + Account. Required. + :type rai_topic_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -21005,7 +12962,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - deployment_name=deployment_name, + rai_topic_name=rai_topic_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -21040,29 +12997,22 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-07-15-preview", - params_added_on={ - "2026-07-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=["2026-07-15-preview", "2026-09-15-preview"], - ) - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.ArcDeployment"]: - """Gets the Arc deployments associated with the Cognitive Services account. + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.RaiTopic"]: + """Gets the custom topics associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :return: An iterator like instance of ArcDeployment - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.ArcDeployment] + :return: An iterator like instance of RaiTopic + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiTopic] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ArcDeployment]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RaiTopic]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -21075,7 +13025,7 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - _request = build_arc_deployments_list_request( + _request = build_rai_topics_list_request( resource_group_name=resource_group_name, account_name=account_name, subscription_id=self._config.subscription_id, @@ -21118,7 +13068,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ArcDeployment], + List[_models.RaiTopic], deserialized.get("value", []), ) if cls: @@ -21147,14 +13097,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class AgentApplicationsOperations: # pylint: disable=docstring-missing-param +class RaiToolLabelsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`agent_applications` attribute. + :attr:`rai_tool_labels` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -21168,23 +13118,19 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get( - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any - ) -> _models.AgentApplication: - """Gets an Agent Application by name. - - Gets an Agent Application by name. + self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any + ) -> _models.RaiToolLabel: + """Gets the specified RAI Tool Label associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :return: AgentApplication. The AgentApplication is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.AgentApplication + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str + :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -21198,13 +13144,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AgentApplication] = kwargs.pop("cls", None) + cls: ClsType[_models.RaiToolLabel] = kwargs.pop("cls", None) - _request = build_agent_applications_get_request( + _request = build_rai_tool_labels_get_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, - name=name, + rai_tool_connection_name=rai_tool_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -21239,293 +13184,199 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentApplication, response.json()) + deserialized = _deserialize(_models.RaiToolLabel, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - project_name: str, - name: str, - body: Union[_models.AgentApplication, _types.AgentApplication, 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_agent_applications_create_or_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["x-ms-async-operation-timeout"] = self._deserialize( - "str", response.headers.get("x-ms-async-operation-timeout") - ) - - 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_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - name: str, - body: _models.AgentApplication, + rai_tool_connection_name: str, + rai_tool_label: _models.RaiToolLabel, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.AgentApplication]: - """Creates or updates an Agent Application (asynchronous). - - Creates or updates an Agent Application (asynchronous). + ) -> _models.RaiToolLabel: + """Creates the RAI Tool Label associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :param body: Agent Application definition object. Required. - :type body: ~azure.mgmt.cognitiveservices.models.AgentApplication + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str + :param rai_tool_label: Properties describing the RAI Tool Label. Required. + :type rai_tool_label: ~azure.mgmt.cognitiveservices.models.RaiToolLabel :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 AgentApplication. The AgentApplication is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] + :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - name: str, - body: _types.AgentApplication, + rai_tool_connection_name: str, + rai_tool_label: _types.RaiToolLabel, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.AgentApplication]: - """Creates or updates an Agent Application (asynchronous). - - Creates or updates an Agent Application (asynchronous). + ) -> _models.RaiToolLabel: + """Creates the RAI Tool Label associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :param body: Agent Application definition object. Required. - :type body: ~azure.mgmt.cognitiveservices.types.AgentApplication + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str + :param rai_tool_label: Properties describing the RAI Tool Label. Required. + :type rai_tool_label: ~azure.mgmt.cognitiveservices.types.RaiToolLabel :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 AgentApplication. The AgentApplication is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] + :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - name: str, - body: IO[bytes], + rai_tool_connection_name: str, + rai_tool_label: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.AgentApplication]: - """Creates or updates an Agent Application (asynchronous). - - Creates or updates an Agent Application (asynchronous). + ) -> _models.RaiToolLabel: + """Creates the RAI Tool Label associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :param body: Agent Application definition object. Required. - :type body: IO[bytes] + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str + :param rai_tool_label: Properties describing the RAI Tool Label. Required. + :type rai_tool_label: 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 AgentApplication. The AgentApplication is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] + :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - project_name: str, - name: str, - body: Union[_models.AgentApplication, _types.AgentApplication, IO[bytes]], + rai_tool_connection_name: str, + rai_tool_label: Union[_models.RaiToolLabel, _types.RaiToolLabel, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.AgentApplication]: - """Creates or updates an Agent Application (asynchronous). - - Creates or updates an Agent Application (asynchronous). + ) -> _models.RaiToolLabel: + """Creates the RAI Tool Label associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :param body: Agent Application definition object. Is either a AgentApplication type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.cognitiveservices.models.AgentApplication or - ~azure.mgmt.cognitiveservices.types.AgentApplication or IO[bytes] - :return: An instance of LROPoller that returns AgentApplication. The AgentApplication is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str + :param rai_tool_label: Properties describing the RAI Tool Label. Is either a RaiToolLabel type + or a IO[bytes] type. Required. + :type rai_tool_label: ~azure.mgmt.cognitiveservices.models.RaiToolLabel or + ~azure.mgmt.cognitiveservices.types.RaiToolLabel or IO[bytes] + :return: RaiToolLabel. The RaiToolLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiToolLabel :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.AgentApplication] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - 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) + cls: ClsType[_models.RaiToolLabel] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.AgentApplication, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(rai_tool_label, (IOBase, bytes)): + _content = rai_tool_label + else: + _content = json.dumps(rai_tool_label, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_rai_tool_labels_create_or_update_request( + resource_group_name=resource_group_name, + account_name=account_name, + rai_tool_connection_name=rai_tool_connection_name, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _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, 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.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.AgentApplication].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AgentApplication]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.RaiToolLabel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore def _delete_initial( - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -21540,11 +13391,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_agent_applications_delete_request( + _request = build_rai_tool_labels_delete_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, - name=name, + rai_tool_connection_name=rai_tool_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -21589,21 +13439,17 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any + self, resource_group_name: str, account_name: str, rai_tool_connection_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete Agent Application. - - Delete Agent Application. + """Deletes the specified RAI Tool Label associated with the Azure OpenAI account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str + :param rai_tool_connection_name: The name of the Rai Tool Label. Required. + :type rai_tool_connection_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -21619,8 +13465,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, - name=name, + rai_tool_connection_name=rai_tool_connection_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -21633,77 +13478,230 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) # type: ignore - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.RaiToolLabel"]: + """Lists all RAI Tool Labels associated with the Azure OpenAI account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: An iterator like instance of RaiToolLabel + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiToolLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RaiToolLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_rai_tool_labels_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RaiToolLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RaiContentFiltersOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`rai_content_filters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, filter_name: str, **kwargs: Any) -> _models.RaiContentFilter: + """Get Content Filters by Name. + + :param location: The name of the Azure region. Required. + :type location: str + :param filter_name: The name of the RAI Content Filter. Required. + :type filter_name: str + :return: RaiContentFilter. The RaiContentFilter is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.RaiContentFilter + :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.RaiContentFilter] = kwargs.pop("cls", None) + + _request = build_rai_content_filters_get_request( + location=location, + filter_name=filter_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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 polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + 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.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + deserialized = _deserialize(_models.RaiContentFilter, response.json()) - @distributed_trace - def list( - self, - resource_group_name: str, - account_name: str, - project_name: str, - *, - count: int = 30, - skip: Optional[int] = None, - skip_token: Optional[str] = None, - names: Optional[List[str]] = None, - search_text: Optional[str] = None, - order_by: Optional[str] = None, - order_by_asc: bool = False, - **kwargs: Any - ) -> ItemPaged["_models.AgentApplication"]: - """Lists Agent Applications in the project. + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - Lists Agent Applications in the project. + return deserialized # type: ignore - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :keyword count: Number of agent applications to be retrieved in a page of results. Default - value is 30. - :paramtype count: int - :keyword skip: Number of agent applications to skip. Default value is None. - :paramtype skip: int - :keyword skip_token: Continuation token for pagination. Default value is None. - :paramtype skip_token: str - :keyword names: Names of agent applications to retrieve. Default value is None. - :paramtype names: list[str] - :keyword search_text: Search text for filtering agent applications. Default value is None. - :paramtype search_text: str - :keyword order_by: Field to order by. Default value is None. - :paramtype order_by: str - :keyword order_by_asc: Whether to order in ascending order. Default value is False. - :paramtype order_by_asc: bool - :return: An iterator like instance of AgentApplication - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.AgentApplication] + @distributed_trace + def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.RaiContentFilter"]: + """List Content Filters types. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of RaiContentFilter + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.RaiContentFilter] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.AgentApplication]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RaiContentFilter]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -21716,18 +13714,9 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_agent_applications_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, + _request = build_rai_content_filters_list_request( + location=location, subscription_id=self._config.subscription_id, - count=count, - skip=skip, - skip_token=skip_token, - names=names, - search_text=search_text, - order_by=order_by, - order_by_asc=order_by_asc, api_version=self._config.api_version, headers=_headers, params=_params, @@ -21767,7 +13756,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.AgentApplication], + List[_models.RaiContentFilter], deserialized.get("value", []), ) if cls: @@ -21795,26 +13784,42 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @distributed_trace - def list_agents( - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any - ) -> _models.AgentReferenceResourceArmPaginatedResult: - """Lists agents for an Agent Application. - Lists agents for an Agent Application. +class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=docstring-missing-param,name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`network_security_perimeter_configurations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any + ) -> _models.NetworkSecurityPerimeterConfiguration: + """Gets the specified NSP configurations for an account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :return: AgentReferenceResourceArmPaginatedResult. The AgentReferenceResourceArmPaginatedResult - is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult + :param nsp_configuration_name: The name of the NSP Configuration. Required. + :type nsp_configuration_name: str + :return: NetworkSecurityPerimeterConfiguration. The NetworkSecurityPerimeterConfiguration is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -21828,13 +13833,12 @@ def list_agents( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AgentReferenceResourceArmPaginatedResult] = kwargs.pop("cls", None) + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) - _request = build_agent_applications_list_agents_request( + _request = build_network_security_perimeter_configurations_get_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, - name=name, + nsp_configuration_name=nsp_configuration_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -21869,7 +13873,7 @@ def list_agents( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AgentReferenceResourceArmPaginatedResult, response.json()) + deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -21877,26 +13881,111 @@ def list_agents( return deserialized # type: ignore @distributed_trace - def enable( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any - ) -> None: - """Enables an Agent Application. + def list( + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> ItemPaged["_models.NetworkSecurityPerimeterConfiguration"]: + """Gets a list of NSP configurations for an account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: An iterator like instance of NetworkSecurityPerimeterConfiguration + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkSecurityPerimeterConfiguration]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_perimeter_configurations_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkSecurityPerimeterConfiguration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - Enables an Agent Application. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ + return ItemPaged(get_next, extract_data) + + def _reconcile_initial( + self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -21908,13 +13997,12 @@ def enable( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_agent_applications_enable_request( + _request = build_network_security_perimeter_configurations_reconcile_request( resource_group_name=resource_group_name, account_name=account_name, - project_name=project_name, - name=name, + nsp_configuration_name=nsp_configuration_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -21925,14 +14013,19 @@ def enable( # pylint: disable=inconsistent-return-statements } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _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 [200]: + if response.status_code not in [200, 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.ErrorResponse, @@ -21940,85 +14033,96 @@ def enable( # pylint: disable=inconsistent-return-statements ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore - @distributed_trace - def disable( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any - ) -> None: - """Disables an Agent Application. + return deserialized # type: ignore - Disables an Agent Application. + @distributed_trace + def begin_reconcile( + self, resource_group_name: str, account_name: str, nsp_configuration_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkSecurityPerimeterConfiguration]: + """Reconcile the NSP configuration for an account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param name: Name for the Agent Application. Required. - :type name: str - :return: None - :rtype: None + :param nsp_configuration_name: The name of the NSP Configuration. Required. + :type nsp_configuration_name: str + :return: An instance of LROPoller that returns NetworkSecurityPerimeterConfiguration. The + NetworkSecurityPerimeterConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.NetworkSecurityPerimeterConfiguration] :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[None] = kwargs.pop("cls", None) + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = 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._reconcile_initial( + resource_group_name=resource_group_name, + account_name=account_name, + nsp_configuration_name=nsp_configuration_name, + 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 = pipeline_response.http_response + deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_agent_applications_disable_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkSecurityPerimeterConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkSecurityPerimeterConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) -class ManagedComputeDeploymentsOperations: # pylint: disable=docstring-missing-param +class DefenderForAISettingsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`managed_compute_deployments` attribute. + :attr:`defender_for_ai_settings` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -22031,36 +14135,20 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) def get( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> _models.ManagedComputeDeployment: - """Gets the specified managed compute deployment associated with the Cognitive Services account. + self, resource_group_name: str, account_name: str, defender_for_ai_setting_name: str, **kwargs: Any + ) -> _models.DefenderForAISetting: + """Gets the specified Defender for AI setting by name. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :return: ManagedComputeDeployment. The ManagedComputeDeployment is compatible with - MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -22074,105 +14162,14 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.ManagedComputeDeployment] = kwargs.pop("cls", None) - - _request = build_managed_compute_deployments_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ManagedComputeDeployment, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - resource: Union[_models.ManagedComputeDeployment, _types.ManagedComputeDeployment, 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(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) - _request = build_managed_compute_deployments_create_or_update_request( + _request = build_defender_for_ai_settings_get_request( resource_group_name=resource_group_name, account_name=account_name, - deployment_name=deployment_name, + defender_for_ai_setting_name=defender_for_ai_setting_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -22182,18 +14179,19 @@ def _create_or_update_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -22201,239 +14199,132 @@ def _create_or_update_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DefenderForAISetting, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - def begin_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - deployment_name: str, - resource: _models.ManagedComputeDeployment, + defender_for_ai_setting_name: str, + defender_for_ai_settings: _models.DefenderForAISetting, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ManagedComputeDeployment]: - """Creates or updates a managed compute deployment associated with the Cognitive Services account. + ) -> _models.DefenderForAISetting: + """Creates or Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param resource: The managed compute deployment properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - deployment_name: str, - resource: _types.ManagedComputeDeployment, + defender_for_ai_setting_name: str, + defender_for_ai_settings: _types.DefenderForAISetting, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ManagedComputeDeployment]: - """Creates or updates a managed compute deployment associated with the Cognitive Services account. + ) -> _models.DefenderForAISetting: + """Creates or Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param resource: The managed compute deployment properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.ManagedComputeDeployment + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.types.DefenderForAISetting :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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - deployment_name: str, - resource: IO[bytes], + defender_for_ai_setting_name: str, + defender_for_ai_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ManagedComputeDeployment]: - """Creates or updates a managed compute deployment associated with the Cognitive Services account. + ) -> _models.DefenderForAISetting: + """Creates or Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param resource: The managed compute deployment properties. Required. - :type resource: IO[bytes] + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: 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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_create_or_update( + def create_or_update( self, resource_group_name: str, account_name: str, - deployment_name: str, - resource: Union[_models.ManagedComputeDeployment, _types.ManagedComputeDeployment, IO[bytes]], + defender_for_ai_setting_name: str, + defender_for_ai_settings: Union[_models.DefenderForAISetting, _types.DefenderForAISetting, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ManagedComputeDeployment]: - """Creates or updates a managed compute deployment associated with the Cognitive Services account. + ) -> _models.DefenderForAISetting: + """Creates or Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param resource: The managed compute deployment properties. Is either a - ManagedComputeDeployment type or a IO[bytes] type. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment or - ~azure.mgmt.cognitiveservices.types.ManagedComputeDeployment or IO[bytes] - :return: An instance of LROPoller that returns ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Is either a + DefenderForAISetting type or a IO[bytes] type. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting or + ~azure.mgmt.cognitiveservices.types.DefenderForAISetting or IO[bytes] + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :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.ManagedComputeDeployment] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - resource=resource, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.ManagedComputeDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.ManagedComputeDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedComputeDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _update_initial( - self, - resource_group_name: str, - account_name: str, - deployment_name: str, - properties: Union[_models.PatchResourceSku, _types.PatchResourceSku, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -22446,19 +14337,19 @@ def _update_initial( _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) + cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(defender_for_ai_settings, (IOBase, bytes)): + _content = defender_for_ai_settings else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(defender_for_ai_settings, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_managed_compute_deployments_update_request( + _request = build_defender_for_ai_settings_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, - deployment_name=deployment_name, + defender_for_ai_setting_name=defender_for_ai_setting_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -22472,18 +14363,19 @@ def _update_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 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.ErrorResponse, @@ -22491,237 +14383,132 @@ def _update_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DefenderForAISetting, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - def begin_update( + def update( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: _models.PatchResourceSku, + defender_for_ai_setting_name: str, + defender_for_ai_settings: _models.DefenderForAISetting, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ManagedComputeDeployment]: - """Updates the specified managed compute deployment associated with the Cognitive Services - account. + ) -> _models.DefenderForAISetting: + """Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param properties: The managed compute deployment patch properties. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.PatchResourceSku + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def update( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: _types.PatchResourceSku, + defender_for_ai_setting_name: str, + defender_for_ai_settings: _types.DefenderForAISetting, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ManagedComputeDeployment]: - """Updates the specified managed compute deployment associated with the Cognitive Services - account. + ) -> _models.DefenderForAISetting: + """Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param properties: The managed compute deployment patch properties. Required. - :type properties: ~azure.mgmt.cognitiveservices.types.PatchResourceSku + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.types.DefenderForAISetting :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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def update( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: IO[bytes], + defender_for_ai_setting_name: str, + defender_for_ai_settings: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ManagedComputeDeployment]: - """Updates the specified managed compute deployment associated with the Cognitive Services - account. + ) -> _models.DefenderForAISetting: + """Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param properties: The managed compute deployment patch properties. Required. - :type properties: IO[bytes] + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Required. + :type defender_for_ai_settings: 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 ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_update( + def update( self, resource_group_name: str, account_name: str, - deployment_name: str, - properties: Union[_models.PatchResourceSku, _types.PatchResourceSku, IO[bytes]], + defender_for_ai_setting_name: str, + defender_for_ai_settings: Union[_models.DefenderForAISetting, _types.DefenderForAISetting, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ManagedComputeDeployment]: - """Updates the specified managed compute deployment associated with the Cognitive Services - account. + ) -> _models.DefenderForAISetting: + """Updates the specified Defender for AI setting. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :param properties: The managed compute deployment patch properties. Is either a - PatchResourceSku type or a IO[bytes] type. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.PatchResourceSku or - ~azure.mgmt.cognitiveservices.types.PatchResourceSku or IO[bytes] - :return: An instance of LROPoller that returns ManagedComputeDeployment. The - ManagedComputeDeployment is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] + :param defender_for_ai_setting_name: The name of the defender for AI setting. Required. + :type defender_for_ai_setting_name: str + :param defender_for_ai_settings: Properties describing the Defender for AI setting. Is either a + DefenderForAISetting type or a IO[bytes] type. Required. + :type defender_for_ai_settings: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting or + ~azure.mgmt.cognitiveservices.types.DefenderForAISetting or IO[bytes] + :return: DefenderForAISetting. The DefenderForAISetting is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.DefenderForAISetting :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.ManagedComputeDeployment] = 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._update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - properties=properties, - 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 = pipeline_response.http_response - deserialized = _deserialize(_models.ManagedComputeDeployment, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.ManagedComputeDeployment].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedComputeDeployment]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _delete_initial( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -22730,17 +14517,27 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DefenderForAISetting] = kwargs.pop("cls", None) - _request = build_managed_compute_deployments_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(defender_for_ai_settings, (IOBase, bytes)): + _content = defender_for_ai_settings + else: + _content = json.dumps(defender_for_ai_settings, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_defender_for_ai_settings_update_request( resource_group_name=resource_group_name, account_name=account_name, - deployment_name=deployment_name, + defender_for_ai_setting_name=defender_for_ai_setting_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -22750,18 +14547,19 @@ def _delete_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -22769,125 +14567,35 @@ def _delete_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DefenderForAISetting, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "deployment_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_delete( - self, resource_group_name: str, account_name: str, deployment_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified managed compute deployment associated with the Cognitive Services - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param deployment_name: The name of the managed compute deployment associated with the - Cognitive Services Account. Required. - :type deployment_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - deployment_name=deployment_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) def list( self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedComputeDeployment"]: - """Gets the managed compute deployments associated with the Cognitive Services account. + ) -> ItemPaged["_models.DefenderForAISetting"]: + """Lists the Defender for AI settings. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :return: An iterator like instance of ManagedComputeDeployment - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.ManagedComputeDeployment] + :return: An iterator like instance of DefenderForAISetting + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.DefenderForAISetting] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ManagedComputeDeployment]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.DefenderForAISetting]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -22900,7 +14608,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_managed_compute_deployments_list_request( + _request = build_defender_for_ai_settings_list_request( resource_group_name=resource_group_name, account_name=account_name, subscription_id=self._config.subscription_id, @@ -22943,7 +14651,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ManagedComputeDeployment], + List[_models.DefenderForAISetting], deserialized.get("value", []), ) if cls: @@ -22972,14 +14680,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class AdapterDeploymentsOperations: # pylint: disable=docstring-missing-param +class ProjectsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`adapter_deployments` attribute. + :attr:`projects` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -22989,38 +14697,21 @@ def __init__(self, *args, **kwargs) -> None: input_args.pop(0) if input_args else kwargs.pop("config") ) self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "adapter_deployment_name", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def get( - self, resource_group_name: str, account_name: str, adapter_deployment_name: str, **kwargs: Any - ) -> _models.AdapterDeployment: - """Gets an adapter deployment by name. + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any) -> _models.Project: + """Returns a Cognitive Services project specified by the parameters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :return: AdapterDeployment. The AdapterDeployment is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.AdapterDeployment + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :return: Project. The Project is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.Project :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -23034,12 +14725,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.AdapterDeployment] = kwargs.pop("cls", None) + cls: ClsType[_models.Project] = kwargs.pop("cls", None) - _request = build_adapter_deployments_get_request( + _request = build_projects_get_request( resource_group_name=resource_group_name, account_name=account_name, - adapter_deployment_name=adapter_deployment_name, + project_name=project_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -23071,45 +14762,282 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.AdapterDeployment, response.json()) + deserialized = _deserialize(_models.Project, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: Union[_models.Project, _types.Project, 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(project, (IOBase, bytes)): + _content = project + else: + _content = json.dumps(project, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_projects_create_request( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "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 [200, 201, 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.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("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 + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: _models.Project, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Project]: + """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give + AI developer it's individual container to work on. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: ~azure.mgmt.cognitiveservices.models.Project + :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 Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: _types.Project, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Project]: + """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give + AI developer it's individual container to work on. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: ~azure.mgmt.cognitiveservices.types.Project + :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 Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Project]: + """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give + AI developer it's individual container to work on. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: 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 Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + account_name: str, + project_name: str, + project: Union[_models.Project, _types.Project, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Project]: + """Create Cognitive Services Account's Project. Project is a sub-resource of an account which give + AI developer it's individual container to work on. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Is either a Project type or + a IO[bytes] type. Required. + :type project: ~azure.mgmt.cognitiveservices.models.Project or + ~azure.mgmt.cognitiveservices.types.Project or IO[bytes] + :return: An instance of LROPoller that returns Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] + :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.Project] = 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._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + project=project, + 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 = pipeline_response.http_response + deserialized = _deserialize(_models.Project, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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.Project].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Project]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "adapter_deployment_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def _create_or_update_initial( + def _update_initial( self, resource_group_name: str, account_name: str, - adapter_deployment_name: str, - resource: Union[_models.AdapterDeployment, _types.AdapterDeployment, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + project_name: str, + project: Union[_models.Project, _types.Project, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -23118,12 +15046,6 @@ def _create_or_update_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -23134,18 +15056,16 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(project, (IOBase, bytes)): + _content = project else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(project, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_adapter_deployments_create_or_update_request( + _request = build_projects_update_request( resource_group_name=resource_group_name, account_name=account_name, - adapter_deployment_name=adapter_deployment_name, + project_name=project_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, content_type=content_type, api_version=self._config.api_version, content=_content, @@ -23165,7 +15085,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -23178,12 +15098,8 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -23193,215 +15109,139 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - adapter_deployment_name: str, - resource: _models.AdapterDeployment, + project_name: str, + project: _models.Project, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.AdapterDeployment]: - """Creates an adapter deployment or re-targets it to another compatible managed compute - deployment. The source model ID is immutable. Returns 201 for a new adapter or 200 for an - existing adapter, including retries. Either response may require polling while provisioning is - in progress. After polling completes, retrieve the final resource from the original resource - URL. Omit conditional headers to allow either creation or update. To create only when absent, - send If-None-Match: *. To update only a matching version, send If-Match with the ETag returned - by GET. Conditional requests, including retries, return 412 if the precondition is not met. + ) -> LROPoller[_models.Project]: + """Updates a Cognitive Services Project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :param resource: The complete adapter deployment resource to create or re-target. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.AdapterDeployment + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: ~azure.mgmt.cognitiveservices.models.Project :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns AdapterDeployment. The AdapterDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AdapterDeployment] + :return: An instance of LROPoller that returns Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - adapter_deployment_name: str, - resource: _types.AdapterDeployment, + project_name: str, + project: _types.Project, *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.AdapterDeployment]: - """Creates an adapter deployment or re-targets it to another compatible managed compute - deployment. The source model ID is immutable. Returns 201 for a new adapter or 200 for an - existing adapter, including retries. Either response may require polling while provisioning is - in progress. After polling completes, retrieve the final resource from the original resource - URL. Omit conditional headers to allow either creation or update. To create only when absent, - send If-None-Match: *. To update only a matching version, send If-Match with the ETag returned - by GET. Conditional requests, including retries, return 412 if the precondition is not met. + ) -> LROPoller[_models.Project]: + """Updates a Cognitive Services Project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :param resource: The complete adapter deployment resource to create or re-target. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.AdapterDeployment + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: ~azure.mgmt.cognitiveservices.types.Project :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns AdapterDeployment. The AdapterDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AdapterDeployment] + :return: An instance of LROPoller that returns Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - adapter_deployment_name: str, - resource: IO[bytes], + project_name: str, + project: IO[bytes], *, content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> LROPoller[_models.AdapterDeployment]: - """Creates an adapter deployment or re-targets it to another compatible managed compute - deployment. The source model ID is immutable. Returns 201 for a new adapter or 200 for an - existing adapter, including retries. Either response may require polling while provisioning is - in progress. After polling completes, retrieve the final resource from the original resource - URL. Omit conditional headers to allow either creation or update. To create only when absent, - send If-None-Match: *. To update only a matching version, send If-Match with the ETag returned - by GET. Conditional requests, including retries, return 412 if the precondition is not met. + ) -> LROPoller[_models.Project]: + """Updates a Cognitive Services Project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :param resource: The complete adapter deployment resource to create or re-target. Required. - :type resource: IO[bytes] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Required. + :type project: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns AdapterDeployment. The AdapterDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AdapterDeployment] + :return: An instance of LROPoller that returns Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "adapter_deployment_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def begin_create_or_update( + def begin_update( self, resource_group_name: str, account_name: str, - adapter_deployment_name: str, - resource: Union[_models.AdapterDeployment, _types.AdapterDeployment, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, + project_name: str, + project: Union[_models.Project, _types.Project, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.AdapterDeployment]: - """Creates an adapter deployment or re-targets it to another compatible managed compute - deployment. The source model ID is immutable. Returns 201 for a new adapter or 200 for an - existing adapter, including retries. Either response may require polling while provisioning is - in progress. After polling completes, retrieve the final resource from the original resource - URL. Omit conditional headers to allow either creation or update. To create only when absent, - send If-None-Match: *. To update only a matching version, send If-Match with the ETag returned - by GET. Conditional requests, including retries, return 412 if the precondition is not met. + ) -> LROPoller[_models.Project]: + """Updates a Cognitive Services Project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :param resource: The complete adapter deployment resource to create or re-target. Is either a - AdapterDeployment type or a IO[bytes] type. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.AdapterDeployment or - ~azure.mgmt.cognitiveservices.types.AdapterDeployment or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: An instance of LROPoller that returns AdapterDeployment. The AdapterDeployment is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AdapterDeployment] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param project: The parameters to provide for the created project. Is either a Project type or + a IO[bytes] type. Required. + :type project: ~azure.mgmt.cognitiveservices.models.Project or + ~azure.mgmt.cognitiveservices.types.Project or IO[bytes] + :return: An instance of LROPoller that returns Project. The Project is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Project] :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.AdapterDeployment] = kwargs.pop("cls", None) + cls: ClsType[_models.Project] = 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._create_or_update_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, account_name=account_name, - adapter_deployment_name=adapter_deployment_name, - resource=resource, - etag=etag, - match_condition=match_condition, + project_name=project_name, + project=project, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -23412,18 +15252,10 @@ def begin_create_or_update( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - deserialized = _deserialize(_models.AdapterDeployment, response.json()) + deserialized = _deserialize(_models.Project, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -23439,149 +15271,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.AdapterDeployment].from_continuation_token( + return LROPoller[_models.Project].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.AdapterDeployment]( + return LROPoller[_models.Project]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=["2026-09-15-preview"], - ) - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> ItemPaged["_models.AdapterDeployment"]: - """Lists adapter deployments associated with the Cognitive Services account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of AdapterDeployment - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.AdapterDeployment] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.AdapterDeployment]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_adapter_deployments_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.AdapterDeployment], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "adapter_deployment_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def _delete_initial( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + + def _delete_initial( + self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -23589,12 +15290,6 @@ def _delete_initial( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -23602,13 +15297,11 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_adapter_deployments_delete_request( + _request = build_projects_delete_request( resource_group_name=resource_group_name, account_name=account_name, - adapter_deployment_name=adapter_deployment_name, + project_name=project_name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, api_version=self._config.api_version, headers=_headers, params=_params, @@ -23626,7 +15319,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -23654,46 +15347,18 @@ def _delete_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "adapter_deployment_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) def begin_delete( - self, - resource_group_name: str, - account_name: str, - adapter_deployment_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any ) -> LROPoller[None]: - """Drains requests and deletes an adapter deployment and its serving snapshot. + """Deletes a Cognitive Services project from the resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param adapter_deployment_name: The account-unique adapter deployment name and inference - identity. Required. - :type adapter_deployment_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -23709,9 +15374,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, - adapter_deployment_name=adapter_deployment_name, - etag=etag, - match_condition=match_condition, + project_name=project_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -23745,147 +15408,23 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - -class ComputeOperationsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`compute_operations` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-01-15-preview", - params_added_on={ - "2026-01-15-preview": ["api_version", "subscription_id", "location", "operation_id", "accept"] - }, - api_versions_list=[ - "2026-01-15-preview", - "2026-03-15-preview", - "2026-05-15-preview", - "2026-07-15-preview", - "2026-09-15-preview", - ], - ) - def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.ComputeOperationStatus: - """Gets the status of a compute operation. - - :param location: The name of the Azure region. Required. - :type location: str - :param operation_id: The ID of the compute operation. Required. - :type operation_id: str - :return: ComputeOperationStatus. The ComputeOperationStatus is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.ComputeOperationStatus - :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.ComputeOperationStatus] = kwargs.pop("cls", None) - - _request = build_compute_operations_get_request( - location=location, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.ComputeOperationStatus, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - -class ManagedComputeUsagesOperationGroupOperations: # pylint: disable=docstring-missing-param,name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`managed_compute_usages_operation_group` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={"2026-03-15-preview": ["api_version", "subscription_id", "location", "accept"]}, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.ManagedComputeUsage"]: - """List managed compute quota usages for a subscription and location. + def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.Project"]: + """Returns all the projects in a Cognitive Services account. - :param location: The location name. Required. - :type location: str - :return: An iterator like instance of ManagedComputeUsage - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.ManagedComputeUsage] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :return: An iterator like instance of Project + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Project] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ManagedComputeUsage]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Project]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -23898,8 +15437,9 @@ def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.ManagedComput def prepare_request(next_link=None): if not next_link: - _request = build_managed_compute_usages_operation_group_list_request( - location=location, + _request = build_projects_list_request( + resource_group_name=resource_group_name, + account_name=account_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -23940,7 +15480,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ManagedComputeUsage], + List[_models.Project], deserialized.get("value", []), ) if cls: @@ -23969,14 +15509,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class ComputesOperations: # pylint: disable=docstring-missing-param +class ProjectConnectionsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`computes` attribute. + :attr:`project_connections` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -23989,115 +15529,27 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def get(self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any) -> _models.Compute: - """Gets the specified compute associated with the Cognitive Services account. + def get( + self, resource_group_name: str, account_name: str, project_name: str, connection_name: str, **kwargs: Any + ) -> _models.ConnectionPropertiesV2BasicResource: + """Lists Cognitive Services project connection by name. + + Lists Cognitive Services project connection by name. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :return: Compute. The Compute is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Compute - :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.Compute] = kwargs.pop("cls", None) - - _request = build_computes_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Compute, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - "content_type", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: Union[_models.Compute, _types.Compute, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -24106,27 +15558,18 @@ def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - _request = build_computes_create_or_update_request( + _request = build_project_connections_get_request( resource_group_name=resource_group_name, account_name=account_name, - compute_name=compute_name, + project_name=project_name, + connection_name=connection_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -24136,18 +15579,19 @@ def _create_or_update_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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 [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -24155,232 +15599,161 @@ def _create_or_update_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - def begin_create_or_update( + def create( self, resource_group_name: str, account_name: str, - compute_name: str, - resource: _models.Compute, + project_name: str, + connection_name: str, + connection: Optional[_models.ConnectionPropertiesV2BasicResource] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Compute]: - """Creates or updates a compute associated with the Cognitive Services account. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Create or update Cognitive Services project connection under the specified project. + + Create or update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :param resource: The compute properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.Compute + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: The object for creating or updating a new account connection. Default value + is None. + :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :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 Compute. The Compute is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Compute] + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create( self, resource_group_name: str, account_name: str, - compute_name: str, - resource: _types.Compute, + project_name: str, + connection_name: str, + connection: Optional[_types.ConnectionPropertiesV2BasicResource] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Compute]: - """Creates or updates a compute associated with the Cognitive Services account. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Create or update Cognitive Services project connection under the specified project. + + Create or update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :param resource: The compute properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.Compute + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: The object for creating or updating a new account connection. Default value + is None. + :type connection: ~azure.mgmt.cognitiveservices.types.ConnectionPropertiesV2BasicResource :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 Compute. The Compute is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Compute] + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def create( self, resource_group_name: str, account_name: str, - compute_name: str, - resource: IO[bytes], + project_name: str, + connection_name: str, + connection: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Compute]: - """Creates or updates a compute associated with the Cognitive Services account. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Create or update Cognitive Services project connection under the specified project. + + Create or update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :param resource: The compute properties. Required. - :type resource: IO[bytes] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: The object for creating or updating a new account connection. Default value + is None. + :type connection: 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 Compute. The Compute is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Compute] + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - "content_type", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_create_or_update( + def create( self, resource_group_name: str, account_name: str, - compute_name: str, - resource: Union[_models.Compute, _types.Compute, IO[bytes]], + project_name: str, + connection_name: str, + connection: Optional[ + Union[_models.ConnectionPropertiesV2BasicResource, _types.ConnectionPropertiesV2BasicResource, IO[bytes]] + ] = None, **kwargs: Any - ) -> LROPoller[_models.Compute]: - """Creates or updates a compute associated with the Cognitive Services account. + ) -> _models.ConnectionPropertiesV2BasicResource: + """Create or update Cognitive Services project connection under the specified project. + + Create or update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :param resource: The compute properties. Is either a Compute type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.cognitiveservices.models.Compute or - ~azure.mgmt.cognitiveservices.types.Compute or IO[bytes] - :return: An instance of LROPoller that returns Compute. The Compute is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Compute] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: The object for creating or updating a new account connection. Is either a + ConnectionPropertiesV2BasicResource type or a IO[bytes] type. Default value is None. + :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource or + ~azure.mgmt.cognitiveservices.types.ConnectionPropertiesV2BasicResource or IO[bytes] + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :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.Compute] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - resource=resource, - 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["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = _deserialize(_models.Compute, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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.Compute].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Compute]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _delete_initial( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -24389,17 +15762,32 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if connection else None + cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if connection else None + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + if connection is not None: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None - _request = build_computes_delete_request( + _request = build_project_connections_create_request( resource_group_name=resource_group_name, account_name=account_name, - compute_name=compute_name, + project_name=project_name, + connection_name=connection_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -24409,18 +15797,19 @@ def _delete_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -24428,217 +15817,156 @@ def _delete_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_delete( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified compute associated with the Cognitive Services account. + @overload + def update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + connection_name: str, + connection: Optional[_models.ConnectionUpdateContent] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectionPropertiesV2BasicResource: + """Update Cognitive Services project connection under the specified project. + + Update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: Parameters for account connection update. Default value is None. + :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionUpdateContent + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + @overload + def update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + connection_name: str, + connection: Optional[_types.ConnectionUpdateContent] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectionPropertiesV2BasicResource: + """Update Cognitive Services project connection under the specified project. - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.Compute"]: - """Gets the computes associated with the Cognitive Services account. + Update Cognitive Services project connection under the specified project. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :return: An iterator like instance of Compute - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Compute] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: Parameters for account connection update. Default value is None. + :type connection: ~azure.mgmt.cognitiveservices.types.ConnectionUpdateContent + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Compute]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_computes_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", - urllib.parse.urljoin(next_link, _parsed_next_link.path), - headers=_headers, - params=_next_request_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Compute], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - def get_next(next_link=None): - _request = prepare_request(next_link) + @overload + def update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + connection_name: str, + connection: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectionPropertiesV2BasicResource: + """Update Cognitive Services project connection under the specified project. - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + Update Cognitive Services project connection under the specified project. - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: Parameters for account connection update. Default value is None. + :type connection: 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: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :raises ~azure.core.exceptions.HttpResponseError: + """ - return pipeline_response + @distributed_trace + def update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + connection_name: str, + connection: Optional[Union[_models.ConnectionUpdateContent, _types.ConnectionUpdateContent, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.ConnectionPropertiesV2BasicResource: + """Update Cognitive Services project connection under the specified project. - return ItemPaged(get_next, extract_data) + Update Cognitive Services project connection under the specified project. - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _start_initial( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> Iterator[bytes]: + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :param connection: Parameters for account connection update. Is either a + ConnectionUpdateContent type or a IO[bytes] type. Default value is None. + :type connection: ~azure.mgmt.cognitiveservices.models.ConnectionUpdateContent or + ~azure.mgmt.cognitiveservices.types.ConnectionUpdateContent or IO[bytes] + :return: ConnectionPropertiesV2BasicResource. The ConnectionPropertiesV2BasicResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -24647,17 +15975,32 @@ def _start_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if connection else None + cls: ClsType[_models.ConnectionPropertiesV2BasicResource] = kwargs.pop("cls", None) - _request = build_computes_start_request( + content_type = content_type or "application/json" if connection else None + _content = None + if isinstance(connection, (IOBase, bytes)): + _content = connection + else: + if connection is not None: + _content = json.dumps(connection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_project_connections_update_request( resource_group_name=resource_group_name, account_name=account_name, - compute_name=compute_name, + project_name=project_name, + connection_name=connection_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -24667,18 +16010,19 @@ def _start_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -24686,111 +16030,37 @@ def _start_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ConnectionPropertiesV2BasicResource, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_start( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Starts a stopped ContainerInstance compute resource. This is a long-running operation that - returns 202 Accepted. Only applicable when computeType is ContainerInstance. + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, account_name: str, project_name: str, connection_name: str, **kwargs: Any + ) -> None: + """Delete Cognitive Services project connection by name. + + Delete Cognitive Services project connection by name. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param connection_name: Friendly name of the connection. Required. + :type connection_name: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._start_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _stop_initial( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -24802,12 +16072,13 @@ def _stop_initial( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_computes_stop_request( + _request = build_project_connections_delete_request( resource_group_name=resource_group_name, account_name=account_name, - compute_name=compute_name, + project_name=project_name, + connection_name=connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -24818,131 +16089,192 @@ def _stop_initial( } _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 - ) + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list( + self, + resource_group_name: str, + account_name: str, + project_name: str, + *, + target: Optional[str] = None, + category: Optional[str] = None, + include_all: bool = False, + **kwargs: Any + ) -> ItemPaged["_models.ConnectionPropertiesV2BasicResource"]: + """Lists all the available Cognitive Services project connections under the specified project. + + Lists all the available Cognitive Services project connections under the specified project. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :keyword target: Target of the connection. Default value is None. + :paramtype target: str + :keyword category: Category of the connection. Default value is None. + :paramtype category: str + :keyword include_all: query parameter that indicates if get connection call should return both + connections and datastores. Default value is False. + :paramtype include_all: bool + :return: An iterator like instance of ConnectionPropertiesV2BasicResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.ConnectionPropertiesV2BasicResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ConnectionPropertiesV2BasicResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_project_connections_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + subscription_id=self._config.subscription_id, + target=target, + category=category, + include_all=include_all, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ConnectionPropertiesV2BasicResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [202, 204]: - 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.ErrorResponse, - response, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response = pipeline_response.http_response - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + return pipeline_response - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return ItemPaged(get_next, extract_data) - return deserialized # type: ignore + +class ProjectCapabilityHostsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`project_capability_hosts` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_stop( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Stops a running ContainerInstance compute resource. This is a long-running operation that - returns 202 Accepted. Only applicable when computeType is ContainerInstance. + def get( + self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any + ) -> _models.ProjectCapabilityHost: + """Get project capabilityHost. + + Get project capabilityHost. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :return: ProjectCapabilityHost. The ProjectCapabilityHost is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._stop_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _restart_initial( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -24954,12 +16286,13 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.ProjectCapabilityHost] = kwargs.pop("cls", None) - _request = build_computes_restart_request( + _request = build_project_capability_hosts_get_request( resource_group_name=resource_group_name, account_name=account_name, - compute_name=compute_name, + project_name=project_name, + capability_host_name=capability_host_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -24971,18 +16304,19 @@ def _restart_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -24990,149 +16324,25 @@ def _restart_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("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 - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_restart( - self, resource_group_name: str, account_name: str, compute_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Restarts a running ContainerInstance compute resource. This is a long-running operation that - returns 202 Accepted. Only applicable when computeType is ContainerInstance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param compute_name: The name of the compute associated with the Cognitive Services Account. - Required. - :type compute_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._restart_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class WorkbenchesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`workbenches` attribute. - """ + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ProjectCapabilityHost, response.json()) - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def get( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any - ) -> _models.Workbench: - """Gets the specified workbench associated with the project. + return deserialized # type: ignore - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :return: Workbench. The Workbench is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Workbench - :raises ~azure.core.exceptions.HttpResponseError: - """ + def _create_or_update_initial( + self, + resource_group_name: str, + account_name: str, + project_name: str, + capability_host_name: str, + capability_host: Union[_models.ProjectCapabilityHost, _types.ProjectCapabilityHost, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -25141,18 +16351,28 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Workbench] = kwargs.pop("cls", None) + 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(capability_host, (IOBase, bytes)): + _content = capability_host + else: + _content = json.dumps(capability_host, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_workbenches_get_request( + _request = build_project_capability_hosts_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + capability_host_name=capability_host_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -25162,60 +16382,245 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _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 [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 201]: + 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.ErrorResponse, response, ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["x-ms-async-operation-timeout"] = self._deserialize( + "str", response.headers.get("x-ms-async-operation-timeout") + ) + + 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_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + capability_host_name: str, + capability_host: _models.ProjectCapabilityHost, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ProjectCapabilityHost]: + """Create or update project capabilityHost. + + Create or update project capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :param capability_host: CapabilityHost definition. Required. + :type capability_host: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost + :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 ProjectCapabilityHost. The ProjectCapabilityHost + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + capability_host_name: str, + capability_host: _types.ProjectCapabilityHost, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ProjectCapabilityHost]: + """Create or update project capabilityHost. + + Create or update project capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :param capability_host: CapabilityHost definition. Required. + :type capability_host: ~azure.mgmt.cognitiveservices.types.ProjectCapabilityHost + :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 ProjectCapabilityHost. The ProjectCapabilityHost + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + capability_host_name: str, + capability_host: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ProjectCapabilityHost]: + """Create or update project capabilityHost. + + Create or update project capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :param capability_host: CapabilityHost definition. Required. + :type capability_host: 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 ProjectCapabilityHost. The ProjectCapabilityHost + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + capability_host_name: str, + capability_host: Union[_models.ProjectCapabilityHost, _types.ProjectCapabilityHost, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ProjectCapabilityHost]: + """Create or update project capabilityHost. + + Create or update project capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :param capability_host: CapabilityHost definition. Is either a ProjectCapabilityHost type or a + IO[bytes] type. Required. + :type capability_host: ~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost or + ~azure.mgmt.cognitiveservices.types.ProjectCapabilityHost or IO[bytes] + :return: An instance of LROPoller that returns ProjectCapabilityHost. The ProjectCapabilityHost + is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] + :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.ProjectCapabilityHost] = 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._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + capability_host_name=capability_host_name, + capability_host=capability_host, + 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) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Workbench, response.json()) + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ProjectCapabilityHost, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return deserialized # type: ignore + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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.ProjectCapabilityHost].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ProjectCapabilityHost]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def _create_or_update_initial( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: Union[_models.Workbench, _types.Workbench, IO[bytes]], - **kwargs: Any + def _delete_initial( + self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -25225,28 +16630,18 @@ def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_workbenches_create_or_update_request( + _request = build_project_capability_hosts_delete_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + capability_host_name=capability_host_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -25263,7 +16658,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -25276,11 +16671,11 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["x-ms-async-operation-timeout"] = self._deserialize( + "str", response.headers.get("x-ms-async-operation-timeout") + ) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -25289,19 +16684,13 @@ def _create_or_update_initial( return deserialized # type: ignore - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: _models.Workbench, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Workbench]: - """Creates or updates a workbench associated with the project. + @distributed_trace + def begin_delete( + self, resource_group_name: str, account_name: str, project_name: str, capability_host_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete project capabilityHost. + + Delete project capabilityHost. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -25310,32 +16699,66 @@ def begin_create_or_update( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param resource: The workbench properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.Workbench - :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 Workbench. The Workbench is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Workbench] + :param capability_host_name: The name of the capability host associated with the Cognitive + Services Resource. Required. + :type capability_host_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: _types.Workbench, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Workbench]: - """Creates or updates a workbench associated with the project. + cls: ClsType[None] = 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._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + capability_host_name=capability_host_name, + 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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any + ) -> ItemPaged["_models.ProjectCapabilityHost"]: + """List capabilityHost. + + List capabilityHost. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -25344,302 +16767,268 @@ def begin_create_or_update( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param resource: The workbench properties. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.Workbench - :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 Workbench. The Workbench is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Workbench] + :return: An iterator like instance of ProjectCapabilityHost + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.ProjectCapabilityHost] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ProjectCapabilityHost]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_project_capability_hosts_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ProjectCapabilityHost], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Workbench]: - """Creates or updates a workbench associated with the project. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param resource: The workbench properties. Required. - :type resource: 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 Workbench. The Workbench is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Workbench] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return ItemPaged(get_next, extract_data) + + +class QuotaTiersOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`quota_tiers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - resource: Union[_models.Workbench, _types.Workbench, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Workbench]: - """Creates or updates a workbench associated with the project. + def get(self, default: str, **kwargs: Any) -> _models.QuotaTier: + """Gets the Quota Tier for a subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param resource: The workbench properties. Is either a Workbench type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.cognitiveservices.models.Workbench or - ~azure.mgmt.cognitiveservices.types.Workbench or IO[bytes] - :return: An instance of LROPoller that returns Workbench. The Workbench is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.Workbench] + Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. + + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :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.Workbench] = 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._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, - resource=resource, - 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) + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - deserialized = _deserialize(_models.Workbench, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized + cls: ClsType[_models.QuotaTier] = kwargs.pop("cls", None) + _request = build_quota_tiers_get_request( + default=default, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _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.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.Workbench].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Workbench]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.QuotaTier, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @overload - def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: _models.WorkbenchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Workbench: - """Updates a workbench associated with the project. + def create_or_update( + self, default: str, tier: _models.QuotaTier, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param properties: The workbench properties to update. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.WorkbenchUpdate + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. + + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Workbench. The Workbench is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Workbench + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: _types.WorkbenchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Workbench: - """Updates a workbench associated with the project. + def create_or_update( + self, default: str, tier: _types.QuotaTier, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param properties: The workbench properties to update. Required. - :type properties: ~azure.mgmt.cognitiveservices.types.WorkbenchUpdate + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. + + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: ~azure.mgmt.cognitiveservices.types.QuotaTier :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Workbench. The Workbench is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Workbench + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Workbench: - """Updates a workbench associated with the project. + def create_or_update( + self, default: str, tier: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param properties: The workbench properties to update. Required. - :type properties: IO[bytes] + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. + + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: 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: Workbench. The Workbench is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Workbench + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def update( - self, - resource_group_name: str, - account_name: str, - project_name: str, - workbench_name: str, - properties: Union[_models.WorkbenchUpdate, _types.WorkbenchUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.Workbench: - """Updates a workbench associated with the project. + def create_or_update( + self, default: str, tier: Union[_models.QuotaTier, _types.QuotaTier, IO[bytes]], **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :param properties: The workbench properties to update. Is either a WorkbenchUpdate type or a - IO[bytes] type. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.WorkbenchUpdate or - ~azure.mgmt.cognitiveservices.types.WorkbenchUpdate or IO[bytes] - :return: Workbench. The Workbench is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.Workbench + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. + + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Is either a QuotaTier type + or a IO[bytes] type. Required. + :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier or + ~azure.mgmt.cognitiveservices.types.QuotaTier or IO[bytes] + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -25654,20 +17043,17 @@ def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Workbench] = kwargs.pop("cls", None) + cls: ClsType[_models.QuotaTier] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(tier, (IOBase, bytes)): + _content = tier else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(tier, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_workbenches_update_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, + _request = build_quota_tiers_create_or_update_request( + default=default, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -25688,7 +17074,7 @@ def update( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -25704,204 +17090,177 @@ def update( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Workbench, response.json()) + deserialized = _deserialize(_models.QuotaTier, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _delete_initial( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: 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) + @overload + def update( + self, default: str, tier: _models.QuotaTier, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. The only properties that can be updated are + "tierUpgradePolicy". - _request = build_workbenches_delete_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :raises ~azure.core.exceptions.HttpResponseError: + """ - response = pipeline_response.http_response + @overload + def update( + self, default: str, tier: _types.QuotaTier, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. The only properties that can be updated are + "tierUpgradePolicy". - if response.status_code not in [202, 204]: - 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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: ~azure.mgmt.cognitiveservices.types.QuotaTier + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :raises ~azure.core.exceptions.HttpResponseError: + """ - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + @overload + def update( + self, default: str, tier: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. The only properties that can be updated are + "tierUpgradePolicy". - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. - return deserialized # type: ignore + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Required. + :type tier: 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: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_delete( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the specified workbench associated with the project. + def update( + self, default: str, tier: Union[_models.QuotaTier, _types.QuotaTier, IO[bytes]], **kwargs: Any + ) -> _models.QuotaTier: + """Updates the Quota Tier resource for a subscription. The only properties that can be updated are + "tierUpgradePolicy". - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide + resource type. It holds current tier information. + + :param default: Default parameter. Leave the value as default. Required. + :type default: str + :param tier: The parameters to provide for the quota tier resource. Is either a QuotaTier type + or a IO[bytes] type. Required. + :type tier: ~azure.mgmt.cognitiveservices.models.QuotaTier or + ~azure.mgmt.cognitiveservices.types.QuotaTier or IO[bytes] + :return: QuotaTier. The QuotaTier is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.QuotaTier :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + 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 {} - cls: ClsType[None] = 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._delete_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.QuotaTier] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + content_type = content_type or "application/json" + _content = None + if isinstance(tier, (IOBase, bytes)): + _content = tier + else: + _content = json.dumps(tier, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_quota_tiers_update_request( + default=default, + subscription_id=self._config.subscription_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.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _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.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + deserialized = _deserialize(_models.QuotaTier, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def list( - self, resource_group_name: str, account_name: str, project_name: str, **kwargs: Any - ) -> ItemPaged["_models.Workbench"]: - """Gets the workbenches associated with the project. + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.QuotaTier"]: + """Returns all the resources of a particular type belonging to a subscription. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :return: An iterator like instance of Workbench - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.Workbench] + :return: An iterator like instance of QuotaTier + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.QuotaTier] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.Workbench]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.QuotaTier]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -25914,10 +17273,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_workbenches_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, + _request = build_quota_tiers_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -25958,7 +17314,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.Workbench], + List[_models.QuotaTier], deserialized.get("value", []), ) if cls: @@ -25986,23 +17342,47 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _start_initial( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any - ) -> Iterator[bytes]: + +class AgentApplicationsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`agent_applications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any + ) -> _models.AgentApplication: + """Gets an Agent Application by name. + + Gets an Agent Application by name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :return: AgentApplication. The AgentApplication is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.AgentApplication + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -26014,13 +17394,13 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentApplication] = kwargs.pop("cls", None) - _request = build_workbenches_start_request( + _request = build_agent_applications_get_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + name=name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -26032,18 +17412,19 @@ def _start_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + 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.ErrorResponse, @@ -26051,114 +17432,24 @@ def _start_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AgentApplication, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_start( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Starts a stopped workbench resource. This is a long-running operation that returns 202 - Accepted. Returns 204 if the workbench is already in the target state. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param project_name: The name of Cognitive Services account's project. Required. - :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = 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._start_initial( - resource_group_name=resource_group_name, - account_name=account_name, - project_name=project_name, - workbench_name=workbench_name, - 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): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _stop_initial( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any + def _create_or_update_initial( + self, + resource_group_name: str, + account_name: str, + project_name: str, + name: str, + body: Union[_models.AgentApplication, _types.AgentApplication, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -26168,18 +17459,28 @@ def _stop_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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) - _request = build_workbenches_stop_request( + 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_agent_applications_create_or_update_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + name=name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -26196,7 +17497,7 @@ def _stop_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -26209,9 +17510,14 @@ def _stop_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: + if response.status_code == 201: response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["x-ms-async-operation-timeout"] = self._deserialize( + "str", response.headers.get("x-ms-async-operation-timeout") + ) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -26220,26 +17526,127 @@ def _stop_initial( return deserialized # type: ignore + @overload + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + name: str, + body: _models.AgentApplication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AgentApplication]: + """Creates or updates an Agent Application (asynchronous). + + Creates or updates an Agent Application (asynchronous). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :param body: Agent Application definition object. Required. + :type body: ~azure.mgmt.cognitiveservices.models.AgentApplication + :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 AgentApplication. The AgentApplication is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + name: str, + body: _types.AgentApplication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AgentApplication]: + """Creates or updates an Agent Application (asynchronous). + + Creates or updates an Agent Application (asynchronous). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :param body: Agent Application definition object. Required. + :type body: ~azure.mgmt.cognitiveservices.types.AgentApplication + :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 AgentApplication. The AgentApplication is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AgentApplication]: + """Creates or updates an Agent Application (asynchronous). + + Creates or updates an Agent Application (asynchronous). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :param body: Agent Application definition object. 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 AgentApplication. The AgentApplication is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_stop( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Stops a running workbench resource. This is a long-running operation that returns 202 Accepted. - Returns 204 if the workbench is already in the target state. + def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + project_name: str, + name: str, + body: Union[_models.AgentApplication, _types.AgentApplication, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AgentApplication]: + """Creates or updates an Agent Application (asynchronous). + + Creates or updates an Agent Application (asynchronous). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -26248,25 +17655,33 @@ def begin_stop( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param name: Name for the Agent Application. Required. + :type name: str + :param body: Agent Application definition object. Is either a AgentApplication type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.cognitiveservices.models.AgentApplication or + ~azure.mgmt.cognitiveservices.types.AgentApplication or IO[bytes] + :return: An instance of LROPoller that returns AgentApplication. The AgentApplication is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cognitiveservices.models.AgentApplication] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentApplication] = 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._stop_initial( + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + name=name, + body=body, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -26275,9 +17690,12 @@ def begin_stop( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AgentApplication, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -26292,30 +17710,18 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.AgentApplication].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return LROPoller[_models.AgentApplication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def _restart_initial( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any + def _delete_initial( + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -26330,11 +17736,11 @@ def _restart_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_workbenches_restart_request( + _request = build_agent_applications_delete_request( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + name=name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -26378,25 +17784,12 @@ def _restart_initial( return deserialized # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "project_name", - "workbench_name", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_restart( - self, resource_group_name: str, account_name: str, project_name: str, workbench_name: str, **kwargs: Any + def begin_delete( + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any ) -> LROPoller[None]: - """Restarts a running workbench resource. This is a long-running operation that returns 202 - Accepted. Returns 204 if the workbench is already in the target state. + """Delete Agent Application. + + Delete Agent Application. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -26405,8 +17798,8 @@ def begin_restart( :type account_name: str :param project_name: The name of Cognitive Services account's project. Required. :type project_name: str - :param workbench_name: The name of the workbench associated with the project. Required. - :type workbench_name: str + :param name: Name for the Agent Application. Required. + :type name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -26419,11 +17812,11 @@ def begin_restart( 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._restart_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, account_name=account_name, project_name=project_name, - workbench_name=workbench_name, + name=name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -26455,67 +17848,58 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class ManagedComputeCapacitiesOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`managed_compute_capacities` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "offer", - "accelerator_type", - "deployment_id", - "accept", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace def list( - self, *, offer: str, accelerator_type: Optional[str] = None, deployment_id: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ManagedComputeCapacity"]: - """Gets the managed compute capacities for a subscription. Returns available capacity per - accelerator type, including deployment size information. + self, + resource_group_name: str, + account_name: str, + project_name: str, + *, + count: int = 30, + skip: Optional[int] = None, + skip_token: Optional[str] = None, + names: Optional[List[str]] = None, + search_text: Optional[str] = None, + order_by: Optional[str] = None, + order_by_asc: bool = False, + **kwargs: Any + ) -> ItemPaged["_models.AgentApplication"]: + """Lists Agent Applications in the project. - :keyword offer: The offer name to query capacity for (required). Required. - :paramtype offer: str - :keyword accelerator_type: Optional accelerator type filter to narrow results to a specific - accelerator type. Default value is None. - :paramtype accelerator_type: str - :keyword deployment_id: Optional deployment resource ID. When provided, returns capacity for - the specific region - where the deployment is hosted rather than the best available region. Default value is None. - :paramtype deployment_id: str - :return: An iterator like instance of ManagedComputeCapacity - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.ManagedComputeCapacity] + Lists Agent Applications in the project. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. Required. + :type account_name: str + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :keyword count: Number of agent applications to be retrieved in a page of results. Default + value is 30. + :paramtype count: int + :keyword skip: Number of agent applications to skip. Default value is None. + :paramtype skip: int + :keyword skip_token: Continuation token for pagination. Default value is None. + :paramtype skip_token: str + :keyword names: Names of agent applications to retrieve. Default value is None. + :paramtype names: list[str] + :keyword search_text: Search text for filtering agent applications. Default value is None. + :paramtype search_text: str + :keyword order_by: Field to order by. Default value is None. + :paramtype order_by: str + :keyword order_by_asc: Whether to order in ascending order. Default value is False. + :paramtype order_by_asc: bool + :return: An iterator like instance of AgentApplication + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.AgentApplication] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.ManagedComputeCapacity]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentApplication]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -26528,11 +17912,18 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_managed_compute_capacities_list_request( + _request = build_agent_applications_list_request( + resource_group_name=resource_group_name, + account_name=account_name, + project_name=project_name, subscription_id=self._config.subscription_id, - offer=offer, - accelerator_type=accelerator_type, - deployment_id=deployment_id, + count=count, + skip=skip, + skip_token=skip_token, + names=names, + search_text=search_text, + order_by=order_by, + order_by_asc=order_by_asc, api_version=self._config.api_version, headers=_headers, params=_params, @@ -26572,7 +17963,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.ManagedComputeCapacity], + List[_models.AgentApplication], deserialized.get("value", []), ) if cls: @@ -26600,278 +17991,26 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - -class CostControlsOperations: # pylint: disable=docstring-missing-param - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s - :attr:`cost_controls` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: CognitiveServicesManagementClientConfiguration = ( - input_args.pop(0) if input_args else kwargs.pop("config") - ) - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "cost_control_name", - "accept", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def get( - self, resource_group_name: str, account_name: str, cost_control_name: str, **kwargs: Any - ) -> _models.CostControl: - """Gets a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :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.CostControl] = kwargs.pop("cls", None) - - _request = build_cost_controls_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - cost_control_name=cost_control_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CostControl, response.json()) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: _models.CostControl, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Creates or replaces a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.cognitiveservices.models.CostControl - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: _types.CostControl, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Creates or replaces a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.cognitiveservices.types.CostControl - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Creates or replaces a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ + def list_agents( + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any + ) -> _models.AgentReferenceResourceArmPaginatedResult: + """Lists agents for an Agent Application. - @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "cost_control_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def create_or_update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - resource: Union[_models.CostControl, _types.CostControl, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Creates or replaces a cost control. + Lists agents for an Agent Application. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param resource: Resource create parameters. Is either a CostControl type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.cognitiveservices.models.CostControl or - ~azure.mgmt.cognitiveservices.types.CostControl or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :return: AgentReferenceResourceArmPaginatedResult. The AgentReferenceResourceArmPaginatedResult + is compatible with MutableMapping + :rtype: ~azure.mgmt.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -26880,37 +18019,20 @@ def create_or_update( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.CostControl] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.AgentReferenceResourceArmPaginatedResult] = kwargs.pop("cls", None) - _request = build_cost_controls_create_or_update_request( + _request = build_agent_applications_list_agents_request( resource_group_name=resource_group_name, account_name=account_name, - cost_control_name=cost_control_name, + project_name=project_name, + name=name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -26927,7 +18049,7 @@ def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -26940,179 +18062,35 @@ def create_or_update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.CostControl, response.json()) + deserialized = _deserialize(_models.AgentReferenceResourceArmPaginatedResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: _models.CostControlPatch, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Updates selected properties of a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.CostControlPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: _types.CostControlPatch, - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Updates selected properties of a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.cognitiveservices.types.CostControlPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Updates selected properties of a cost control. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "cost_control_name", - "content_type", - "accept", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def update( - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - properties: Union[_models.CostControlPatch, _types.CostControlPatch, IO[bytes]], - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any - ) -> _models.CostControl: - """Updates selected properties of a cost control. + def enable( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any + ) -> None: + """Enables an Agent Application. + + Enables an Agent Application. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :param properties: The resource properties to be updated. Is either a CostControlPatch type or - a IO[bytes] type. Required. - :type properties: ~azure.mgmt.cognitiveservices.models.CostControlPatch or - ~azure.mgmt.cognitiveservices.types.CostControlPatch or IO[bytes] - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions - :return: CostControl. The CostControl is compatible with MutableMapping - :rtype: ~azure.mgmt.cognitiveservices.models.CostControl + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str + :return: None + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -27121,37 +18099,20 @@ def update( 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = 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.CostControl] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_cost_controls_update_request( + _request = build_agent_applications_enable_request( resource_group_name=resource_group_name, account_name=account_name, - cost_control_name=cost_control_name, + project_name=project_name, + name=name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -27160,8 +18121,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -27169,11 +18129,6 @@ def update( 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.ErrorResponse, @@ -27181,59 +18136,26 @@ def update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - response_headers["ETag"] = self._deserialize("str", response.headers.get("ETag")) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.CostControl, response.json()) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - @api_version_validation( - method_added_on="2026-09-15-preview", - params_added_on={ - "2026-09-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "cost_control_name", - "etag", - "match_condition", - ] - }, - api_versions_list=["2026-09-15-preview"], - ) - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - account_name: str, - cost_control_name: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - **kwargs: Any + def disable( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, account_name: str, project_name: str, name: str, **kwargs: Any ) -> None: - """Deletes a cost control. + """Disables an Agent Application. + + Disables an Agent Application. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: The name of Cognitive Services account. Required. :type account_name: str - :param cost_control_name: The name of the CostControl. Required. - :type cost_control_name: str - :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is - None. - :paramtype etag: str - :keyword match_condition: The match condition to use upon the etag. Default value is None. - :paramtype match_condition: ~azure.core.MatchConditions + :param project_name: The name of Cognitive Services account's project. Required. + :type project_name: str + :param name: Name for the Agent Application. Required. + :type name: str :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -27244,12 +18166,6 @@ def delete( # pylint: disable=inconsistent-return-statements 409: ResourceExistsError, 304: ResourceNotModifiedError, } - if match_condition == MatchConditions.IfNotModified: - error_map[412] = ResourceModifiedError - elif match_condition == MatchConditions.IfPresent: - error_map[412] = ResourceNotFoundError - elif match_condition == MatchConditions.IfMissing: - error_map[412] = ResourceExistsError error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -27257,13 +18173,12 @@ def delete( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_cost_controls_delete_request( + _request = build_agent_applications_disable_request( resource_group_name=resource_group_name, account_name=account_name, - cost_control_name=cost_control_name, + project_name=project_name, + name=name, subscription_id=self._config.subscription_id, - etag=etag, - match_condition=match_condition, api_version=self._config.api_version, headers=_headers, params=_params, @@ -27280,7 +18195,7 @@ def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -27291,30 +18206,87 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + +class ManagedComputeCapacitiesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.cognitiveservices.CognitiveServicesManagementClient`'s + :attr:`managed_compute_capacities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: CognitiveServicesManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace @api_version_validation( - method_added_on="2026-09-15-preview", + method_added_on="2026-03-15-preview", params_added_on={ - "2026-09-15-preview": ["api_version", "subscription_id", "resource_group_name", "account_name", "accept"] + "2026-03-15-preview": [ + "api_version", + "subscription_id", + "offer", + "accelerator_type", + "deployment_id", + "accept", + ], + "2026-11-01": ["location"], }, - api_versions_list=["2026-09-15-preview"], + api_versions_list=[ + "2026-03-15-preview", + "2026-05-15-preview", + "2026-07-15-preview", + "2026-09-15-preview", + "2026-11-01", + ], ) - def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> ItemPaged["_models.CostControl"]: - """Lists the cost controls owned by an account. + def list( + self, + *, + offer: str, + accelerator_type: Optional[str] = None, + deployment_id: Optional[str] = None, + location: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.ManagedComputeCapacity"]: + """Gets the managed compute capacities for a subscription. Returns available capacity per + accelerator type, including deployment size information. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: The name of Cognitive Services account. Required. - :type account_name: str - :return: An iterator like instance of CostControl - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.CostControl] + :keyword offer: The offer name to query capacity for (required). Required. + :paramtype offer: str + :keyword accelerator_type: Optional accelerator type filter to narrow results to a specific + accelerator type. Default value is None. + :paramtype accelerator_type: str + :keyword deployment_id: Optional deployment resource ID. When provided, returns capacity for + the specific region + where the deployment is hosted rather than the best available region. Default value is None. + :paramtype deployment_id: str + :keyword location: Optional Azure location used to select a DataZone scope. Without a + deployment ID, + omitted or blank location returns Global and both US and EU DataZone capacities. + A supported location returns Global and the matching DataZone capacities; an + unsupported location returns Global capacity only. With a deployment ID, a + nonblank location must match the parent account location, ignoring case and + surrounding whitespace, or the request returns HTTP 400. Capacity is still + returned for the deployment's backend region. Default value is None. + :paramtype location: str + :return: An iterator like instance of ManagedComputeCapacity + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.cognitiveservices.models.ManagedComputeCapacity] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.CostControl]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ManagedComputeCapacity]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -27327,10 +18299,12 @@ def list(self, resource_group_name: str, account_name: str, **kwargs: Any) -> It def prepare_request(next_link=None): if not next_link: - _request = build_cost_controls_list_request( - resource_group_name=resource_group_name, - account_name=account_name, + _request = build_managed_compute_capacities_list_request( subscription_id=self._config.subscription_id, + offer=offer, + accelerator_type=accelerator_type, + deployment_id=deployment_id, + location=location, api_version=self._config.api_version, headers=_headers, params=_params, @@ -27370,7 +18344,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.CostControl], + List[_models.ManagedComputeCapacity], deserialized.get("value", []), ) if cls: @@ -30786,6 +21760,7 @@ def get_long_running_output(pipeline_response): "2026-07-15-preview", "2026-09-01", "2026-09-15-preview", + "2026-11-01", ], ) def _delete_initial( @@ -30872,6 +21847,7 @@ def _delete_initial( "2026-07-15-preview", "2026-09-01", "2026-09-15-preview", + "2026-11-01", ], ) def begin_delete( diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_patch.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_patch.py index e1c6ea18e7eb..ea765788358a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_patch.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/_patch.py @@ -7,273 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -import base64 -import json -import time -from collections.abc import MutableMapping -from typing import IO, Any, Optional, Union, cast, overload -from azure.core.exceptions import HttpResponseError -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict - -from .. import models as _models, types as _types -from .._utils.model_base import _deserialize -from .._validation import api_version_validation -from ._operations import ComputesOperations as _ComputesOperationsGenerated - -_TERMINAL_FAILED_STATES = frozenset({"failed", "canceled", "cancelled"}) -_TERMINAL_SUCCESS_STATES = frozenset({"succeeded"}) -_CANCELED_STATES = frozenset({"canceled", "cancelled"}) - - -def _encode_continuation_token(resource_group_name: str, account_name: str, compute_name: str) -> str: - payload = json.dumps( - { - "resource_group_name": resource_group_name, - "account_name": account_name, - "compute_name": compute_name, - } - ) - return base64.urlsafe_b64encode(payload.encode("utf-8")).decode("ascii") - - -def _decode_continuation_token(continuation_token: str): - try: - payload = json.loads(base64.urlsafe_b64decode(continuation_token.encode("ascii")).decode("utf-8")) - return payload["resource_group_name"], payload["account_name"], payload["compute_name"] - except Exception as exc: # pylint: disable=broad-except - raise ValueError("Invalid continuation_token for compute begin_create_or_update.") from exc - - -def _state_of(compute: Any) -> str: - properties = getattr(compute, "properties", None) - state = getattr(properties, "provisioning_state", None) if properties is not None else None - if state is None and isinstance(compute, MutableMapping): - state = (compute.get("properties") or {}).get("provisioningState") - if state is None: - return "" - return str(getattr(state, "value", state)).lower() - - -def _provisioning_error(compute: Any) -> HttpResponseError: - properties = getattr(compute, "properties", None) - errors = getattr(properties, "errors", None) if properties is not None else None - if errors is None and isinstance(compute, MutableMapping): - errors = (compute.get("properties") or {}).get("errors") - parts = [] - for error in errors or []: - if isinstance(error, MutableMapping): - code, message = error.get("code"), error.get("message") - else: - code, message = getattr(error, "code", None), getattr(error, "message", None) - if code and message: - parts.append(f"{code}: {message}") - elif message or code: - parts.append(str(message or code)) - detail = "; ".join(parts) - text = f"Compute provisioning {_state_of(compute) or 'failed'}." - if detail: - text = f"{text} {detail}" - return HttpResponseError(message=text) - - -class _ComputeListPolling(PollingMethod): - """Poll compute provisioning through list(), avoiding the permission-gated status endpoint.""" - - _NOT_FOUND_GRACE_SECONDS = 300 - - def __init__( - self, - operations: "ComputesOperations", - resource_group_name: str, - account_name: str, - compute_name: str, - interval: float, - cls: Any = None, - ) -> None: - self._operations = operations - self._resource_group_name = resource_group_name - self._account_name = account_name - self._compute_name = compute_name - self._interval = interval - self._cls = cls - self._status = "InProgress" - self._resource: Optional[_models.Compute] = None - self._first_missing_at: Optional[float] = None - - def initialize(self, client: Any, initial_response: Any, deserialization_callback: Any) -> None: - pass - - def _current_compute(self) -> Optional[_models.Compute]: - for compute in self._operations.list(self._resource_group_name, self._account_name): - if getattr(compute, "name", None) == self._compute_name: - return compute - return None - - def run(self) -> None: - while not self.finished(): - compute = self._current_compute() - if compute is None: - if self._first_missing_at is None: - self._first_missing_at = time.monotonic() - elif time.monotonic() - self._first_missing_at > self._NOT_FOUND_GRACE_SECONDS: - raise HttpResponseError( - message=f"Compute '{self._compute_name}' did not appear in the account's compute list." - ) - else: - self._first_missing_at = None - self._resource = compute - state = _state_of(compute) - if state in _TERMINAL_SUCCESS_STATES: - self._status = "Succeeded" - elif state in _TERMINAL_FAILED_STATES: - self._status = "Canceled" if state in _CANCELED_STATES else "Failed" - raise _provisioning_error(compute) - if not self.finished(): - time.sleep(self._interval) - - def status(self) -> str: - return self._status - - def finished(self) -> bool: - return self._status in ("Succeeded", "Failed", "Canceled") - - def resource(self) -> Optional[_models.Compute]: - if self._resource is not None and self._cls is not None: - return self._cls(None, self._resource, {}) - return self._resource - - def get_continuation_token(self) -> str: - return _encode_continuation_token(self._resource_group_name, self._account_name, self._compute_name) - - @classmethod - def from_continuation_token(cls, continuation_token: str, **kwargs: Any): - _decode_continuation_token(continuation_token) - return kwargs["client"], None, kwargs["deserialization_callback"] - - -class ComputesOperations(_ComputesOperationsGenerated): - """Computes operations that poll provisioning through the account's compute list.""" - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: _models.Compute, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> LROPoller[_models.Compute]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: _types.Compute, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> LROPoller[_models.Compute]: ... - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> LROPoller[_models.Compute]: ... - - @distributed_trace - @api_version_validation( - method_added_on="2026-03-15-preview", - params_added_on={ - "2026-03-15-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "account_name", - "compute_name", - "content_type", - ] - }, - api_versions_list=["2026-03-15-preview", "2026-05-15-preview", "2026-07-15-preview", "2026-09-15-preview"], - ) - def begin_create_or_update( - self, - resource_group_name: str, - account_name: str, - compute_name: str, - resource: Union[_models.Compute, _types.Compute, IO[bytes]], - **kwargs: Any, - ) -> LROPoller[_models.Compute]: - _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: Any = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - continuation_token: Optional[str] = kwargs.pop("continuation_token", None) - if continuation_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - account_name=account_name, - compute_name=compute_name, - resource=resource, - content_type=content_type, - cls=lambda response, value, headers: response, - headers=_headers, - params=_params, - **kwargs, - ) - raw_result.http_response.read() # type: ignore - try: - initial_body = raw_result.http_response.json() - except Exception: # pylint: disable=broad-except - initial_body = None - if isinstance(initial_body, MutableMapping) and _state_of(initial_body) in _TERMINAL_FAILED_STATES: - raise _provisioning_error(initial_body) - else: - resource_group_name, account_name, compute_name = _decode_continuation_token(continuation_token) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = _deserialize(_models.Compute, pipeline_response.http_response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, - _ComputeListPolling(self, resource_group_name, account_name, compute_name, lro_delay, cls), - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if continuation_token: - return LROPoller[_models.Compute].from_continuation_token( - polling_method=polling_method, - continuation_token=continuation_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Compute]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - -__all__: list[str] = ["ComputesOperations"] +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/types.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/types.py index 958f7cca23da..c5ae11e6f1b1 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/types.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/types.py @@ -10,40 +10,22 @@ from typing import Any, Literal, Optional, TYPE_CHECKING, Union from typing_extensions import Required, TypedDict -from .models._enums import ( - AgentDeploymentType, - AgentHostingType, - BuiltInAuthorizationScheme, - ComputeType, - ConnectionAuthType, - RuleType, -) +from .models._enums import AgentDeploymentType, BuiltInAuthorizationScheme, ConnectionAuthType, RuleType if TYPE_CHECKING: from .models import ( AbusePenaltyAction, - AdapterDeploymentOperationState, - AdapterDeploymentOperationType, AgentDeploymentProvisioningState, AgentDeploymentState, AgentProtocol, AgenticApplicationProvisioningState, - ArcDeploymentComputeType, - ArcDeploymentRuntime, - ArcDeploymentSkuName, ByPassSelection, CapabilityHostKind, CapabilityHostProvisioningState, CommitmentPlanProvisioningState, - ComputeProvisioningState, ConnectionCategory, ConnectionGroup, ContentLevel, - CostControlDimensionType, - CostControlPeriod, - CostControlThresholdAction, - CostControlThresholdType, - CostControlUnit, CreatedByType, DefenderForAISettingState, DeploymentModelVersionUpgradeOption, @@ -53,7 +35,6 @@ EncryptionScopeProvisioningState, EncryptionScopeState, FirewallSku, - FoundryAutoUpgradeMode, HostingModel, IdentityKind, IdentityManagementType, @@ -71,12 +52,6 @@ PrivateEndpointServiceConnectionStatus, ProvisioningState, PublicNetworkAccess, - RaiAcsHarmCategory, - RaiAcsModerationSubjectFormat, - RaiAcsPolicyDefinitionType, - RaiAcsPolicyTarget, - RaiAcsPolicyTargetKind, - RaiAcsToolNameSelector, RaiActionType, RaiEgressDefaultAction, RaiEgressHeaderOperation, @@ -85,10 +60,8 @@ RaiEgressRuleType, RaiEgressScheme, RaiPolicyContentSource, - RaiPolicyFormat, RaiPolicyMode, RaiPolicyType, - RaiRegoEncoding, ResourceIdentityType, RoutingMethods, RoutingMode, @@ -100,10 +73,8 @@ SkuTier, TierUpgradePolicy, TrafficRoutingProtocol, + TrustedCertificateSourceType, UpgradeAvailabilityStatus, - VmPriority, - WorkbenchProvisioningState, - WorkbenchStatus, ) @@ -123,11 +94,11 @@ class AADAuthTypeConnectionProperties(TypedDict, total=False): "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -178,10 +149,10 @@ class AADAuthTypeConnectionProperties(TypedDict, total=False): \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -247,11 +218,11 @@ class AccessKeyAuthTypeConnectionProperties(TypedDict, total=False): "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -304,10 +275,10 @@ class AccessKeyAuthTypeConnectionProperties(TypedDict, total=False): \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -447,11 +418,11 @@ class AccountKeyAuthTypeConnectionProperties(TypedDict, total=False): "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -504,10 +475,10 @@ class AccountKeyAuthTypeConnectionProperties(TypedDict, total=False): \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -587,7 +558,7 @@ class AccountProperties(TypedDict, total=False): :ivar provisioningState: Gets the status of the cognitive services account at the time the operation was called. Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", - "Succeeded", "Canceled", "ResolvingDNS", and "ExtensionUnreachable". + "Succeeded", "Canceled", and "ResolvingDNS". :vartype provisioningState: Union[str, "ProvisioningState"] :ivar endpoint: Endpoint of the created account. :vartype endpoint: str @@ -660,9 +631,6 @@ class AccountProperties(TypedDict, total=False): :vartype raiMonitorConfig: "RaiMonitorConfig" :ivar networkInjections: :vartype networkInjections: list["NetworkInjection"] - :ivar foundryAutoUpgrade: Represents the foundry auto-upgrade configuration for a Cognitive - Services account. - :vartype foundryAutoUpgrade: "FoundryAutoUpgrade" :ivar allowProjectManagement: Specifies whether this resource support project management as child resources, used as containers for access management, data isolation and cost in AI Foundry. @@ -673,33 +641,19 @@ class AccountProperties(TypedDict, total=False): :ivar associatedProjects: Specifies the projects, by project name, that are associated with this resource. :vartype associatedProjects: list[str] - :ivar capabilitySettings: Reusable default agent capability settings inherited by child - projects. - :vartype capabilitySettings: "CapabilitySettings" - :ivar agentHostingConfigurations: Customer-owned AKS hosting configurations for Foundry agents. - This property can only be specified when the account is created; an existing account without a - hosting configuration cannot add one later. This API version supports exactly one - configuration, while the array shape is reserved for future API versions that may support - multiple configurations. Once set, the configuration cannot be changed, removed, or reordered. - Account update requests should omit this property or send the complete existing value - unchanged. Responses only include hosting configuration types defined by the requested API - version. - :vartype agentHostingConfigurations: list["AgentHostingConfiguration"] - :ivar costControlIds: The full resource IDs of cost controls directly attached to this account. - At the moment the service only supports a single cost control. This will be expanded in future - API versions. - :vartype costControlIds: list[str] - :ivar costControlConnections: The account-level connections used to publish cost control - telemetry and events. Application Insights is optional for attachment, accounting, and - enforcement and can be configured later. Event Grid must be configured before attaching a cost - control with an alert threshold. - :vartype costControlConnections: "CostControlConnections" + :ivar trustedCertificateSources: Private CA trust sources for supported features in an + AIServices account with allowProjectManagement enabled. Supports one Azure Key Vault source + containing version-pinned references to secrets with PEM-encoded CA certificates or certificate + bundles. On PUT or PATCH, a non-null array replaces the complete configuration, so include all + references to retain. Omit this property or send null to preserve the existing configuration; + send an empty array to clear it. + :vartype trustedCertificateSources: list["TrustedCertificateSource"] """ provisioningState: Union[str, "ProvisioningState"] """Gets the status of the cognitive services account at the time the operation was called. Known values are: \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", - \"Canceled\", \"ResolvingDNS\", and \"ExtensionUnreachable\".""" + \"Canceled\", and \"ResolvingDNS\".""" endpoint: str """Endpoint of the created account.""" internalId: str @@ -760,8 +714,6 @@ class AccountProperties(TypedDict, total=False): raiMonitorConfig: "RaiMonitorConfig" """Cognitive Services Rai Monitor Config.""" networkInjections: list["NetworkInjection"] - foundryAutoUpgrade: "FoundryAutoUpgrade" - """Represents the foundry auto-upgrade configuration for a Cognitive Services account.""" allowProjectManagement: bool """Specifies whether this resource support project management as child resources, used as containers for access management, data isolation and cost in AI Foundry.""" @@ -770,127 +722,13 @@ class AccountProperties(TypedDict, total=False): without a project parameter.""" associatedProjects: list[str] """Specifies the projects, by project name, that are associated with this resource.""" - capabilitySettings: "CapabilitySettings" - """Reusable default agent capability settings inherited by child projects.""" - agentHostingConfigurations: list["AgentHostingConfiguration"] - """Customer-owned AKS hosting configurations for Foundry agents. This property can only be - specified when the account is created; an existing account without a hosting configuration - cannot add one later. This API version supports exactly one configuration, while the array - shape is reserved for future API versions that may support multiple configurations. Once set, - the configuration cannot be changed, removed, or reordered. Account update requests should omit - this property or send the complete existing value unchanged. Responses only include hosting - configuration types defined by the requested API version.""" - costControlIds: list[str] - """The full resource IDs of cost controls directly attached to this account. At the moment the - service only supports a single cost control. This will be expanded in future API versions.""" - costControlConnections: Optional["CostControlConnections"] - """The account-level connections used to publish cost control telemetry and events. Application - Insights is optional for attachment, accounting, and enforcement and can be configured later. - Event Grid must be configured before attaching a cost control with an alert threshold.""" - - -class AdapterDeployment(ProxyResource): - """An independently managed LoRA adapter attached to a managed compute deployment. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: Properties of the Cognitive Services adapter deployment. - :vartype properties: "AdapterDeploymentProperties" - :ivar etag: The concurrency token for this adapter deployment. - :vartype etag: str - """ - - properties: "AdapterDeploymentProperties" - """Properties of the Cognitive Services adapter deployment.""" - etag: str - """The concurrency token for this adapter deployment.""" - - -class AdapterDeploymentLastOperation(TypedDict, total=False): - """The most recently requested adapter lifecycle operation. - - :ivar type: The type of lifecycle operation. Required. Known values are: "Create", "Update", - and "Delete". - :vartype type: Union[str, "AdapterDeploymentOperationType"] - :ivar status: The current or terminal operation state. Required. Known values are: "Accepted", - "Running", "Succeeded", and "Failed". - :vartype status: Union[str, "AdapterDeploymentOperationState"] - :ivar requestedTargetDeploymentName: The target deployment requested by a create or re-target - operation. - :vartype requestedTargetDeploymentName: str - :ivar startedAt: The time at which the operation started. Required. - :vartype startedAt: str - :ivar completedAt: The time at which the operation reached a terminal state. - :vartype completedAt: str - """ - - type: Required[Union[str, "AdapterDeploymentOperationType"]] - """The type of lifecycle operation. Required. Known values are: \"Create\", \"Update\", and - \"Delete\".""" - status: Required[Union[str, "AdapterDeploymentOperationState"]] - """The current or terminal operation state. Required. Known values are: \"Accepted\", \"Running\", - \"Succeeded\", and \"Failed\".""" - requestedTargetDeploymentName: str - """The target deployment requested by a create or re-target operation.""" - startedAt: Required[str] - """The time at which the operation started. Required.""" - completedAt: str - """The time at which the operation reached a terminal state.""" - - -class AdapterDeploymentProperties(TypedDict, total=False): - """Properties of an adapter deployment. - - :ivar sourceModelId: The immutable Project Models version produced by Foundry fine-tuning. The - identifier uses the Azure AI project model URI format. Model and version segments use ASCII - letters, digits, periods, underscores, and hyphens. The service validates LoRA weight type, - protected status, provenance, compatibility metadata, and registration state. Required. - :vartype sourceModelId: str - :ivar targetDeploymentName: The name of the compatible managed compute parent deployment. The - service resolves this name within the adapter's owning account; full Azure Resource Manager - resource IDs and cross-account references are not accepted. It cannot equal the adapter - deployment's resource name. Updating this value re-targets the adapter while its source model - remains unchanged. Required. - :vartype targetDeploymentName: str - :ivar activeTargetDeploymentName: The managed compute deployment currently serving the adapter. - During re-targeting this remains the prior deployment until atomic cutover. - :vartype activeTargetDeploymentName: str - :ivar provisioningState: The provisioning state of the adapter deployment. Known values are: - "Accepted", "Creating", "Deleting", "Moving", "Failed", "Succeeded", "Canceled", - "ResolvingDNS", and "ExtensionUnreachable". - :vartype provisioningState: Union[str, "ProvisioningState"] - :ivar lastOperation: Information about the most recently requested lifecycle operation. - :vartype lastOperation: "AdapterDeploymentLastOperation" - """ - - sourceModelId: Required[str] - """The immutable Project Models version produced by Foundry fine-tuning. The identifier uses the - Azure AI project model URI format. Model and version segments use ASCII letters, digits, - periods, underscores, and hyphens. The service validates LoRA weight type, protected status, - provenance, compatibility metadata, and registration state. Required.""" - targetDeploymentName: Required[str] - """The name of the compatible managed compute parent deployment. The service resolves this name - within the adapter's owning account; full Azure Resource Manager resource IDs and cross-account - references are not accepted. It cannot equal the adapter deployment's resource name. Updating - this value re-targets the adapter while its source model remains unchanged. Required.""" - activeTargetDeploymentName: str - """The managed compute deployment currently serving the adapter. During re-targeting this remains - the prior deployment until atomic cutover.""" - provisioningState: Union[str, "ProvisioningState"] - """The provisioning state of the adapter deployment. Known values are: \"Accepted\", \"Creating\", - \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", \"Canceled\", \"ResolvingDNS\", and - \"ExtensionUnreachable\".""" - lastOperation: "AdapterDeploymentLastOperation" - """Information about the most recently requested lifecycle operation.""" + trustedCertificateSources: Optional[list["TrustedCertificateSource"]] + """Private CA trust sources for supported features in an AIServices account with + allowProjectManagement enabled. Supports one Azure Key Vault source containing version-pinned + references to secrets with PEM-encoded CA certificates or certificate bundles. On PUT or PATCH, + a non-null array replaces the complete configuration, so include all references to retain. Omit + this property or send null to preserve the existing configuration; send an empty array to clear + it.""" class AgentApplication(ProxyResource): @@ -1074,11 +912,11 @@ class ApiKeyAuthConnectionProperties(TypedDict, total=False): "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -1131,10 +969,10 @@ class ApiKeyAuthConnectionProperties(TypedDict, total=False): \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -1232,305 +1070,6 @@ class ApplicationTrafficRoutingPolicy(TypedDict, total=False): """Gets or sets the collection of traffic routing rules.""" -class ArcDeployment(ProxyResource): - """Cognitive Services account Arc deployment, backed by customer-managed Arc-enabled Kubernetes - resources. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: Properties of the Cognitive Services Arc deployment. Required. - :vartype properties: "ArcDeploymentProperties" - :ivar sku: The Arc deployment SKU. Only the SKU name is required for Arc deployments. Required. - :vartype sku: "ArcDeploymentSku" - :ivar etag: Resource Etag. - :vartype etag: str - """ - - properties: Required["ArcDeploymentProperties"] - """Properties of the Cognitive Services Arc deployment. Required.""" - sku: Required["ArcDeploymentSku"] - """The Arc deployment SKU. Only the SKU name is required for Arc deployments. Required.""" - etag: str - """Resource Etag.""" - - -class ArcDeploymentCpuMemoryResourceRequirements(TypedDict, total=False): # pylint: disable=name-too-long - """CPU and memory resource requirements for an Arc deployment replica. - - :ivar cpu: Kubernetes CPU quantity string, for example 500m, 2, 4, or 8. Required. - :vartype cpu: str - :ivar memory: Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi. Required. - :vartype memory: str - """ - - cpu: Required[str] - """Kubernetes CPU quantity string, for example 500m, 2, 4, or 8. Required.""" - memory: Required[str] - """Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi. Required.""" - - -class ArcDeploymentKubernetesResources(TypedDict, total=False): - """Per-replica Kubernetes resource requests and limits for an Arc deployment. - - :ivar requests: Kubernetes CPU and memory resource requests for each deployment replica. - :vartype requests: "ArcDeploymentCpuMemoryResourceRequirements" - :ivar limits: Kubernetes resource limits for each deployment replica. - :vartype limits: "ArcDeploymentResourceRequirements" - """ - - requests: "ArcDeploymentCpuMemoryResourceRequirements" - """Kubernetes CPU and memory resource requests for each deployment replica.""" - limits: "ArcDeploymentResourceRequirements" - """Kubernetes resource limits for each deployment replica.""" - - -class ArcDeploymentModel(TypedDict, total=False): - """Model reference for an Arc deployment. - - :ivar format: Deployment model format. Required. - :vartype format: str - :ivar name: Deployment model name. Required. - :vartype name: str - """ - - format: Required[str] - """Deployment model format. Required.""" - name: Required[str] - """Deployment model name. Required.""" - - -class ArcDeploymentPatchCpuMemoryResourceRequirements(TypedDict, total=False): # pylint: disable=name-too-long - """CPU and memory resource requirements for an Arc deployment replica update. - - :ivar cpu: Kubernetes CPU quantity string, for example 500m, 2, 4, or 8. - :vartype cpu: str - :ivar memory: Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi. - :vartype memory: str - """ - - cpu: str - """Kubernetes CPU quantity string, for example 500m, 2, 4, or 8.""" - memory: str - """Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi.""" - - -class ArcDeploymentPatchKubernetesResources(TypedDict, total=False): - """Per-replica Kubernetes resource requests and limits for an Arc deployment update. - - :ivar requests: Kubernetes CPU and memory resource requests for each deployment replica. - :vartype requests: "ArcDeploymentPatchCpuMemoryResourceRequirements" - :ivar limits: Kubernetes resource limits for each deployment replica. - :vartype limits: "ArcDeploymentResourceRequirements" - """ - - requests: "ArcDeploymentPatchCpuMemoryResourceRequirements" - """Kubernetes CPU and memory resource requests for each deployment replica.""" - limits: "ArcDeploymentResourceRequirements" - """Kubernetes resource limits for each deployment replica.""" - - -class ArcDeploymentProperties(TypedDict, total=False): - """Properties of a Cognitive Services Arc deployment. - - :ivar model: Model reference. Required on creation and immutable after creation. Required. - :vartype model: "ArcDeploymentModel" - :ivar extensionId: Full Azure resource ID of the Foundry inference extension on the target - Arc-enabled Kubernetes cluster. Required on creation and immutable after creation. Required. - :vartype extensionId: str - :ivar runtime: Inference runtime. Required on creation and immutable after creation. Required. - Known values are: "vllm" and "onnx-genai". - :vartype runtime: Union[str, "ArcDeploymentRuntime"] - :ivar compute: Compute type for the deployment. Required on creation and immutable after - creation. Required. Known values are: "gpu" and "cpu". - :vartype compute: Union[str, "ArcDeploymentComputeType"] - :ivar deploymentTemplate: Optional deployment template identifier for advanced vLLM tuning. - Allowed only when runtime is vllm. Example: - azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}. - :vartype deploymentTemplate: str - :ivar vllmParameters: Read-only. Effective vLLM runtime parameters resolved for the deployed - model. Returned only when runtime is vllm. - :vartype vllmParameters: "ArcDeploymentVllmParameters" - :ivar replicas: Physical replica count on the Arc cluster. Required. - :vartype replicas: int - :ivar resources: Per-replica Kubernetes resource requests and limits. Required. - :vartype resources: "ArcDeploymentKubernetesResources" - :ivar nodeSelector: Kubernetes node selector key-value map used to schedule pods onto nodes - with matching labels. - :vartype nodeSelector: dict[str, str] - :ivar deploymentState: The deployment state. Known values are: "Running" and "Paused". - :vartype deploymentState: Union[str, "DeploymentState"] - :ivar raiPolicyName: The name of RAI policy. - :vartype raiPolicyName: str - :ivar provisioningState: Read-only. Current provisioning state. Known values are: "Accepted", - "Creating", "Deleting", "Moving", "Failed", "Succeeded", "Canceled", "ResolvingDNS", and - "ExtensionUnreachable". - :vartype provisioningState: Union[str, "ProvisioningState"] - :ivar provisioningDetails: Read-only. Status message and timestamp from the last provisioning - operation. - :vartype provisioningDetails: "ArcDeploymentProvisioningDetails" - :ivar inferenceEndpoint: Read-only. Base URL for inference calls to this deployment on the Arc - cluster. Populated when provisioningState is Succeeded. - :vartype inferenceEndpoint: str - :ivar capabilities: Read-only. Deployment capabilities represented as key-value pairs. - :vartype capabilities: dict[str, str] - """ - - model: Required["ArcDeploymentModel"] - """Model reference. Required on creation and immutable after creation. Required.""" - extensionId: Required[str] - """Full Azure resource ID of the Foundry inference extension on the target Arc-enabled Kubernetes - cluster. Required on creation and immutable after creation. Required.""" - runtime: Required[Union[str, "ArcDeploymentRuntime"]] - """Inference runtime. Required on creation and immutable after creation. Required. Known values - are: \"vllm\" and \"onnx-genai\".""" - compute: Required[Union[str, "ArcDeploymentComputeType"]] - """Compute type for the deployment. Required on creation and immutable after creation. Required. - Known values are: \"gpu\" and \"cpu\".""" - deploymentTemplate: str - """Optional deployment template identifier for advanced vLLM tuning. Allowed only when runtime is - vllm. Example: - azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}.""" - vllmParameters: "ArcDeploymentVllmParameters" - """Read-only. Effective vLLM runtime parameters resolved for the deployed model. Returned only - when runtime is vllm.""" - replicas: Required[int] - """Physical replica count on the Arc cluster. Required.""" - resources: Required["ArcDeploymentKubernetesResources"] - """Per-replica Kubernetes resource requests and limits. Required.""" - nodeSelector: dict[str, str] - """Kubernetes node selector key-value map used to schedule pods onto nodes with matching labels.""" - deploymentState: Union[str, "DeploymentState"] - """The deployment state. Known values are: \"Running\" and \"Paused\".""" - raiPolicyName: str - """The name of RAI policy.""" - provisioningState: Union[str, "ProvisioningState"] - """Read-only. Current provisioning state. Known values are: \"Accepted\", \"Creating\", - \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", \"Canceled\", \"ResolvingDNS\", and - \"ExtensionUnreachable\".""" - provisioningDetails: "ArcDeploymentProvisioningDetails" - """Read-only. Status message and timestamp from the last provisioning operation.""" - inferenceEndpoint: str - """Read-only. Base URL for inference calls to this deployment on the Arc cluster. Populated when - provisioningState is Succeeded.""" - capabilities: dict[str, str] - """Read-only. Deployment capabilities represented as key-value pairs.""" - - -class ArcDeploymentProvisioningDetails(TypedDict, total=False): - """Provisioning status details for an Arc deployment. - - :ivar message: A human-readable status message from the last provisioning operation. - :vartype message: str - :ivar lastOperationTimestamp: Timestamp of the last provisioning operation. - :vartype lastOperationTimestamp: str - """ - - message: str - """A human-readable status message from the last provisioning operation.""" - lastOperationTimestamp: str - """Timestamp of the last provisioning operation.""" - - -class ArcDeploymentResourceRequirements(TypedDict, total=False): - """Kubernetes resource requirements for an Arc deployment replica. Specify either cpu and memory - together, or gpu. GPU is supported only in limits, not requests. - - :ivar cpu: Kubernetes CPU quantity string, for example 500m, 2, 4, or 8. Required with memory - when specifying CPU and memory limits. Do not specify with gpu. - :vartype cpu: str - :ivar memory: Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi. Required with - cpu when specifying CPU and memory limits. Do not specify with gpu. - :vartype memory: str - :ivar gpu: Kubernetes GPU quantity, for example 1, 2, or 5. Required when specifying GPU - limits. Do not specify with cpu or memory. - :vartype gpu: int - """ - - cpu: str - """Kubernetes CPU quantity string, for example 500m, 2, 4, or 8. Required with memory when - specifying CPU and memory limits. Do not specify with gpu.""" - memory: str - """Kubernetes memory quantity string, for example 512Mi, 2Gi, or 16Gi. Required with cpu when - specifying CPU and memory limits. Do not specify with gpu.""" - gpu: int - """Kubernetes GPU quantity, for example 1, 2, or 5. Required when specifying GPU limits. Do not - specify with cpu or memory.""" - - -class ArcDeploymentSku(TypedDict, total=False): - """SKU for an Arc deployment. - - :ivar name: The name of the Arc deployment SKU. Must be Arc. Required. "Arc" - :vartype name: Union[str, "ArcDeploymentSkuName"] - """ - - name: Required[Union[str, "ArcDeploymentSkuName"]] - """The name of the Arc deployment SKU. Must be Arc. Required. \"Arc\"""" - - -class ArcDeploymentUpdate(TypedDict, total=False): - """The object used to update an Arc deployment. - - :ivar properties: Properties that can be updated on an Arc deployment. - :vartype properties: "ArcDeploymentUpdateProperties" - """ - - properties: "ArcDeploymentUpdateProperties" - """Properties that can be updated on an Arc deployment.""" - - -class ArcDeploymentUpdateProperties(TypedDict, total=False): - """Mutable properties for an Arc deployment. - - :ivar replicas: Physical replica count on the Arc cluster. - :vartype replicas: int - :ivar resources: Per-replica Kubernetes resource requests and limits. - :vartype resources: "ArcDeploymentPatchKubernetesResources" - :ivar nodeSelector: Kubernetes node selector key-value map used to schedule pods onto nodes - with matching labels. - :vartype nodeSelector: dict[str, str] - """ - - replicas: int - """Physical replica count on the Arc cluster.""" - resources: "ArcDeploymentPatchKubernetesResources" - """Per-replica Kubernetes resource requests and limits.""" - nodeSelector: dict[str, str] - """Kubernetes node selector key-value map used to schedule pods onto nodes with matching labels.""" - - -class ArcDeploymentVllmParameters(TypedDict, total=False): - """Effective vLLM runtime parameters for an Arc deployment. - - :ivar tensorParallelSize: Number of GPUs used for tensor parallelism. - :vartype tensorParallelSize: int - :ivar maxModelLen: Maximum model context length. - :vartype maxModelLen: int - :ivar gpuMemoryUtilization: Fraction of GPU memory reserved for model execution. - :vartype gpuMemoryUtilization: float - :ivar enforceEager: Whether eager execution is enforced for the vLLM runtime. - :vartype enforceEager: bool - """ - - tensorParallelSize: int - """Number of GPUs used for tensor parallelism.""" - maxModelLen: int - """Maximum model context length.""" - gpuMemoryUtilization: float - """Fraction of GPU memory reserved for model execution.""" - enforceEager: bool - """Whether eager execution is enforced for the vLLM runtime.""" - - class AssignedIdentity(TypedDict, total=False): """Type representing an identity assignment. @@ -1683,25 +1222,25 @@ class CapabilityHostProperties(ResourceBase): """Whether public hosting environment is enabled for the capability host.""" -class CapabilitySettings(TypedDict, total=False): - """Extensible agent capability configuration. Carries the Azure resource IDs of the agent storage - dependencies. Modeled as an object so future capability-backed resources can be added without - changing the account or project contract. +class CertificateBundleReference(TypedDict, total=False): + """A reference to a specific version of a Key Vault secret containing a PEM-encoded CA certificate + or certificate bundle. - :ivar documentStore: Azure resource ID of the document store used by agent runtime state. - :vartype documentStore: str - :ivar vectorStore: Azure resource ID of the vector store used by agent retrieval and indexing. - :vartype vectorStore: str - :ivar blobStore: Azure resource ID of the blob store used by agent file and artifact storage. - :vartype blobStore: str + :ivar secretName: Name of the Key Vault secret containing the CA certificate or certificate + bundle. Required. + :vartype secretName: str + :ivar secretVersion: Required, pinned version of the Key Vault secret. Newer secret versions + are not followed automatically. To rotate a bundle, update this value and resubmit the complete + account trust configuration. Required. + :vartype secretVersion: str """ - documentStore: str - """Azure resource ID of the document store used by agent runtime state.""" - vectorStore: str - """Azure resource ID of the vector store used by agent retrieval and indexing.""" - blobStore: str - """Azure resource ID of the blob store used by agent file and artifact storage.""" + secretName: Required[str] + """Name of the Key Vault secret containing the CA certificate or certificate bundle. Required.""" + secretVersion: Required[str] + """Required, pinned version of the Key Vault secret. Newer secret versions are not followed + automatically. To rotate a bundle, update this value and resubmit the complete account trust + configuration. Required.""" class ChannelsBuiltInAuthorizationPolicy(TypedDict, total=False): @@ -1755,45 +1294,6 @@ class CheckSkuAvailabilityParameter(TypedDict, total=False): """The Type of the resource. Required.""" -class ClusterComputeProperties(TypedDict, total=False): - """Properties for a Cluster (AKS-backed) compute resource. - - :ivar location: The location of the compute resource. Required. - :vartype location: str - :ivar provisioningState: Provisioning state of the compute resource. Known values are: - "Accepted", "Succeeded", "Failed", "Canceled", "Deleting", "Scaling", "Disabled", "Starting", - "Stopping", "Restarting", and "Stopped". - :vartype provisioningState: Union[str, "ComputeProvisioningState"] - :ivar errors: Error details for the compute resource. - :vartype errors: list["ErrorDetail"] - :ivar creationTime: Creation time of the compute resource. - :vartype creationTime: str - :ivar computeType: The type of compute resource. Required. Cluster (AKS-backed) compute type. - :vartype computeType: Literal[ComputeType.CLUSTER] - :ivar pools: Pools attached to this compute cluster. Required. - :vartype pools: list["Pool"] - :ivar subnetArmId: ARM ID of the subnet used for compute. - :vartype subnetArmId: str - """ - - location: Required[str] - """The location of the compute resource. Required.""" - provisioningState: Union[str, "ComputeProvisioningState"] - """Provisioning state of the compute resource. Known values are: \"Accepted\", \"Succeeded\", - \"Failed\", \"Canceled\", \"Deleting\", \"Scaling\", \"Disabled\", \"Starting\", \"Stopping\", - \"Restarting\", and \"Stopped\".""" - errors: list["ErrorDetail"] - """Error details for the compute resource.""" - creationTime: str - """Creation time of the compute resource.""" - computeType: Required[Literal[ComputeType.CLUSTER]] - """The type of compute resource. Required. Cluster (AKS-backed) compute type.""" - pools: Required[list["Pool"]] - """Pools attached to this compute cluster. Required.""" - subnetArmId: str - """ARM ID of the subnet used for compute.""" - - class CommitmentPeriod(TypedDict, total=False): """Cognitive Services account commitment period. @@ -1983,43 +1483,6 @@ class CommitmentQuota(TypedDict, total=False): """Commitment quota unit.""" -class Compute(ProxyResource): - """Cognitive Services compute resource. Supports polymorphic compute types (Cluster, - ContainerInstance) via the computeType discriminator in properties. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: Polymorphic properties of the compute resource. Use computeType to select - Cluster or ContainerInstance. Required. - :vartype properties: "ComputeProperties" - :ivar etag: Resource Etag. - :vartype etag: str - :ivar kind: The kind (type) of compute resource. - :vartype kind: str - :ivar identity: Identity for the resource. - :vartype identity: "Identity" - """ - - properties: Required["ComputeProperties"] - """Polymorphic properties of the compute resource. Use computeType to select Cluster or - ContainerInstance. Required.""" - etag: str - """Resource Etag.""" - kind: str - """The kind (type) of compute resource.""" - identity: "Identity" - """Identity for the resource.""" - - class ConnectionAccessKey(TypedDict, total=False): """ConnectionAccessKey. @@ -2196,308 +1659,6 @@ class ConnectionUsernamePassword(TypedDict, total=False): username: str -class ConnectivityEndpoints(TypedDict, total=False): - """Network connectivity endpoints for a Container Instance compute. - - :ivar publicIpAddress: The public IP address of the compute instance. - :vartype publicIpAddress: str - :ivar sshPort: The SSH port for the compute instance. - :vartype sshPort: int - """ - - publicIpAddress: str - """The public IP address of the compute instance.""" - sshPort: int - """The SSH port for the compute instance.""" - - -class ContainerInstanceComputeProperties(TypedDict, total=False): - """Properties for a Container Instance compute resource. - - :ivar location: The location of the compute resource. Required. - :vartype location: str - :ivar provisioningState: Provisioning state of the compute resource. Known values are: - "Accepted", "Succeeded", "Failed", "Canceled", "Deleting", "Scaling", "Disabled", "Starting", - "Stopping", "Restarting", and "Stopped". - :vartype provisioningState: Union[str, "ComputeProvisioningState"] - :ivar errors: Error details for the compute resource. - :vartype errors: list["ErrorDetail"] - :ivar creationTime: Creation time of the compute resource. - :vartype creationTime: str - :ivar computeType: The type of compute resource. Required. Container Instance compute type. - :vartype computeType: Literal[ComputeType.CONTAINER_INSTANCE] - :ivar targetClusterId: ARM resource ID of the parent cluster that hosts this container - instance. Required. - :vartype targetClusterId: str - :ivar imageLink: Container image URI (e.g., MCR or ACR image path) for the container instance. - Required. - :vartype imageLink: str - :ivar idleTimeBeforeShutdown: ISO 8601 duration before the idle instance is automatically shut - down (e.g., 'PT30M'). - :vartype idleTimeBeforeShutdown: str - :ivar sshSettings: SSH configuration for remote access to the container instance. - :vartype sshSettings: "SshSettings" - :ivar connectivityEndpoints: Network connectivity endpoints assigned to the container instance. - :vartype connectivityEndpoints: "ConnectivityEndpoints" - """ - - location: Required[str] - """The location of the compute resource. Required.""" - provisioningState: Union[str, "ComputeProvisioningState"] - """Provisioning state of the compute resource. Known values are: \"Accepted\", \"Succeeded\", - \"Failed\", \"Canceled\", \"Deleting\", \"Scaling\", \"Disabled\", \"Starting\", \"Stopping\", - \"Restarting\", and \"Stopped\".""" - errors: list["ErrorDetail"] - """Error details for the compute resource.""" - creationTime: str - """Creation time of the compute resource.""" - computeType: Required[Literal[ComputeType.CONTAINER_INSTANCE]] - """The type of compute resource. Required. Container Instance compute type.""" - targetClusterId: Required[str] - """ARM resource ID of the parent cluster that hosts this container instance. Required.""" - imageLink: Required[str] - """Container image URI (e.g., MCR or ACR image path) for the container instance. Required.""" - idleTimeBeforeShutdown: str - """ISO 8601 duration before the idle instance is automatically shut down (e.g., 'PT30M').""" - sshSettings: "SshSettings" - """SSH configuration for remote access to the container instance.""" - connectivityEndpoints: "ConnectivityEndpoints" - """Network connectivity endpoints assigned to the container instance.""" - - -class CostControl(ProxyResource): - """A cost control owned by a Cognitive Services account. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: The resource-specific properties for this resource. - :vartype properties: "CostControlProperties" - :ivar etag: The entity tag used for optimistic concurrency. - :vartype etag: str - """ - - properties: "CostControlProperties" - """The resource-specific properties for this resource.""" - etag: str - """The entity tag used for optimistic concurrency.""" - - -class CostControlConnections(TypedDict, total=False): - """Defines account-level connections used to publish cost-control telemetry and events. - Application Insights is optional and may be removed while policies remain attached. Event Grid - is required for alerts; supplied connection references must still be valid. - - :ivar appInsightsConnectionId: Gets or sets the full resource ID of the optional Application - Insights connection. - :vartype appInsightsConnectionId: str - :ivar eventGridConnectionId: The full resource ID of the Event Grid connection used for cost - control alerts. This connection must be configured when an attached cost control contains an - alert threshold action and cannot be removed while such an action remains attached. - :vartype eventGridConnectionId: str - """ - - appInsightsConnectionId: Optional[str] - """Gets or sets the full resource ID of the optional Application Insights connection.""" - eventGridConnectionId: Optional[str] - """The full resource ID of the Event Grid connection used for cost control alerts. This connection - must be configured when an attached cost control contains an alert threshold action and cannot - be removed while such an action remains attached.""" - - -class CostControlDimension(TypedDict, total=False): - """A request dimension used to partition cost control consumption. - - :ivar type: The kind of request dimension. Required. Known values are: "Agent", "Identity", - "Session", "Project", "Account", and "Custom". - :vartype type: Union[str, "CostControlDimensionType"] - :ivar attribute: Gets or sets the attribute path retained for legacy Custom counters. Authored - rules cannot select Custom; built-in dimensions must omit this property. - :vartype attribute: str - """ - - type: Required[Union[str, "CostControlDimensionType"]] - """The kind of request dimension. Required. Known values are: \"Agent\", \"Identity\", - \"Session\", \"Project\", \"Account\", and \"Custom\".""" - attribute: str - """Gets or sets the attribute path retained for legacy Custom counters. Authored rules cannot - select Custom; built-in dimensions must omit this property.""" - - -class CostControlMatch(TypedDict, total=False): - """Gets or sets optional match arrays keyed by ``agentResourceIds``, ``identityObjectIds``, - ``sessionIds``, or ``projectIds``. Each array contains 1 to 20 non-empty values. Agent resource - IDs use - /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}. - Legacy dotted identity, session, and project keys remain accepted, but cannot be combined with - their canonical key. - - :ivar agentResourceIds: Agent resource IDs use - /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}. - :vartype agentResourceIds: list[str] - :ivar identityObjectIds: The authenticated principal object IDs to match. - :vartype identityObjectIds: list[str] - :ivar sessionIds: The Foundry session IDs to match. - :vartype sessionIds: list[str] - :ivar projectIds: The Foundry project resource IDs to match. - :vartype projectIds: list[str] - """ - - agentResourceIds: list[str] - """Agent resource IDs use - /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}.""" - identityObjectIds: list[str] - """The authenticated principal object IDs to match.""" - sessionIds: list[str] - """The Foundry session IDs to match.""" - projectIds: list[str] - """The Foundry project resource IDs to match.""" - - -class CostControlPatch(TypedDict, total=False): - """The request used to update a cost control. - - :ivar properties: The cost control properties to update. - :vartype properties: "CostControlPatchProperties" - """ - - properties: "CostControlPatchProperties" - """The cost control properties to update.""" - - -class CostControlPatchProperties(TypedDict, total=False): - """The properties that can be changed on a cost control. - - :ivar displayName: An optional human-readable name for the cost control. Set this property to - null to clear it. - :vartype displayName: str - :ivar rules: The complete replacement set of cost control rules. - :vartype rules: list["CostControlRule"] - """ - - displayName: Optional[str] - """An optional human-readable name for the cost control. Set this property to null to clear it.""" - rules: list["CostControlRule"] - """The complete replacement set of cost control rules.""" - - -class CostControlProperties(TypedDict, total=False): - """The customer-authored settings of a cost control. - - :ivar displayName: An optional human-readable name for the cost control. - :vartype displayName: str - :ivar rules: The rules enforced by the cost control. Required. - :vartype rules: list["CostControlRule"] - """ - - displayName: str - """An optional human-readable name for the cost control.""" - rules: Required[list["CostControlRule"]] - """The rules enforced by the cost control. Required.""" - - -class CostControlRule(TypedDict, total=False): - """A cost limit and the population to which it applies. - - :ivar name: The stable rule identifier, unique within the cost control without regard to case. - Required. - :vartype name: str - :ivar counterKey: Gets or sets the single built-in dimension used to partition consumption. - Custom dimensions are retained only for legacy reads and metadata-only updates. Legacy - singleton arrays are accepted on read; serialization always emits an object. To track another - field, create another rule. Required. - :vartype counterKey: "CostControlDimension" - :ivar unit: The unit used for the cost control amount and absolute thresholds. Required. "Usd" - :vartype unit: Union[str, "CostControlUnit"] - :ivar amount: The maximum consumption allowed by this rule, expressed in the selected unit. - Required. - :vartype amount: float - :ivar period: Gets or sets the calendar-aligned UTC renewal period. Authored rules support Day, - Week, or Month. This field is required for recurring rules and must be omitted for - non-recurring rules. Legacy stored minute, hour, and year periods are preserved when reading - definitions. Known values are: "Minute", "Hour", "Day", "Week", "Month", and "Year". - :vartype period: Union[str, "CostControlPeriod"] - :ivar recurring: Whether the cost control renews. The default is true. - :vartype recurring: bool - :ivar match: Gets or sets optional match arrays keyed by ``agentResourceIds``, - ``identityObjectIds``, ``sessionIds``, or ``projectIds``. Each array contains 1 to 20 non-empty - values. Agent resource IDs use - /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}. - Legacy dotted identity, session, and project keys remain accepted, but cannot be combined with - their canonical key. - :vartype match: "CostControlMatch" - :ivar thresholds: Gets or sets optional thresholds. Omitted or empty thresholds track usage - without explicit actions. Authored thresholds must explicitly specify Alert or Block; Audit is - retained for legacy reads. - :vartype thresholds: list["CostControlThreshold"] - """ - - name: Required[str] - """The stable rule identifier, unique within the cost control without regard to case. Required.""" - counterKey: Required["CostControlDimension"] - """Gets or sets the single built-in dimension used to partition consumption. Custom dimensions are - retained only for legacy reads and metadata-only updates. Legacy singleton arrays are accepted - on read; serialization always emits an object. To track another field, create another rule. - Required.""" - unit: Required[Union[str, "CostControlUnit"]] - """The unit used for the cost control amount and absolute thresholds. Required. \"Usd\"""" - amount: Required[float] - """The maximum consumption allowed by this rule, expressed in the selected unit. Required.""" - period: Union[str, "CostControlPeriod"] - """Gets or sets the calendar-aligned UTC renewal period. Authored rules support Day, Week, or - Month. This field is required for recurring rules and must be omitted for non-recurring rules. - Legacy stored minute, hour, and year periods are preserved when reading definitions. Known - values are: \"Minute\", \"Hour\", \"Day\", \"Week\", \"Month\", and \"Year\".""" - recurring: bool - """Whether the cost control renews. The default is true.""" - match: "CostControlMatch" - """Gets or sets optional match arrays keyed by ``agentResourceIds``, ``identityObjectIds``, - ``sessionIds``, or ``projectIds``. Each array contains 1 to 20 non-empty values. Agent resource - IDs use - /subscriptions/{subscription_guid}/accounts/{account-name}/project/{project-name}/agent/{agent_name}. - Legacy dotted identity, session, and project keys remain accepted, but cannot be combined with - their canonical key.""" - thresholds: Optional[list["CostControlThreshold"]] - """Gets or sets optional thresholds. Omitted or empty thresholds track usage without explicit - actions. Authored thresholds must explicitly specify Alert or Block; Audit is retained for - legacy reads.""" - - -class CostControlThreshold(TypedDict, total=False): - """An action evaluated when cost control consumption reaches a threshold. - - :ivar type: How the threshold value is interpreted. Required. Known values are: "Percentage" - and "Absolute". - :vartype type: Union[str, "CostControlThresholdType"] - :ivar value: Gets or sets the threshold value. Legacy Audit definitions retain their stored - values; new thresholds support only Alert or Block. Required. - :vartype value: float - :ivar action: Gets or sets the threshold action. Authored thresholds must explicitly specify - Alert or Block. Legacy stored definitions with omitted actions continue to read as Audit. - Required. Known values are: "Audit", "Alert", and "Block". - :vartype action: Union[str, "CostControlThresholdAction"] - """ - - type: Required[Union[str, "CostControlThresholdType"]] - """How the threshold value is interpreted. Required. Known values are: \"Percentage\" and - \"Absolute\".""" - value: Required[float] - """Gets or sets the threshold value. Legacy Audit definitions retain their stored values; new - thresholds support only Alert or Block. Required.""" - action: Required[Union[str, "CostControlThresholdAction"]] - """Gets or sets the threshold action. Authored thresholds must explicitly specify Alert or Block. - Legacy stored definitions with omitted actions continue to read as Audit. Required. Known - values are: \"Audit\", \"Alert\", and \"Block\".""" - - class RaiBlocklistConfig(TypedDict, total=False): """Azure OpenAI blocklist config. @@ -2559,11 +1720,11 @@ class CustomKeysConnectionProperties(TypedDict, total=False): "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -2616,10 +1777,10 @@ class CustomKeysConnectionProperties(TypedDict, total=False): \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -2755,9 +1916,6 @@ class DeploymentProperties(TypedDict, total=False): :ivar contextCacheContainerId: The resource ID of the context cache container associated with this deployment. :vartype contextCacheContainerId: str - :ivar speculativeDecoding: Speculative decoding settings for the deployment. This configuration - applies to Fireworks model formats. - :vartype speculativeDecoding: "DeploymentSpeculativeDecoding" :ivar scaleSettings: Properties of Cognitive Services account deployment model. (Deprecated, please use Deployment.sku instead.). :vartype scaleSettings: "DeploymentScaleSettings" @@ -2800,10 +1958,6 @@ class DeploymentProperties(TypedDict, total=False): select the models subset for routing and the routing mode (balanced, quality, cost) for routing across all supported models or the model subset. :vartype routing: "DeploymentRouting" - :ivar costControlIds: The full resource IDs of cost controls directly attached to this - deployment. At the moment the service only supports a single cost control. This will be - expanded in future API versions. - :vartype costControlIds: list[str] """ provisioningState: Union[str, "DeploymentProvisioningState"] @@ -2814,9 +1968,6 @@ class DeploymentProperties(TypedDict, total=False): """Properties of Cognitive Services account deployment model.""" contextCacheContainerId: str """The resource ID of the context cache container associated with this deployment.""" - speculativeDecoding: "DeploymentSpeculativeDecoding" - """Speculative decoding settings for the deployment. This configuration applies to Fireworks model - formats.""" scaleSettings: "DeploymentScaleSettings" """Properties of Cognitive Services account deployment model. (Deprecated, please use Deployment.sku instead.).""" @@ -2856,9 +2007,6 @@ class DeploymentProperties(TypedDict, total=False): the deployed model is 'model-router' version 2025-11-18 or later. Allows you to select the models subset for routing and the routing mode (balanced, quality, cost) for routing across all supported models or the model subset.""" - costControlIds: list[str] - """The full resource IDs of cost controls directly attached to this deployment. At the moment the - service only supports a single cost control. This will be expanded in future API versions.""" class DeploymentRouting(TypedDict, total=False): @@ -2905,21 +2053,6 @@ class DeploymentScaleSettings(TypedDict, total=False): recently updated ``capacity``.""" -class DeploymentSpeculativeDecoding(TypedDict, total=False): - """Speculative decoding settings for a deployment. - - :ivar draftModel: Draft model used to generate speculative decoding tokens. Required. - :vartype draftModel: "DeploymentModel" - :ivar draftTokenCount: The number of draft tokens attempted per speculation step. - :vartype draftTokenCount: int - """ - - draftModel: Required["DeploymentModel"] - """Draft model used to generate speculative decoding tokens. Required.""" - draftTokenCount: int - """The number of draft tokens attempted per speculation step.""" - - class Encryption(TypedDict, total=False): """Properties to configure Encryption. @@ -2991,115 +2124,6 @@ class EncryptionScopeProperties(Encryption): """The encryptionScope state. Known values are: \"Disabled\" and \"Enabled\".""" -class ErrorAdditionalInfo(TypedDict, total=False): - """The resource management error additional info. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: Any - """ - - type: str - """The additional info type.""" - info: Any - """The additional info.""" - - -class ErrorDetail(TypedDict, total=False): - """The error detail. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list["ErrorDetail"] - :ivar additionalInfo: The error additional info. - :vartype additionalInfo: list["ErrorAdditionalInfo"] - """ - - code: str - """The error code.""" - message: str - """The error message.""" - target: str - """The error target.""" - details: list["ErrorDetail"] - """The error details.""" - additionalInfo: list["ErrorAdditionalInfo"] - """The error additional info.""" - - -class EvaluateDeploymentPoliciesDeployment(TypedDict, total=False): - """A hypothetical deployment definition used for policy dry-run evaluation. - - :ivar name: The name of the hypothetical deployment. Required. - :vartype name: str - :ivar properties: Properties of the hypothetical deployment. Required. - :vartype properties: "EvaluateDeploymentPoliciesDeploymentProperties" - """ - - name: Required[str] - """The name of the hypothetical deployment. Required.""" - properties: Required["EvaluateDeploymentPoliciesDeploymentProperties"] - """Properties of the hypothetical deployment. Required.""" - - -class EvaluateDeploymentPoliciesDeploymentProperties(TypedDict, total=False): # pylint: disable=name-too-long - """Properties of a hypothetical deployment for policy evaluation. - - :ivar model: The model to evaluate. Required. - :vartype model: "DeploymentModel" - :ivar raiPolicyName: The name of the RAI policy to evaluate. - :vartype raiPolicyName: str - """ - - model: Required["DeploymentModel"] - """The model to evaluate. Required.""" - raiPolicyName: str - """The name of the RAI policy to evaluate.""" - - -class EvaluateDeploymentPoliciesRequest(TypedDict, total=False): - """Request body for the evaluateDeploymentPolicies action. - - :ivar deployments: The list of hypothetical deployments to evaluate against Azure Policy. - Required. - :vartype deployments: list["EvaluateDeploymentPoliciesDeployment"] - """ - - deployments: Required[list["EvaluateDeploymentPoliciesDeployment"]] - """The list of hypothetical deployments to evaluate against Azure Policy. Required.""" - - -class FoundryAutoUpgrade(TypedDict, total=False): - """Represents the foundry auto-upgrade configuration for a Cognitive Services account. Customers - can opt out of auto-upgrade by setting mode to Disabled. - - :ivar mode: Gets or sets the auto-upgrade mode. Known values are: "Enabled" and "Disabled". - :vartype mode: Union[str, "FoundryAutoUpgradeMode"] - :ivar plannedByMicrosoft: Gets or sets a value indicating whether the auto-upgrade is planned - by Microsoft. - :vartype plannedByMicrosoft: bool - :ivar statusReason: Gets or sets the status reason for the auto-upgrade configuration. - :vartype statusReason: str - :ivar scheduledAt: Gets or sets the scheduled time for the auto-upgrade. - :vartype scheduledAt: str - """ - - mode: Union[str, "FoundryAutoUpgradeMode"] - """Gets or sets the auto-upgrade mode. Known values are: \"Enabled\" and \"Disabled\".""" - plannedByMicrosoft: bool - """Gets or sets a value indicating whether the auto-upgrade is planned by Microsoft.""" - statusReason: str - """Gets or sets the status reason for the auto-upgrade configuration.""" - scheduledAt: str - """Gets or sets the scheduled time for the auto-upgrade.""" - - class FqdnOutboundRule(TypedDict, total=False): """FQDN Outbound Rule for the managed network of a cognitive services account. @@ -3136,19 +2160,6 @@ class FqdnOutboundRule(TypedDict, total=False): """Type of a managed network Outbound Rule of a cognitive services account. Required. FQDN.""" -class GatedModelAccessProperties(TypedDict, total=False): - """Gated model access configuration for a managed compute deployment. - - :ivar connectionId: The fully qualified Azure resource ID of the project connection used to - authorize access to a gated model during deployment creation. Required. - :vartype connectionId: str - """ - - connectionId: Required[str] - """The fully qualified Azure resource ID of the project connection used to authorize access to a - gated model during deployment creation. Required.""" - - class HostedAgentDeployment(TypedDict, total=False): """Represents a hosted agent deployment where the underlying infrastructure is owned by the platform. @@ -3327,206 +2338,6 @@ class ManagedAgentDeployment(TypedDict, total=False): the platform in the deployer's subscription.""" -class ManagedClusterAgentHostingConfiguration(TypedDict, total=False): - """Configuration for hosting Foundry agents on an Azure Kubernetes Service managed cluster. - - :ivar name: Unique name of the hosting configuration within the Foundry account. Required. - :vartype name: str - :ivar hostingType: Type of infrastructure used to host Foundry agents. Required. Agents are - hosted on an Azure Kubernetes Service managed cluster. - :vartype hostingType: Literal[AgentHostingType.MANAGED_CLUSTER] - :ivar hostingManagementIdentityResourceId: Azure resource ID of the user-assigned managed - identity used by the Foundry resource provider to manage the hosting configuration. The - identity must be assigned to the Foundry account in identity.userAssignedIdentities. Required. - :vartype hostingManagementIdentityResourceId: str - :ivar workloadIdentityResourceId: Azure resource ID of the separate user-assigned managed - identity federated to service accounts on the AKS cluster. Hosted agents use this identity to - access the Azure Storage blob data plane. Required. - :vartype workloadIdentityResourceId: str - :ivar clusterResourceId: Azure resource ID of the customer-owned AKS managed cluster that runs - the hosted agent workloads. Required. - :vartype clusterResourceId: str - :ivar storageAccountResourceId: Azure resource ID of the customer-owned storage account used by - the hosted agents. The storage account must be in the same subscription and region as the AKS - cluster, and its data-plane endpoint must be reachable from the workload network. Required. - :vartype storageAccountResourceId: str - """ - - name: Required[str] - """Unique name of the hosting configuration within the Foundry account. Required.""" - hostingType: Required[Literal[AgentHostingType.MANAGED_CLUSTER]] - """Type of infrastructure used to host Foundry agents. Required. Agents are hosted on an Azure - Kubernetes Service managed cluster.""" - hostingManagementIdentityResourceId: Required[str] - """Azure resource ID of the user-assigned managed identity used by the Foundry resource provider - to manage the hosting configuration. The identity must be assigned to the Foundry account in - identity.userAssignedIdentities. Required.""" - workloadIdentityResourceId: Required[str] - """Azure resource ID of the separate user-assigned managed identity federated to service accounts - on the AKS cluster. Hosted agents use this identity to access the Azure Storage blob data - plane. Required.""" - clusterResourceId: Required[str] - """Azure resource ID of the customer-owned AKS managed cluster that runs the hosted agent - workloads. Required.""" - storageAccountResourceId: Required[str] - """Azure resource ID of the customer-owned storage account used by the hosted agents. The storage - account must be in the same subscription and region as the AKS cluster, and its data-plane - endpoint must be reachable from the workload network. Required.""" - - -class ManagedComputeDeployment(ProxyResource): - """Cognitive Services account managed compute deployment, backed by managed compute (GPU) - resources. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: Properties of the Cognitive Services managed compute deployment. - :vartype properties: "ManagedComputeDeploymentProperties" - :ivar sku: The resource model definition representing SKU. - :vartype sku: "Sku" - :ivar etag: Resource Etag. - :vartype etag: str - """ - - properties: "ManagedComputeDeploymentProperties" - """Properties of the Cognitive Services managed compute deployment.""" - sku: "Sku" - """The resource model definition representing SKU.""" - etag: str - """Resource Etag.""" - - -class ManagedComputeDeploymentProperties(TypedDict, total=False): - """Properties of a Cognitive Services managed compute deployment. - - :ivar model: AzureML Registry model asset URI. Required on creation; immutable after creation. - Example: azureml://registries/{registry}/models/{model}/versions/{version}. Required. - :vartype model: str - :ivar deploymentTemplate: Deployment template identifier. Optional on creation. Accepts an - AzureML Registry deployment template URI or a project-scoped deployment template path for - VmManagedCompute. Examples: - azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}, - projects/{project}/deploymentTemplates/{template}/versions/{version}. - :vartype deploymentTemplate: str - :ivar acceleratorType: Accelerator type (e.g., H100_80GB). Optional on creation; immutable - after creation. - :vartype acceleratorType: str - :ivar versionUpgradeOption: Template auto-upgrade policy. Defaults to - OnceNewDefaultVersionAvailable. Known values are: "OnceNewDefaultVersionAvailable", - "OnceCurrentVersionExpired", and "NoAutoUpgrade". - :vartype versionUpgradeOption: Union[str, "DeploymentModelVersionUpgradeOption"] - :ivar gatedModelAccess: Configuration used to authorize access to a gated model during - deployment creation. - :vartype gatedModelAccess: "GatedModelAccessProperties" - :ivar capabilities: Deployment capabilities represented as key-value pairs. Example: { - assetsV2: "true" }. - :vartype capabilities: dict[str, str] - :ivar computeId: Foundry compute ARM resource ID for VM-backed managed compute deployments. - Required when sku.name is VmManagedCompute; immutable after creation. - :vartype computeId: str - :ivar priority: Scheduling priority for VM-backed managed compute deployments. Immutable after - creation. - :vartype priority: str - :ivar acceleratorsPerInstance: Read-only. Number of accelerators (GPUs) consumed by each model - instance, sourced from the deployment template. - :vartype acceleratorsPerInstance: int - :ivar totalAccelerators: Read-only. Total accelerators allocated: sku.capacity (instances) x - acceleratorsPerInstance. - :vartype totalAccelerators: int - :ivar provisioningState: Read-only. Current provisioning state. Known values are: "Accepted", - "Creating", "Deleting", "Moving", "Failed", "Succeeded", "Canceled", "ResolvingDNS", and - "ExtensionUnreachable". - :vartype provisioningState: Union[str, "ProvisioningState"] - :ivar provisioningDetails: Read-only. Status message and timestamp from the last provisioning - operation. - :vartype provisioningDetails: "ManagedComputeDeploymentProvisioningDetails" - :ivar routes: Read-only. Inference route paths relative to the account endpoint. Populated when - provisioningState is Succeeded. - :vartype routes: "ManagedComputeDeploymentRoutes" - """ - - model: Required[str] - """AzureML Registry model asset URI. Required on creation; immutable after creation. Example: - azureml://registries/{registry}/models/{model}/versions/{version}. Required.""" - deploymentTemplate: str - """Deployment template identifier. Optional on creation. Accepts an AzureML Registry deployment - template URI or a project-scoped deployment template path for VmManagedCompute. Examples: - azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}, - projects/{project}/deploymentTemplates/{template}/versions/{version}.""" - acceleratorType: str - """Accelerator type (e.g., H100_80GB). Optional on creation; immutable after creation.""" - versionUpgradeOption: Union[str, "DeploymentModelVersionUpgradeOption"] - """Template auto-upgrade policy. Defaults to OnceNewDefaultVersionAvailable. Known values are: - \"OnceNewDefaultVersionAvailable\", \"OnceCurrentVersionExpired\", and \"NoAutoUpgrade\".""" - gatedModelAccess: "GatedModelAccessProperties" - """Configuration used to authorize access to a gated model during deployment creation.""" - capabilities: dict[str, str] - """Deployment capabilities represented as key-value pairs. Example: { assetsV2: \"true\" }.""" - computeId: str - """Foundry compute ARM resource ID for VM-backed managed compute deployments. Required when - sku.name is VmManagedCompute; immutable after creation.""" - priority: str - """Scheduling priority for VM-backed managed compute deployments. Immutable after creation.""" - acceleratorsPerInstance: int - """Read-only. Number of accelerators (GPUs) consumed by each model instance, sourced from the - deployment template.""" - totalAccelerators: int - """Read-only. Total accelerators allocated: sku.capacity (instances) x acceleratorsPerInstance.""" - provisioningState: Union[str, "ProvisioningState"] - """Read-only. Current provisioning state. Known values are: \"Accepted\", \"Creating\", - \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", \"Canceled\", \"ResolvingDNS\", and - \"ExtensionUnreachable\".""" - provisioningDetails: "ManagedComputeDeploymentProvisioningDetails" - """Read-only. Status message and timestamp from the last provisioning operation.""" - routes: "ManagedComputeDeploymentRoutes" - """Read-only. Inference route paths relative to the account endpoint. Populated when - provisioningState is Succeeded.""" - - -class ManagedComputeDeploymentProvisioningDetails(TypedDict, total=False): # pylint: disable=name-too-long - """Provisioning status details for a managed compute deployment. - - :ivar message: A human-readable status message from the last provisioning operation. - :vartype message: str - :ivar lastOperationTimestamp: Timestamp of the last provisioning operation. - :vartype lastOperationTimestamp: str - """ - - message: str - """A human-readable status message from the last provisioning operation.""" - lastOperationTimestamp: str - """Timestamp of the last provisioning operation.""" - - -class ManagedComputeDeploymentRoutes(TypedDict, total=False): - """Inference route paths for a managed compute deployment, relative to the account endpoint. - Populated when provisioningState is Succeeded. - - :ivar chatCompletionsScoringPath: Relative path to the chat completions scoring endpoint. - :vartype chatCompletionsScoringPath: str - :ivar swagger: Relative path to the Swagger/OpenAPI endpoint. - :vartype swagger: str - :ivar messagesApiScoringPath: Relative path to the messages API scoring endpoint. - :vartype messagesApiScoringPath: str - """ - - chatCompletionsScoringPath: str - """Relative path to the chat completions scoring endpoint.""" - swagger: str - """Relative path to the Swagger/OpenAPI endpoint.""" - messagesApiScoringPath: str - """Relative path to the messages API scoring endpoint.""" - - class ManagedIdentityAuthTypeConnectionProperties(TypedDict, total=False): # pylint: disable=name-too-long """ManagedIdentityAuthTypeConnectionProperties. @@ -3543,11 +2354,11 @@ class ManagedIdentityAuthTypeConnectionProperties(TypedDict, total=False): # py "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -3600,10 +2411,10 @@ class ManagedIdentityAuthTypeConnectionProperties(TypedDict, total=False): # py \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -3907,11 +2718,11 @@ class NoneAuthTypeConnectionProperties(TypedDict, total=False): "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -3962,10 +2773,10 @@ class NoneAuthTypeConnectionProperties(TypedDict, total=False): \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -4012,11 +2823,11 @@ class OAuth2AuthTypeConnectionProperties(TypedDict, total=False): "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -4070,10 +2881,10 @@ class OAuth2AuthTypeConnectionProperties(TypedDict, total=False): \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -4159,11 +2970,11 @@ class PATAuthTypeConnectionProperties(TypedDict, total=False): "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -4216,10 +3027,10 @@ class PATAuthTypeConnectionProperties(TypedDict, total=False): \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -4251,17 +3062,6 @@ class PATAuthTypeConnectionProperties(TypedDict, total=False): """Authentication type of the connection target. Required. PAT.""" -class PatchResourceSku(TypedDict, total=False): - """The object being used to update sku of a resource, in general used for PATCH operations. - - :ivar sku: The resource model definition representing SKU. - :vartype sku: "Sku" - """ - - sku: "Sku" - """The resource model definition representing SKU.""" - - class PatchResourceTags(TypedDict, total=False): """The object being used to update tags of a resource, in general used for PATCH operations. @@ -4287,29 +3087,6 @@ class PatchResourceTagsAndSku(PatchResourceTags): """The resource model definition representing SKU.""" -class Pool(TypedDict, total=False): - """A compute pool configuration. - - :ivar name: The name of the pool. Required. - :vartype name: str - :ivar vmPriority: The VM priority of the pool. Known values are: "Regular" and "Spot". - :vartype vmPriority: Union[str, "VmPriority"] - :ivar instanceType: The instance type (VM SKU) used in the pool. Required. - :vartype instanceType: str - :ivar nodeCount: The number of nodes in the pool. Required. - :vartype nodeCount: int - """ - - name: Required[str] - """The name of the pool. Required.""" - vmPriority: Union[str, "VmPriority"] - """The VM priority of the pool. Known values are: \"Regular\" and \"Spot\".""" - instanceType: Required[str] - """The instance type (VM SKU) used in the pool. Required.""" - nodeCount: Required[int] - """The number of nodes in the pool. Required.""" - - class PrivateEndpoint(TypedDict, total=False): """The private endpoint resource. @@ -4559,7 +3336,7 @@ class ProjectProperties(TypedDict, total=False): :ivar provisioningState: Gets the status of the cognitive services project at the time the operation was called. Known values are: "Accepted", "Creating", "Deleting", "Moving", "Failed", - "Succeeded", "Canceled", "ResolvingDNS", and "ExtensionUnreachable". + "Succeeded", "Canceled", and "ResolvingDNS". :vartype provisioningState: Union[str, "ProvisioningState"] :ivar displayName: The display name of the Cognitive Services Project. :vartype displayName: str @@ -4569,16 +3346,12 @@ class ProjectProperties(TypedDict, total=False): :vartype endpoints: dict[str, str] :ivar isDefault: Indicates whether the project is the default project for the account. :vartype isDefault: bool - :ivar capabilitySettings: Effective agent capability settings for the project. Optional partial - override of the account defaults; omitted fields inherit from the parent account when present. - Settable only at create time. - :vartype capabilitySettings: "CapabilitySettings" """ provisioningState: Union[str, "ProvisioningState"] """Gets the status of the cognitive services project at the time the operation was called. Known values are: \"Accepted\", \"Creating\", \"Deleting\", \"Moving\", \"Failed\", \"Succeeded\", - \"Canceled\", \"ResolvingDNS\", and \"ExtensionUnreachable\".""" + \"Canceled\", and \"ResolvingDNS\".""" displayName: str """The display name of the Cognitive Services Project.""" description: str @@ -4587,10 +3360,6 @@ class ProjectProperties(TypedDict, total=False): """The list of endpoint for this Cognitive Services Project.""" isDefault: bool """Indicates whether the project is the default project for the account.""" - capabilitySettings: "CapabilitySettings" - """Effective agent capability settings for the project. Optional partial override of the account - defaults; omitted fields inherit from the parent account when present. Settable only at create - time.""" class QuotaLimit(TypedDict, total=False): @@ -4686,293 +3455,6 @@ class QuotaTierUpgradeEligibilityInfo(TypedDict, total=False): """Reason in case the subscription is not eligible for upgrade to the next tier.""" -class RaiAcsEmptyObject(TypedDict, total=False): - """An object that must contain no properties.""" - - -class RaiAcsHarmConfiguration(TypedDict, total=False): - """Selects one Azure AI Content Safety harm-detector configuration. - - :ivar category: The logical harm category exposed under input.snapshot.moderation.harm. - Required. Known values are: "Hate", "SelfHarm", "Sexual", "Violence", "PromptInjection", - "ProtectedMaterialText", and "ProtectedMaterialCode". - :vartype category: Union[str, "RaiAcsHarmCategory"] - :ivar harm_config_id: The Azure AI Content Safety detector configuration identifier. When - supplied, it must be the configuration supported for the selected category. - :vartype harm_config_id: str - """ - - category: Required[Union[str, "RaiAcsHarmCategory"]] - """The logical harm category exposed under input.snapshot.moderation.harm. Required. Known values - are: \"Hate\", \"SelfHarm\", \"Sexual\", \"Violence\", \"PromptInjection\", - \"ProtectedMaterialText\", and \"ProtectedMaterialCode\".""" - harm_config_id: str - """The Azure AI Content Safety detector configuration identifier. When supplied, it must be the - configuration supported for the selected category.""" - - -class RaiAcsInterventionPoint(TypedDict, total=False): - """Binds one logical policy to an Agent Control Specification intervention point. - - :ivar policy_target: The canonical Agent Hooks snapshot path projected as the policy target. - Required. Known values are: "$snap.input", "$snap.output", "$snap.tool_call.args", and - "$snap.tool_result.value". - :vartype policy_target: Union[str, "RaiAcsPolicyTarget"] - :ivar policy_target_kind: The semantic kind of the projected policy target. Required. Known - values are: "user_input", "assistant_output", "tool_args", and "tool_result". - :vartype policy_target_kind: Union[str, "RaiAcsPolicyTargetKind"] - :ivar policy: The logical policy evaluated at this intervention point. Required. - :vartype policy: "RaiAcsPolicyBinding" - :ivar annotations: Standard Agent Control Specification annotation bindings are disabled; when - present, this object must be empty. - :vartype annotations: "RaiAcsEmptyObject" - """ - - policy_target: Required[Union[str, "RaiAcsPolicyTarget"]] - """The canonical Agent Hooks snapshot path projected as the policy target. Required. Known values - are: \"$snap.input\", \"$snap.output\", \"$snap.tool_call.args\", and - \"$snap.tool_result.value\".""" - policy_target_kind: Required[Union[str, "RaiAcsPolicyTargetKind"]] - """The semantic kind of the projected policy target. Required. Known values are: \"user_input\", - \"assistant_output\", \"tool_args\", and \"tool_result\".""" - policy: Required["RaiAcsPolicyBinding"] - """The logical policy evaluated at this intervention point. Required.""" - annotations: "RaiAcsEmptyObject" - """Standard Agent Control Specification annotation bindings are disabled; when present, this - object must be empty.""" - - -class RaiAcsInterventionPoints(TypedDict, total=False): - """Intervention points supported by the Azure AI Content Safety Unified Moderate host profile. - - :ivar input: The policy evaluated for user input. - :vartype input: "RaiAcsInterventionPoint" - :ivar pre_tool_call: The policy evaluated before a tool call. - :vartype pre_tool_call: "RaiAcsToolInterventionPoint" - :ivar post_tool_call: The policy evaluated after a tool call. - :vartype post_tool_call: "RaiAcsToolInterventionPoint" - :ivar output: The policy evaluated for final output. - :vartype output: "RaiAcsInterventionPoint" - """ - - input: "RaiAcsInterventionPoint" - """The policy evaluated for user input.""" - pre_tool_call: "RaiAcsToolInterventionPoint" - """The policy evaluated before a tool call.""" - post_tool_call: "RaiAcsToolInterventionPoint" - """The policy evaluated after a tool call.""" - output: "RaiAcsInterventionPoint" - """The policy evaluated for final output.""" - - -class RaiAcsManifest(TypedDict, total=False): - """The closed Rego-only Agent Control Specification (ACS) profile supported by Azure AI Content - Safety Unified Moderate. - - :ivar agent_control_specification_version: The declared Agent Control Specification manifest - version. Required. - :vartype agent_control_specification_version: str - :ivar metadata: Non-policy manifest metadata. - :vartype metadata: dict[str, Any] - :ivar policies: Named Rego policies in this manifest. Required. - :vartype policies: dict[str, "RaiAcsRegoPolicyDefinition"] - :ivar intervention_points: Agent Control Specification intervention-point bindings. At least - one intervention point is required. Required. - :vartype intervention_points: "RaiAcsInterventionPoints" - :ivar tools: Static tool catalog keyed by canonical tool name. The catalog may be omitted or - empty when no tool selector is configured. A tool selector requires a non-empty catalog, and an - unknown selected key fails closed. - :vartype tools: dict[str, "RaiAcsToolDefinition"] - :ivar annotators: Standard Agent Control Specification annotator dispatch is disabled; when - present, this object must be empty. - :vartype annotators: "RaiAcsEmptyObject" - """ - - agent_control_specification_version: Required[str] - """The declared Agent Control Specification manifest version. Required.""" - metadata: dict[str, Any] - """Non-policy manifest metadata.""" - policies: Required[dict[str, "RaiAcsRegoPolicyDefinition"]] - """Named Rego policies in this manifest. Required.""" - intervention_points: Required["RaiAcsInterventionPoints"] - """Agent Control Specification intervention-point bindings. At least one intervention point is - required. Required.""" - tools: dict[str, "RaiAcsToolDefinition"] - """Static tool catalog keyed by canonical tool name. The catalog may be omitted or empty when no - tool selector is configured. A tool selector requires a non-empty catalog, and an unknown - selected key fails closed.""" - annotators: "RaiAcsEmptyObject" - """Standard Agent Control Specification annotator dispatch is disabled; when present, this object - must be empty.""" - - -class RaiAcsModerationBindingExtension(TypedDict, total=False): - """Azure AI Content Safety moderation work performed before the Agent Control Specification - runtime evaluates the selected Rego query. - - :ivar subject_format: How the selected policy target is represented to moderation capabilities. - Required. Known values are: "text" and "canonical_json". - :vartype subject_format: Union[str, "RaiAcsModerationSubjectFormat"] - :ivar harm_configs: Harm signals requested for this intervention point. Required. - :vartype harm_configs: list["RaiAcsHarmConfiguration"] - """ - - subject_format: Required[Union[str, "RaiAcsModerationSubjectFormat"]] - """How the selected policy target is represented to moderation capabilities. Required. Known - values are: \"text\" and \"canonical_json\".""" - harm_configs: Required[list["RaiAcsHarmConfiguration"]] - """Harm signals requested for this intervention point. Required.""" - - -class RaiAcsPolicyBinding(TypedDict, total=False): - """Identifies the logical policy evaluated at an Agent Control Specification intervention point. - - :ivar id: The logical policy identifier. Required. - :vartype id: str - :ivar query: An optional intervention-specific Rego query override. - :vartype query: str - :ivar aacs_moderation: Optional Azure AI Content Safety moderation capabilities invoked before - Rego evaluation. - :vartype aacs_moderation: "RaiAcsModerationBindingExtension" - """ - - id: Required[str] - """The logical policy identifier. Required.""" - query: str - """An optional intervention-specific Rego query override.""" - aacs_moderation: "RaiAcsModerationBindingExtension" - """Optional Azure AI Content Safety moderation capabilities invoked before Rego evaluation.""" - - -class RaiAcsRegoPolicyDefinition(TypedDict, total=False): - """A Rego policy definition in the Azure AI Content Safety Unified Moderate host profile. - - :ivar type: The policy language. This profile supports only Rego. Required. "rego" - :vartype type: Union[str, "RaiAcsPolicyDefinitionType"] - :ivar query: The fully qualified Rego query evaluated for this policy. Required. - :vartype query: str - """ - - type: Required[Union[str, "RaiAcsPolicyDefinitionType"]] - """The policy language. This profile supports only Rego. Required. \"rego\"""" - query: Required[str] - """The fully qualified Rego query evaluated for this policy. Required.""" - - -class RaiAcsToolDefinition(TypedDict, total=False): - """Static policy metadata for one Agent Control Specification tool catalog entry. - - :ivar id: Optional host-defined tool identifier. The catalog map key, not this value, controls - tool lookup. - :vartype id: str - :ivar type: Optional host-defined tool type. - :vartype type: str - :ivar description: Human-readable policy metadata. - :vartype description: str - :ivar security_labels: Labels describing the sink or capability. - :vartype security_labels: list[str] - :ivar clearance: Maximum sensitivity or host-defined clearance metadata. - :vartype clearance: str - """ - - id: str - """Optional host-defined tool identifier. The catalog map key, not this value, controls tool - lookup.""" - type: str - """Optional host-defined tool type.""" - description: str - """Human-readable policy metadata.""" - security_labels: list[str] - """Labels describing the sink or capability.""" - clearance: str - """Maximum sensitivity or host-defined clearance metadata.""" - - -class RaiAcsToolInterventionPoint(TypedDict, total=False): - """Binds one logical policy to a tool-call intervention point. - - :ivar policy_target: The canonical Agent Hooks snapshot path projected as the policy target. - Required. Known values are: "$snap.input", "$snap.output", "$snap.tool_call.args", and - "$snap.tool_result.value". - :vartype policy_target: Union[str, "RaiAcsPolicyTarget"] - :ivar policy_target_kind: The semantic kind of the projected policy target. Required. Known - values are: "user_input", "assistant_output", "tool_args", and "tool_result". - :vartype policy_target_kind: Union[str, "RaiAcsPolicyTargetKind"] - :ivar policy: The logical policy evaluated at this intervention point. Required. - :vartype policy: "RaiAcsPolicyBinding" - :ivar annotations: Standard Agent Control Specification annotation bindings are disabled; when - present, this object must be empty. - :vartype annotations: "RaiAcsEmptyObject" - :ivar tool_name_from: Selects the tool catalog key from the raw Agent Hooks snapshot using an - extensible snapshot path. Known values are: "$snap.tool_call.name" and "$.tool_call.name". - :vartype tool_name_from: Union[str, "RaiAcsToolNameSelector"] - """ - - policy_target: Required[Union[str, "RaiAcsPolicyTarget"]] - """The canonical Agent Hooks snapshot path projected as the policy target. Required. Known values - are: \"$snap.input\", \"$snap.output\", \"$snap.tool_call.args\", and - \"$snap.tool_result.value\".""" - policy_target_kind: Required[Union[str, "RaiAcsPolicyTargetKind"]] - """The semantic kind of the projected policy target. Required. Known values are: \"user_input\", - \"assistant_output\", \"tool_args\", and \"tool_result\".""" - policy: Required["RaiAcsPolicyBinding"] - """The logical policy evaluated at this intervention point. Required.""" - annotations: "RaiAcsEmptyObject" - """Standard Agent Control Specification annotation bindings are disabled; when present, this - object must be empty.""" - tool_name_from: Union[str, "RaiAcsToolNameSelector"] - """Selects the tool catalog key from the raw Agent Hooks snapshot using an extensible snapshot - path. Known values are: \"$snap.tool_call.name\" and \"$.tool_call.name\".""" - - -class RaiBinding(ProxyResource): - """An account-scoped binding from an Azure resource to an Agent Control Specification policy. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: Properties of the RAI binding. - :vartype properties: "RaiBindingProperties" - :ivar etag: Resource ETag. - :vartype etag: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - properties: "RaiBindingProperties" - """Properties of the RAI binding.""" - etag: str - """Resource ETag.""" - tags: dict[str, str] - """Resource tags.""" - - -class RaiBindingProperties(TypedDict, total=False): - """Properties of a binding from an Azure resource to an Agent Control Specification policy. - - :ivar boundResourceId: A valid Azure Resource Manager resource ID of the resource to bind to - the target RAI policy. Required. - :vartype boundResourceId: str - :ivar targetPolicyName: The same-account Agent Control Specification policy name targeted by - the binding. Required. - :vartype targetPolicyName: str - """ - - boundResourceId: Required[str] - """A valid Azure Resource Manager resource ID of the resource to bind to the target RAI policy. - Required.""" - targetPolicyName: Required[str] - """The same-account Agent Control Specification policy name targeted by the binding. Required.""" - - class RaiBlocklist(ProxyResource): """Cognitive Services RaiBlocklist. @@ -5458,43 +3940,9 @@ class RaiPolicyContentFilter(TypedDict, total=False): \"ANNOTATING\", \"HITL\", and \"RETRY\".""" -class RaiPolicyCustomExternalSafetyProviderReference(TypedDict, total=False): # pylint: disable=name-too-long - """A customer-visible reference to a subscription-level external safety provider. - - :ivar externalSafetyProviderName: The registered external safety-provider name. Required. - :vartype externalSafetyProviderName: str - :ivar managedIdentityResourceId: Optional managed identity used when invoking the external - safety provider. - :vartype managedIdentityResourceId: str - :ivar source: The request stage at which the provider runs. Required. Known values are: - "Prompt", "Completion", "PreToolCall", "PostToolCall", "PreRun", and "PostRun". - :vartype source: Union[str, "RaiPolicyContentSource"] - :ivar blocking: Whether a provider rejection blocks the request. - :vartype blocking: bool - """ - - externalSafetyProviderName: Required[str] - """The registered external safety-provider name. Required.""" - managedIdentityResourceId: str - """Optional managed identity used when invoking the external safety provider.""" - source: Required[Union[str, "RaiPolicyContentSource"]] - """The request stage at which the provider runs. Required. Known values are: \"Prompt\", - \"Completion\", \"PreToolCall\", \"PostToolCall\", \"PreRun\", and \"PostRun\".""" - blocking: bool - """Whether a provider rejection blocks the request.""" - - class RaiPolicyProperties(TypedDict, total=False): """Azure OpenAI Content Filters properties. - :ivar format: The policy representation. Omission selects ContentFilters when creating a - policy. ACS policy creation and replacement require ACS. Known values are: "ContentFilters" and - "ACS". - :vartype format: Union[str, "RaiPolicyFormat"] - :ivar acs: The ACS manifest. Required by service validation when format is ACS. - :vartype acs: "RaiAcsManifest" - :ivar acsRegos: Reusable same-account Rego resources loaded with the ACS manifest. - :vartype acsRegos: list["RaiRegoReference"] :ivar type: Content Filters policy type. Known values are: "UserManaged" and "SystemManaged". :vartype type: Union[str, "RaiPolicyType"] :ivar mode: Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, @@ -5510,21 +3958,11 @@ class RaiPolicyProperties(TypedDict, total=False): :vartype customBlocklists: list["CustomBlocklistConfig"] :ivar safetyProviders: The list of Safety Providers. :vartype safetyProviders: list["SafetyProviderConfig"] - :ivar customExternalSafetyProviders: Optional external safety-provider references used by this - policy. - :vartype customExternalSafetyProviders: list["RaiPolicyCustomExternalSafetyProviderReference"] :ivar egressPolicy: Egress (outbound network) policy controlling which external endpoints sandboxed agents can reach. Includes rules with Allow/Deny/Transform/Rewrite actions. :vartype egressPolicy: "RaiEgressPolicyConfig" """ - format: Union[str, "RaiPolicyFormat"] - """The policy representation. Omission selects ContentFilters when creating a policy. ACS policy - creation and replacement require ACS. Known values are: \"ContentFilters\" and \"ACS\".""" - acs: "RaiAcsManifest" - """The ACS manifest. Required by service validation when format is ACS.""" - acsRegos: list["RaiRegoReference"] - """Reusable same-account Rego resources loaded with the ACS manifest.""" type: Union[str, "RaiPolicyType"] """Content Filters policy type. Known values are: \"UserManaged\" and \"SystemManaged\".""" mode: Union[str, "RaiPolicyMode"] @@ -5540,71 +3978,11 @@ class RaiPolicyProperties(TypedDict, total=False): """The list of custom Blocklist.""" safetyProviders: list["SafetyProviderConfig"] """The list of Safety Providers.""" - customExternalSafetyProviders: list["RaiPolicyCustomExternalSafetyProviderReference"] - """Optional external safety-provider references used by this policy.""" egressPolicy: "RaiEgressPolicyConfig" """Egress (outbound network) policy controlling which external endpoints sandboxed agents can reach. Includes rules with Allow/Deny/Transform/Rewrite actions.""" -class RaiRego(ProxyResource): - """An account-scoped reusable Rego artifact. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: Properties of the reusable Rego artifact. - :vartype properties: "RaiRegoProperties" - :ivar etag: Resource ETag. - :vartype etag: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - properties: "RaiRegoProperties" - """Properties of the reusable Rego artifact.""" - etag: str - """Resource ETag.""" - tags: dict[str, str] - """Resource tags.""" - - -class RaiRegoProperties(TypedDict, total=False): - """Properties of an account-scoped reusable Rego resource. - - :ivar encoding: How the Rego source is encoded on the wire. The default is None. Known values - are: "None" and "Base64". - :vartype encoding: Union[str, "RaiRegoEncoding"] - :ivar rego: Rego source in the selected transport encoding. Required. - :vartype rego: str - """ - - encoding: Union[str, "RaiRegoEncoding"] - """How the Rego source is encoded on the wire. The default is None. Known values are: \"None\" and - \"Base64\".""" - rego: Required[str] - """Rego source in the selected transport encoding. Required.""" - - -class RaiRegoReference(TypedDict, total=False): - """References one reusable Rego resource on the same account. - - :ivar regoName: The same-account Rego resource name. Required. - :vartype regoName: str - """ - - regoName: Required[str] - """The same-account Rego resource name. Required.""" - - class RaiSafetyProviderConfig(TypedDict, total=False): """Azure OpenAI RAI safety provider config. @@ -5851,11 +4229,11 @@ class SASAuthTypeConnectionProperties(TypedDict, total=False): "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -5908,10 +4286,10 @@ class SASAuthTypeConnectionProperties(TypedDict, total=False): \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -5959,11 +4337,11 @@ class ServicePrincipalAuthTypeConnectionProperties(TypedDict, total=False): # p "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -6016,10 +4394,10 @@ class ServicePrincipalAuthTypeConnectionProperties(TypedDict, total=False): # p \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -6188,21 +4566,6 @@ class SkuChangeInfo(TypedDict, total=False): """Gets the last change date.""" -class SshSettings(TypedDict, total=False): - """SSH configuration for a Container Instance compute. - - :ivar sshPublicKey: The SSH public key for authenticating to the compute instance. - :vartype sshPublicKey: str - :ivar adminEnabled: Whether SSH admin access is enabled. - :vartype adminEnabled: bool - """ - - sshPublicKey: str - """The SSH public key for authenticating to the compute instance.""" - adminEnabled: bool - """Whether SSH admin access is enabled.""" - - class SystemData(TypedDict, total=False): """Metadata pertaining to creation and last modification of the resource. @@ -6287,6 +4650,35 @@ class TrafficRoutingRule(TypedDict, total=False): """Gets or sets the percentage of traffic allocated to this instance.""" +class TrustedCertificateSource(TypedDict, total=False): + """An Azure resource containing the CA certificate bundles trusted by supported features in the + account. + + :ivar type: Type of resource containing the certificate bundles. Currently only AzureKeyVault + is supported. Required. "AzureKeyVault" + :vartype type: Union[str, "TrustedCertificateSourceType"] + :ivar resourceId: Azure resource ID of the Key Vault containing the referenced secrets. The + account identity must have permission to read these secrets. Required. + :vartype resourceId: str + :ivar certificateBundleReferences: References to secrets containing one or more PEM-encoded CA + certificates. Each secret name and version pair must be unique within the source, using + case-insensitive comparison. The same secret name can be referenced with different versions. + Required. + :vartype certificateBundleReferences: list["CertificateBundleReference"] + """ + + type: Required[Union[str, "TrustedCertificateSourceType"]] + """Type of resource containing the certificate bundles. Currently only AzureKeyVault is supported. + Required. \"AzureKeyVault\"""" + resourceId: Required[str] + """Azure resource ID of the Key Vault containing the referenced secrets. The account identity must + have permission to read these secrets. Required.""" + certificateBundleReferences: Required[list["CertificateBundleReference"]] + """References to secrets containing one or more PEM-encoded CA certificates. Each secret name and + version pair must be unique within the source, using case-insensitive comparison. The same + secret name can be referenced with different versions. Required.""" + + class UserAssignedIdentity(TypedDict, total=False): """User-assigned managed identity. @@ -6318,11 +4710,11 @@ class UsernamePasswordAuthTypeConnectionProperties(TypedDict, total=False): # p "Spark", "SqlServer", "Sybase", "Teradata", "Vertica", "Pinecone", "Databricks", "Cassandra", "Couchbase", "MongoDbV2", "MongoDbAtlas", "AmazonS3Compatible", "FileServer", "FtpServer", "GoogleCloudStorage", "Hdfs", "OracleCloudStorage", "Sftp", "GenericHttp", "ODataRest", "Odbc", - "GenericRest", "RemoteTool", "OpenAPI", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", - "DynamicsCrm", "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", - "Responsys", "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", - "SalesforceServiceCloud", "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", - "ServiceNow", "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", + "GenericRest", "RemoteTool", "AmazonMws", "Concur", "Dynamics", "DynamicsAx", "DynamicsCrm", + "GoogleAdWords", "Hubspot", "Jira", "Magento", "Marketo", "Office365", "Eloqua", "Responsys", + "OracleServiceCloud", "PayPal", "QuickBooks", "Salesforce", "SalesforceServiceCloud", + "SalesforceMarketingCloud", "SapCloudForCustomer", "SapEcc", "ServiceNow", + "SharePointOnlineList", "Shopify", "Square", "WebTable", "Xero", "Zoho", "GenericContainerRegistry", "Elasticsearch", "AppInsights", "AppConfig", "OpenAI", "Serp", "BingLLMSearch", "Serverless", "ManagedOnlineEndpoint", "ApiManagement", "ModelGateway", "GroundingWithBingSearch", "GroundingWithCustomSearch", "Sharepoint", "MicrosoftFabric", @@ -6375,10 +4767,10 @@ class UsernamePasswordAuthTypeConnectionProperties(TypedDict, total=False): # p \"Vertica\", \"Pinecone\", \"Databricks\", \"Cassandra\", \"Couchbase\", \"MongoDbV2\", \"MongoDbAtlas\", \"AmazonS3Compatible\", \"FileServer\", \"FtpServer\", \"GoogleCloudStorage\", \"Hdfs\", \"OracleCloudStorage\", \"Sftp\", \"GenericHttp\", - \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"OpenAPI\", \"AmazonMws\", - \"Concur\", \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", - \"Jira\", \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", - \"OracleServiceCloud\", \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", + \"ODataRest\", \"Odbc\", \"GenericRest\", \"RemoteTool\", \"AmazonMws\", \"Concur\", + \"Dynamics\", \"DynamicsAx\", \"DynamicsCrm\", \"GoogleAdWords\", \"Hubspot\", \"Jira\", + \"Magento\", \"Marketo\", \"Office365\", \"Eloqua\", \"Responsys\", \"OracleServiceCloud\", + \"PayPal\", \"QuickBooks\", \"Salesforce\", \"SalesforceServiceCloud\", \"SalesforceMarketingCloud\", \"SapCloudForCustomer\", \"SapEcc\", \"ServiceNow\", \"SharePointOnlineList\", \"Shopify\", \"Square\", \"WebTable\", \"Xero\", \"Zoho\", \"GenericContainerRegistry\", \"Elasticsearch\", \"AppInsights\", \"AppConfig\", \"OpenAI\", @@ -6477,181 +4869,6 @@ class VirtualNetworkRule(TypedDict, total=False): """Ignore missing vnet service endpoint or not.""" -class Workbench(ProxyResource): - """Workbench resource under a Cognitive Services project. Provides interactive compute with data - access for AI development. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype systemData: "SystemData" - :ivar properties: Properties of the workbench resource. Required. - :vartype properties: "WorkbenchProperties" - :ivar etag: Resource Etag. - :vartype etag: str - :ivar identity: Identity for the resource. - :vartype identity: "Identity" - """ - - properties: Required["WorkbenchProperties"] - """Properties of the workbench resource. Required.""" - etag: str - """Resource Etag.""" - identity: "Identity" - """Identity for the resource.""" - - -class WorkbenchProperties(TypedDict, total=False): - """Properties for a Workbench resource. - - :ivar targetClusterId: Resource ID of the Foundry Compute or virtual cluster that hosts this - workbench. Changing the cluster requires the workbench to be stopped. Required. - :vartype targetClusterId: str - :ivar imageLink: Container image URI (e.g., MCR or ACR image path) for the workbench. Immutable - after creation. Required. - :vartype imageLink: str - :ivar instanceType: For virtual clusters, an exact Singularity instance type or a full-node - Azure VM size. If omitted on creation, defaults to Singularity.D4_v3. Foundry Compute ignores - this override and uses the pool configuration. Changing the instance type requires the - workbench to be stopped. - :vartype instanceType: str - :ivar gpuCount: GPU count for GPU pools or vCPU count for CPU pools. Must be 1, 2, 4, 8, or a - positive multiple of 8. A full-node Azure VM size permits partition selection; omission uses - the full node. For an exact Singularity instance type, a supplied count must match that type; - the Singularity.D4_v3 fallback accepts 4. - :vartype gpuCount: int - :ivar idleTimeBeforeShutdown: ISO 8601 duration before the idle workbench is automatically shut - down (e.g., 'PT30M'). - :vartype idleTimeBeforeShutdown: str - :ivar datasetId: The dataset ID to mount for the workbench. Set only during creation. - :vartype datasetId: str - :ivar sshSettings: SSH configuration for remote access to the workbench. Set only during - creation. - :vartype sshSettings: "SshSettings" - :ivar connectivityEndpoints: Network connectivity endpoints assigned to the workbench. - :vartype connectivityEndpoints: "ConnectivityEndpoints" - :ivar webEndpoint: The web endpoint URL for accessing the workbench. - :vartype webEndpoint: str - :ivar provisioningState: Provisioning state of the workbench resource, independent of runtime - lifecycle status. Known values are: "Creating", "Succeeded", "Failed", and "Canceled". - :vartype provisioningState: Union[str, "WorkbenchProvisioningState"] - :ivar status: Runtime lifecycle status of the workbench. Independent of resource provisioning; - start, stop, restart, and runtime health changes do not change provisioningState. Known values - are: "Unknown", "Creating", "Starting", "Running", "Stopping", "Stopped", "Restarting", - "Updating", "Deleting", and "Failed". - :vartype status: Union[str, "WorkbenchStatus"] - :ivar errors: Error details for the workbench resource. - :vartype errors: list["ErrorDetail"] - :ivar creationTime: Creation time of the workbench resource. - :vartype creationTime: str - """ - - targetClusterId: Required[str] - """Resource ID of the Foundry Compute or virtual cluster that hosts this workbench. Changing the - cluster requires the workbench to be stopped. Required.""" - imageLink: Required[str] - """Container image URI (e.g., MCR or ACR image path) for the workbench. Immutable after creation. - Required.""" - instanceType: str - """For virtual clusters, an exact Singularity instance type or a full-node Azure VM size. If - omitted on creation, defaults to Singularity.D4_v3. Foundry Compute ignores this override and - uses the pool configuration. Changing the instance type requires the workbench to be stopped.""" - gpuCount: int - """GPU count for GPU pools or vCPU count for CPU pools. Must be 1, 2, 4, 8, or a positive multiple - of 8. A full-node Azure VM size permits partition selection; omission uses the full node. For - an exact Singularity instance type, a supplied count must match that type; the - Singularity.D4_v3 fallback accepts 4.""" - idleTimeBeforeShutdown: str - """ISO 8601 duration before the idle workbench is automatically shut down (e.g., 'PT30M').""" - datasetId: str - """The dataset ID to mount for the workbench. Set only during creation.""" - sshSettings: "SshSettings" - """SSH configuration for remote access to the workbench. Set only during creation.""" - connectivityEndpoints: "ConnectivityEndpoints" - """Network connectivity endpoints assigned to the workbench.""" - webEndpoint: str - """The web endpoint URL for accessing the workbench.""" - provisioningState: Union[str, "WorkbenchProvisioningState"] - """Provisioning state of the workbench resource, independent of runtime lifecycle status. Known - values are: \"Creating\", \"Succeeded\", \"Failed\", and \"Canceled\".""" - status: Union[str, "WorkbenchStatus"] - """Runtime lifecycle status of the workbench. Independent of resource provisioning; start, stop, - restart, and runtime health changes do not change provisioningState. Known values are: - \"Unknown\", \"Creating\", \"Starting\", \"Running\", \"Stopping\", \"Stopped\", - \"Restarting\", \"Updating\", \"Deleting\", and \"Failed\".""" - errors: list["ErrorDetail"] - """Error details for the workbench resource.""" - creationTime: str - """Creation time of the workbench resource.""" - - -class WorkbenchUpdate(TypedDict, total=False): - """The mutable fields of a workbench resource. - - :ivar properties: Properties of the workbench to update. - :vartype properties: "WorkbenchUpdateProperties" - :ivar identity: Identity for the resource. May be changed while the workbench is running only - when properties is omitted or null; the change takes effect after restart. If a properties - object is supplied, including an empty object or timeout-only update, changing identity - requires the workbench to be stopped. - :vartype identity: "Identity" - """ - - properties: "WorkbenchUpdateProperties" - """Properties of the workbench to update.""" - identity: "Identity" - """Identity for the resource. May be changed while the workbench is running only when properties - is omitted or null; the change takes effect after restart. If a properties object is supplied, - including an empty object or timeout-only update, changing identity requires the workbench to - be stopped.""" - - -class WorkbenchUpdateProperties(TypedDict, total=False): - """Mutable properties for a Workbench resource. - - :ivar targetClusterId: Resource ID of the Foundry Compute or virtual cluster that hosts this - workbench. Changing the cluster requires the workbench to be stopped. - :vartype targetClusterId: str - :ivar idleTimeBeforeShutdown: ISO 8601 duration before the idle workbench is automatically shut - down (e.g., 'PT30M'). - :vartype idleTimeBeforeShutdown: str - :ivar instanceType: For virtual clusters, an exact Singularity instance type or a full-node - Azure VM size. Omit to preserve the current value; null resets to the Singularity.D4_v3 - fallback. Foundry Compute ignores this override and uses the pool configuration. An actual - instance type change requires the workbench to be stopped. - :vartype instanceType: str - :ivar gpuCount: GPU count for GPU pools or vCPU count for CPU pools. Must be 1, 2, 4, 8, or a - positive multiple of 8. Omit to preserve the current value; null clears the override to use the - full node or the instance type's default count. Full-node Azure VM sizes permit partition - selection. A supplied count must match an exact Singularity instance type; the - Singularity.D4_v3 fallback accepts 4. - :vartype gpuCount: int - """ - - targetClusterId: str - """Resource ID of the Foundry Compute or virtual cluster that hosts this workbench. Changing the - cluster requires the workbench to be stopped.""" - idleTimeBeforeShutdown: str - """ISO 8601 duration before the idle workbench is automatically shut down (e.g., 'PT30M').""" - instanceType: Optional[str] - """For virtual clusters, an exact Singularity instance type or a full-node Azure VM size. Omit to - preserve the current value; null resets to the Singularity.D4_v3 fallback. Foundry Compute - ignores this override and uses the pool configuration. An actual instance type change requires - the workbench to be stopped.""" - gpuCount: Optional[int] - """GPU count for GPU pools or vCPU count for CPU pools. Must be 1, 2, 4, 8, or a positive multiple - of 8. Omit to preserve the current value; null clears the override to use the full node or the - instance type's default count. Full-node Azure VM sizes permit partition selection. A supplied - count must match an exact Singularity instance type; the Singularity.D4_v3 fallback accepts 4.""" - - ConnectionPropertiesV2 = Union[ AADAuthTypeConnectionProperties, AccessKeyAuthTypeConnectionProperties, @@ -6667,11 +4884,9 @@ class WorkbenchUpdateProperties(TypedDict, total=False): UsernamePasswordAuthTypeConnectionProperties, ] AgentDeploymentProperties = Union[HostedAgentDeployment, ManagedAgentDeployment] -AgentHostingConfiguration = Union[ManagedClusterAgentHostingConfiguration] ApplicationAuthorizationPolicy = Union[ ChannelsBuiltInAuthorizationPolicy, RoleBasedBuiltInAuthorizationPolicy, OrganizationSharedBuiltInAuthorizationPolicy, ] -ComputeProperties = Union[ClusterComputeProperties, ContainerInstanceComputeProperties] OutboundRule = Union[FqdnOutboundRule, PrivateEndpointOutboundRule, ServiceTagOutboundRule] diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/add_rai_blocklist_items.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/add_rai_blocklist_items.py index 5272a0495281..91be9beeff83 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/add_rai_blocklist_items.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/add_rai_blocklist_items.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/AddRaiBlocklistItems.json +# x-ms-original-file: 2026-11-01/AddRaiBlocklistItems.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/calculate_model_capacity.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/calculate_model_capacity.py index 2ebf52dcd4ea..b50cc237917f 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/calculate_model_capacity.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/calculate_model_capacity.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/CalculateModelCapacity.json +# x-ms-original-file: 2026-11-01/CalculateModelCapacity.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/check_domain_availability.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/check_domain_availability.py index 800b6218eabd..78cefebecb08 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/check_domain_availability.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/check_domain_availability.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/CheckDomainAvailability.json +# x-ms-original-file: 2026-11-01/CheckDomainAvailability.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/check_sku_availability.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/check_sku_availability.py index 78e6267814e5..f9e63b902623 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/check_sku_availability.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/check_sku_availability.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/CheckSkuAvailability.json +# x-ms-original-file: 2026-11-01/CheckSkuAvailability.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create.py index cb2cf1f6f721..494180fe5ce1 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/AccountConnection/create.json +# x-ms-original-file: 2026-11-01/AccountConnection/create.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account.py index 240ff1c4fa13..5530e8da8940 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account.py @@ -39,11 +39,6 @@ def main(): "kind": "Emotion", "location": "West US", "properties": { - "capabilitySettings": { - "blobStore": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount", - "documentStore": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/myCosmosAccount", - "vectorStore": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Search/searchServices/mySearchService", - }, "encryption": { "keySource": "Microsoft.KeyVault", "keyVaultProperties": { @@ -64,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/CreateAccount.json +# x-ms-original-file: 2026-11-01/CreateAccount.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_min.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_min.py index 95dae6875b17..01d3eaa551c3 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_min.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_min.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/CreateAccountMin.json +# x-ms-original-file: 2026-11-01/CreateAccountMin.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_with_agent_hosting_configuration.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_with_agent_hosting_configuration.py index 64753191fa4a..655c112f7198 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_with_agent_hosting_configuration.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_with_agent_hosting_configuration.py @@ -43,24 +43,13 @@ def main(): }, "kind": "AIServices", "location": "West US", - "properties": { - "agentHostingConfigurations": [ - { - "clusterResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.ContainerService/managedClusters/cluster1", - "hostingManagementIdentityResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/account-control-plane", - "hostingType": "ManagedCluster", - "name": "default", - "storageAccountResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storage1", - "workloadIdentityResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aks-workload", - } - ] - }, + "properties": {}, "sku": {"name": "S0"}, }, ).result() print(response) -# x-ms-original-file: 2026-09-15-preview/CreateAccountWithAgentHostingConfiguration.json +# x-ms-original-file: 2026-11-01/CreateAccountWithAgentHostingConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_container_instance_compute.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_with_trusted_certificate_sources.py similarity index 55% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_container_instance_compute.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_with_trusted_certificate_sources.py index 86f9e546297f..c135c99ccef8 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_container_instance_compute.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_account_with_trusted_certificate_sources.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-cognitiveservices # USAGE - python put_container_instance_compute.py + python create_account_with_trusted_certificate_sources.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,30 +31,33 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.computes.begin_create_or_update( - resource_group_name="rgcognitiveservices", + response = client.accounts.begin_create( + resource_group_name="myResourceGroup", account_name="myAccount", - compute_name="myContainerInstance", - resource={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rgcognitiveservices/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {} - }, - }, + account={ + "identity": {"type": "SystemAssigned"}, + "kind": "AIServices", + "location": "eastus", "properties": { - "computeType": "ContainerInstance", - "idleTimeBeforeShutdown": "PT30M", - "imageLink": "mcr.microsoft.com/azureml/curated/pytorch-gpu:latest", - "location": "eastus", - "sshSettings": {"adminEnabled": True, "sshPublicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQ..."}, - "targetClusterId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rgcognitiveservices/providers/Microsoft.CognitiveServices/accounts/myAccount/computes/myCluster", + "allowProjectManagement": True, + "customSubDomainName": "myAccount", + "trustedCertificateSources": [ + { + "certificateBundleReferences": [ + {"secretName": "corporate-ca-bundle", "secretVersion": "11111111111111111111111111111111"}, + {"secretName": "partner-ca-bundle", "secretVersion": "22222222222222222222222222222222"}, + ], + "resourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myKeyVault", + "type": "AzureKeyVault", + } + ], }, + "sku": {"name": "S0"}, }, ).result() print(response) -# x-ms-original-file: 2026-09-15-preview/PutContainerInstanceCompute.json +# x-ms-original-file: 2026-11-01/CreateAccountWithTrustedCertificateSources.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update.py index 7f1662701c2d..13c7898fd69e 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/AgentDeployment/createOrUpdate.json +# x-ms-original-file: 2026-11-01/AgentDeployment/createOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_adapter_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_adapter_deployment.py deleted file mode 100644 index 83780525dde8..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_adapter_deployment.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python create_or_update_adapter_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.adapter_deployments.begin_create_or_update( - resource_group_name="resourceGroupName", - account_name="accountName", - adapter_deployment_name="adapterDeploymentName", - resource={ - "properties": { - "sourceModelId": "azureai://accounts/accountName/projects/projectName/models/modelName/versions/1", - "targetDeploymentName": "managedComputeDeploymentName", - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-09-15-preview/CreateOrUpdateAdapterDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_arc_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_arc_deployment.py deleted file mode 100644 index 925f4ed84b10..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_arc_deployment.py +++ /dev/null @@ -1,56 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python create_or_update_arc_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.arc_deployments.begin_create_or_update( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="phi-3-arc", - resource={ - "properties": { - "compute": "cpu", - "extensionId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Kubernetes/connectedClusters/edge-cluster/providers/Microsoft.KubernetesConfiguration/extensions/inference-operator", - "model": {"format": "OpenAI", "name": "phi-3-mini"}, - "nodeSelector": {"agentpool": "cpu"}, - "replicas": 2, - "resources": {"limits": {"cpu": "8", "memory": "16Gi"}, "requests": {"cpu": "8", "memory": "16Gi"}}, - "runtime": "onnx-genai", - }, - "sku": {"name": "Arc"}, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-09-15-preview/CreateOrUpdateArcDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_arc_deployment_with_template.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_arc_deployment_with_template.py deleted file mode 100644 index 6aa4aba9621a..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_arc_deployment_with_template.py +++ /dev/null @@ -1,57 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python create_or_update_arc_deployment_with_template.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.arc_deployments.begin_create_or_update( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="qwen-template-arc", - resource={ - "properties": { - "compute": "gpu", - "deploymentTemplate": "azureml://registries/azureml-openai-oss/deploymenttemplates/vllm-qwen--qwen3-5-0-8b/versions/1", - "extensionId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.Kubernetes/connectedClusters/edge-cluster/providers/Microsoft.KubernetesConfiguration/extensions/inference-operator", - "model": {"format": "OpenAI", "name": "qwen3"}, - "nodeSelector": {"agentpool": "a100"}, - "replicas": 2, - "resources": {"limits": {"gpu": 5}}, - "runtime": "vllm", - }, - "sku": {"name": "Arc"}, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-09-15-preview/CreateOrUpdateArcDeploymentWithTemplate.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_managed_compute_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_managed_compute_deployment.py deleted file mode 100644 index ccaf63cb7ab0..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_managed_compute_deployment.py +++ /dev/null @@ -1,56 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python create_or_update_managed_compute_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.managed_compute_deployments.begin_create_or_update( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="gpt-oss-120b-gpu", - resource={ - "properties": { - "acceleratorType": "H100_80GB", - "deploymentTemplate": "azureml://registries/azureml-openai-oss/deploymenttemplates/gpt-oss-120b-short-context/versions/1", - "gatedModelAccess": { - "connectionId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName/projects/my-project/connections/my-hf-connection" - }, - "model": "azureml://registries/azureml-openai-oss/models/gpt-oss-120b/versions/4", - "versionUpgradeOption": "OnceNewDefaultVersionAvailable", - }, - "sku": {"capacity": 1, "name": "GlobalManagedCompute"}, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-09-15-preview/CreateOrUpdateManagedComputeDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_managed_network_v2.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_managed_network_v2.py index d39e3eedc14c..666e63cbbefd 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_managed_network_v2.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_managed_network_v2.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/createOrUpdateManagedNetworkV2.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/createOrUpdateManagedNetworkV2.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_quota_tier.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_quota_tier.py index da2f1ef0a27b..068b7fbbed8b 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_quota_tier.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_quota_tier.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/CreateOrUpdateQuotaTier.json +# x-ms-original-file: 2026-11-01/CreateOrUpdateQuotaTier.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_rule_v2.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_rule_v2.py index 8458946bcafe..510b97cb3bcf 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_rule_v2.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_rule_v2.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/createOrUpdateRuleV2.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/createOrUpdateRuleV2.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_vm_managed_compute_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_vm_managed_compute_deployment.py deleted file mode 100644 index 018d85c9d930..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_or_update_vm_managed_compute_deployment.py +++ /dev/null @@ -1,56 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python create_or_update_vm_managed_compute_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.managed_compute_deployments.begin_create_or_update( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="gpt-oss-120b-byoc", - resource={ - "properties": { - "computeId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName/computes/my-h100-pool", - "deploymentTemplate": "projects/my-project/deploymentTemplates/gpt-oss-120b-vllm-tuned/versions/2", - "gatedModelAccess": { - "connectionId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName/projects/my-project/connections/my-hf-connection" - }, - "model": "azureml://registries/azureml-openai-oss/models/gpt-oss-120b/versions/4", - "priority": "High", - }, - "sku": {"capacity": 2, "name": "VmManagedCompute"}, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-09-15-preview/CreateOrUpdateVmManagedComputeDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_project.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_project.py index 6d7d1316785b..2ae2acac6439 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_project.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_project.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,19 +37,12 @@ def main(): project={ "identity": {"type": "SystemAssigned"}, "location": "West US", - "properties": { - "capabilitySettings": { - "documentStore": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/myProjectCosmosAccount", - "vectorStore": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Search/searchServices/myProjectSearchService", - }, - "description": "Description of this project", - "displayName": "p1", - }, + "properties": {"description": "Description of this project", "displayName": "p1"}, }, ).result() print(response) -# x-ms-original-file: 2026-09-15-preview/CreateProject.json +# x-ms-original-file: 2026-11-01/CreateProject.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_project_min.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_project_min.py index fc11b1b778e8..2596d94ccec4 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_project_min.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_project_min.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/CreateProjectMin.json +# x-ms-original-file: 2026-11-01/CreateProjectMin.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_shared_commitment_plan.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_shared_commitment_plan.py index dc5641570cab..4b5965118e5a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_shared_commitment_plan.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_shared_commitment_plan.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/CreateSharedCommitmentPlan.json +# x-ms-original-file: 2026-11-01/CreateSharedCommitmentPlan.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_shared_commitment_plan_association.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_shared_commitment_plan_association.py index d57e316e9370..45dfc0ca309b 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_shared_commitment_plan_association.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/create_shared_commitment_plan_association.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/CreateSharedCommitmentPlanAssociation.json +# x-ms-original-file: 2026-11-01/CreateSharedCommitmentPlanAssociation.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete.py index bfb940e62f51..0105682b98fd 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/AgentDeployment/delete.json +# x-ms-original-file: 2026-11-01/AgentDeployment/delete.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_account.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_account.py index 1047326accf6..c1a8eeecb672 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_account.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_account.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteAccount.json +# x-ms-original-file: 2026-11-01/DeleteAccount.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_adapter_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_adapter_deployment.py deleted file mode 100644 index 6c21a497980a..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_adapter_deployment.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python delete_adapter_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.adapter_deployments.begin_delete( - resource_group_name="resourceGroupName", - account_name="accountName", - adapter_deployment_name="adapterDeploymentName", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/DeleteAdapterDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_arc_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_arc_deployment.py deleted file mode 100644 index e9005a45102b..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_arc_deployment.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python delete_arc_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.arc_deployments.begin_delete( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="phi-3-arc", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/DeleteArcDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_commitment_plan.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_commitment_plan.py index 9a09045ea395..1079212ef92c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_commitment_plan.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_commitment_plan.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteCommitmentPlan.json +# x-ms-original-file: 2026-11-01/DeleteCommitmentPlan.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_compute.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_compute.py deleted file mode 100644 index 9d9489607aae..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_compute.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python delete_compute.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.computes.begin_delete( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - compute_name="myCompute", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/DeleteCompute.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_deployment.py index 9a0e1709d647..cb8b2adad490 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_deployment.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_deployment.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteDeployment.json +# x-ms-original-file: 2026-11-01/DeleteDeployment.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_encryption_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_encryption_scope.py index 8a63d3f19fc8..c1a07f7765ef 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_encryption_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_encryption_scope.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteEncryptionScope.json +# x-ms-original-file: 2026-11-01/DeleteEncryptionScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_managed_compute_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_managed_compute_deployment.py deleted file mode 100644 index 40aff03cec8d..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_managed_compute_deployment.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python delete_managed_compute_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.managed_compute_deployments.begin_delete( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="gpt-oss-120b-gpu", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/DeleteManagedComputeDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_managed_network_v2.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_managed_network_v2.py index 2a56b54b4de6..b2914ccd5361 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_managed_network_v2.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_managed_network_v2.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/deleteManagedNetworkV2.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/deleteManagedNetworkV2.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_private_endpoint_connection.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_private_endpoint_connection.py index 0e6e0bb336a5..b203a3c4ad3e 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_private_endpoint_connection.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_private_endpoint_connection.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeletePrivateEndpointConnection.json +# x-ms-original-file: 2026-11-01/DeletePrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_project.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_project.py index 777cf42c652d..5a5135fa6e3e 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_project.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_project.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteProject.json +# x-ms-original-file: 2026-11-01/DeleteProject.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_binding.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_binding.py deleted file mode 100644 index b9f77af2e322..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_binding.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python delete_rai_binding.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.rai_bindings.delete( - resource_group_name="resource-group", - account_name="safety-account", - rai_binding_name="chat-guard", - ) - - -# x-ms-original-file: 2026-09-15-preview/DeleteRaiBinding.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist.py index cc12745af2ca..6889fd2ab8e8 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteRaiBlocklist.json +# x-ms-original-file: 2026-11-01/DeleteRaiBlocklist.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist_item.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist_item.py index 616cfb93b11b..d987dcc6de67 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist_item.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist_item.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteRaiBlocklistItem.json +# x-ms-original-file: 2026-11-01/DeleteRaiBlocklistItem.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist_items.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist_items.py index 99939bc1a0f2..57afd208411f 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist_items.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_blocklist_items.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: 2026-09-15-preview/DeleteRaiBlocklistItems.json +# x-ms-original-file: 2026-11-01/DeleteRaiBlocklistItems.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_external_safety_provider.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_external_safety_provider.py index ef0b87590bae..c37870f74a28 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_external_safety_provider.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_external_safety_provider.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteRaiExternalSafetyProvider.json +# x-ms-original-file: 2026-11-01/DeleteRaiExternalSafetyProvider.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_policy.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_policy.py index d9728c66352b..d5411aaa55fc 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_policy.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_policy.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteRaiPolicy.json +# x-ms-original-file: 2026-11-01/DeleteRaiPolicy.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_policy_acs.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_policy_acs.py index a9061cd8c788..6ddc1db7953a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_policy_acs.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_policy_acs.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteRaiPolicyAcs.json +# x-ms-original-file: 2026-11-01/DeleteRaiPolicyAcs.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_rego.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_rego.py deleted file mode 100644 index 0971b8b5dbac..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_rego.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python delete_rai_rego.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.rai_regos.delete( - resource_group_name="resource-group", - account_name="safety-account", - rai_rego_name="input-guard", - ) - - -# x-ms-original-file: 2026-09-15-preview/DeleteRaiRego.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_tool_label.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_tool_label.py index cb2988db6550..c8925bba19df 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_tool_label.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_tool_label.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteRaiToolLabel.json +# x-ms-original-file: 2026-11-01/DeleteRaiToolLabel.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_topic.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_topic.py index 7f87b837dba3..88b5b85a1ba7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_topic.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rai_topic.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteRaiTopic.json +# x-ms-original-file: 2026-11-01/DeleteRaiTopic.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rule_v2.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rule_v2.py index b323f8d6a7e3..83656c4f8ff2 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rule_v2.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_rule_v2.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/deleteRuleV2.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/deleteRuleV2.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_shared_commitment_plan.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_shared_commitment_plan.py index 1bc0a58e1047..c926751296f1 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_shared_commitment_plan.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_shared_commitment_plan.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteSharedCommitmentPlan.json +# x-ms-original-file: 2026-11-01/DeleteSharedCommitmentPlan.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_shared_commitment_plan_association.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_shared_commitment_plan_association.py index f0374ed26ed8..f39e7afe0a4f 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_shared_commitment_plan_association.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_shared_commitment_plan_association.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteSharedCommitmentPlanAssociation.json +# x-ms-original-file: 2026-11-01/DeleteSharedCommitmentPlanAssociation.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_subscription_rai_policy.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_subscription_rai_policy.py index f8378a040a91..a514a563363c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_subscription_rai_policy.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_subscription_rai_policy.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/DeleteSubscriptionRaiPolicy.json +# x-ms-original-file: 2026-11-01/DeleteSubscriptionRaiPolicy.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_workbench.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_workbench.py deleted file mode 100644 index 4390f596b406..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/delete_workbench.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python delete_workbench.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.workbenches.begin_delete( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - project_name="myProject", - workbench_name="myWorkbench", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/DeleteWorkbench.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/disable.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/disable.py index cf311b353287..c13bba1dacb2 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/disable.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/disable.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: 2026-09-15-preview/AgentApplication/disable.json +# x-ms-original-file: 2026-11-01/AgentApplication/disable.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/enable.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/enable.py index 8a9c3b794386..a910906105ce 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/enable.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/enable.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: 2026-09-15-preview/AgentApplication/enable.json +# x-ms-original-file: 2026-11-01/AgentApplication/enable.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/evaluate_deployment_policies.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/evaluate_deployment_policies.py deleted file mode 100644 index 53f6c2c70117..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/evaluate_deployment_policies.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python evaluate_deployment_policies.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.accounts.evaluate_deployment_policies( - resource_group_name="resourceGroupName", - account_name="accountName", - body={ - "deployments": [ - { - "name": "gpt4o-deployment", - "properties": { - "model": {"format": "OpenAI", "name": "gpt-4o", "version": "2024-11-20"}, - "raiPolicyName": "Microsoft.DefaultV2", - }, - }, - { - "name": "ada-embedding", - "properties": {"model": {"format": "OpenAI", "name": "text-embedding-ada-002", "version": "2"}}, - }, - ] - }, - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/EvaluateDeploymentPolicies.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get.py index e2ec98e7a305..2d4173195b53 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/AgentDeployment/get.json +# x-ms-original-file: 2026-11-01/AgentDeployment/get.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_account.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_account.py index cb858bea1904..455d9f000e8a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_account.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_account.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetAccount.json +# x-ms-original-file: 2026-11-01/GetAccount.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_compute.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_account_with_trusted_certificate_sources.py similarity index 85% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_compute.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_account_with_trusted_certificate_sources.py index 70b7c9480434..47758596c534 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_compute.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_account_with_trusted_certificate_sources.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-cognitiveservices # USAGE - python get_compute.py + python get_account_with_trusted_certificate_sources.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.computes.get( - resource_group_name="rgcognitiveservices", + response = client.accounts.get( + resource_group_name="myResourceGroup", account_name="myAccount", - compute_name="myCompute", ) print(response) -# x-ms-original-file: 2026-09-15-preview/GetCompute.json +# x-ms-original-file: 2026-11-01/GetAccountWithTrustedCertificateSources.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_adapter_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_adapter_deployment.py deleted file mode 100644 index 17329ba4272a..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_adapter_deployment.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python get_adapter_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.adapter_deployments.get( - resource_group_name="resourceGroupName", - account_name="accountName", - adapter_deployment_name="adapterDeploymentName", - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/GetAdapterDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_arc_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_arc_deployment.py deleted file mode 100644 index 778822463d4a..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_arc_deployment.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python get_arc_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.arc_deployments.get( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="qwen-template-arc", - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/GetArcDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_commitment_plan.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_commitment_plan.py index b80719c4b5a3..23407d220c20 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_commitment_plan.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_commitment_plan.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetCommitmentPlan.json +# x-ms-original-file: 2026-11-01/GetCommitmentPlan.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_compute_operation_status.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_compute_operation_status.py deleted file mode 100644 index 7f234a9955a9..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_compute_operation_status.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python get_compute_operation_status.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.compute_operations.get( - location="eastus", - operation_id="00000000-0000-0000-0000-000000000000", - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/GetComputeOperationStatus.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_container_instance_compute.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_container_instance_compute.py deleted file mode 100644 index b1a69ba12908..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_container_instance_compute.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python get_container_instance_compute.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.computes.get( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - compute_name="myContainerInstance", - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/GetContainerInstanceCompute.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_defender_for_ai_setting.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_defender_for_ai_setting.py index cc74beb2d2a5..61c2b9c98ee4 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_defender_for_ai_setting.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_defender_for_ai_setting.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetDefenderForAISetting.json +# x-ms-original-file: 2026-11-01/GetDefenderForAISetting.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_deleted_account.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_deleted_account.py index 2d39ae981d00..5201a3032033 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_deleted_account.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_deleted_account.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetDeletedAccount.json +# x-ms-original-file: 2026-11-01/GetDeletedAccount.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_deployment.py index b2d322f78eff..ed5c6c642739 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_deployment.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_deployment.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetDeployment.json +# x-ms-original-file: 2026-11-01/GetDeployment.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_encryption_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_encryption_scope.py index 599dfaf6e573..2f981dac9a4a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_encryption_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_encryption_scope.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetEncryptionScope.json +# x-ms-original-file: 2026-11-01/GetEncryptionScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_legacy.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_legacy.py deleted file mode 100644 index 1ec500618c09..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_legacy.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python get_legacy.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cost_controls.get( - resource_group_name="foundry-resource-group", - account_name="foundry-account", - cost_control_name="legacy-budget", - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/CostControl/getLegacy.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_managed_compute_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_managed_compute_deployment.py deleted file mode 100644 index a7b439631088..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_managed_compute_deployment.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python get_managed_compute_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.managed_compute_deployments.get( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="gpt-oss-120b-gpu", - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/GetManagedComputeDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_managed_network_v2.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_managed_network_v2.py index c5eaffd0b932..266f7423b614 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_managed_network_v2.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_managed_network_v2.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/getManagedNetworkV2.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/getManagedNetworkV2.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_network_security_perimeter_configurations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_network_security_perimeter_configurations.py index 6f8daf516883..697bdb27e2d7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_network_security_perimeter_configurations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_network_security_perimeter_configurations.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetNetworkSecurityPerimeterConfigurations.json +# x-ms-original-file: 2026-11-01/GetNetworkSecurityPerimeterConfigurations.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_operations.py index 76d589eb18b5..1befb877a35b 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_operations.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/GetOperations.json +# x-ms-original-file: 2026-11-01/GetOperations.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_private_endpoint_connection.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_private_endpoint_connection.py index 1ed2eba87aa7..54912dbc36d6 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_private_endpoint_connection.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_private_endpoint_connection.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetPrivateEndpointConnection.json +# x-ms-original-file: 2026-11-01/GetPrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_project.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_project.py index d875ba4bca42..b4df608b68a2 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_project.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_project.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetProject.json +# x-ms-original-file: 2026-11-01/GetProject.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_quota_tier.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_quota_tier.py index ff24156237d2..a316803f82ec 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_quota_tier.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_quota_tier.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetQuotaTier.json +# x-ms-original-file: 2026-11-01/GetQuotaTier.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_binding.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_binding.py deleted file mode 100644 index 608c6d13d0e8..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_binding.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python get_rai_binding.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.rai_bindings.get( - resource_group_name="resource-group", - account_name="safety-account", - rai_binding_name="chat-guard", - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/GetRaiBinding.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_blocklist.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_blocklist.py index 91c8def7ad61..e0f8621d3690 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_blocklist.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_blocklist.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetRaiBlocklist.json +# x-ms-original-file: 2026-11-01/GetRaiBlocklist.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_blocklist_item.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_blocklist_item.py index 342b3c54e8ee..bd8284cb4ee7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_blocklist_item.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_blocklist_item.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetRaiBlocklistItem.json +# x-ms-original-file: 2026-11-01/GetRaiBlocklistItem.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_content_filter.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_content_filter.py index ffd38ea49250..c483f96fdba3 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_content_filter.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_content_filter.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetRaiContentFilter.json +# x-ms-original-file: 2026-11-01/GetRaiContentFilter.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_external_safety_provider.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_external_safety_provider.py index 362646d8df76..504273c27149 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_external_safety_provider.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_external_safety_provider.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetRaiExternalSafetyProvider.json +# x-ms-original-file: 2026-11-01/GetRaiExternalSafetyProvider.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_policy.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_policy.py index 941b2846e804..63189e021167 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_policy.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_policy.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetRaiPolicy.json +# x-ms-original-file: 2026-11-01/GetRaiPolicy.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_policy_acs.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_policy_acs.py index 55c412260a6c..c480c5b6b8f1 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_policy_acs.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_policy_acs.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetRaiPolicyAcs.json +# x-ms-original-file: 2026-11-01/GetRaiPolicyAcs.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_rego.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_rego.py deleted file mode 100644 index 9b7d56b2d665..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_rego.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python get_rai_rego.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.rai_regos.get( - resource_group_name="resource-group", - account_name="safety-account", - rai_rego_name="input-guard", - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/GetRaiRego.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_tool_label.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_tool_label.py index b04dae4aa23e..a07672b622f9 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_tool_label.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_tool_label.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetRaiToolLabel.json +# x-ms-original-file: 2026-11-01/GetRaiToolLabel.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_topic.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_topic.py index 725c4163ebb9..e3d73aa65f8f 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_topic.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rai_topic.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetRaiTopic.json +# x-ms-original-file: 2026-11-01/GetRaiTopic.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rule_v2.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rule_v2.py index d956fbe1b05e..757f2590930b 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rule_v2.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_rule_v2.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/getRuleV2.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/getRuleV2.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_shared_commitment_plan.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_shared_commitment_plan.py index d36d1742f22b..dd4c9290db50 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_shared_commitment_plan.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_shared_commitment_plan.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetSharedCommitmentPlan.json +# x-ms-original-file: 2026-11-01/GetSharedCommitmentPlan.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_shared_commitment_plan_association.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_shared_commitment_plan_association.py index 8169da09e1cd..f69f765038fa 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_shared_commitment_plan_association.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_shared_commitment_plan_association.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetSharedCommitmentPlanAssociation.json +# x-ms-original-file: 2026-11-01/GetSharedCommitmentPlanAssociation.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_skus.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_skus.py index 5b7741f793c5..cdd6b955c626 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_skus.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_skus.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/GetSkus.json +# x-ms-original-file: 2026-11-01/GetSkus.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_subscription_rai_policy.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_subscription_rai_policy.py index 916da130c383..19f74c9147f2 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_subscription_rai_policy.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_subscription_rai_policy.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetSubscriptionRaiPolicy.json +# x-ms-original-file: 2026-11-01/GetSubscriptionRaiPolicy.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages.py index 0ee870a5489b..95594f445641 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetUsages.json +# x-ms-original-file: 2026-11-01/GetUsages.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_classic_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_classic_scope.py index 1002d963ad63..2e7784ba8b11 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_classic_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_classic_scope.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetUsagesClassicScope.json +# x-ms-original-file: 2026-11-01/GetUsagesClassicScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_data_zone_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_data_zone_scope.py index b5025d957b77..623749eef1c7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_data_zone_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_data_zone_scope.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetUsagesDataZoneScope.json +# x-ms-original-file: 2026-11-01/GetUsagesDataZoneScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_global_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_global_scope.py index c3d4103705ec..85ae89f3509c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_global_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_usages_global_scope.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/GetUsagesGlobalScope.json +# x-ms-original-file: 2026-11-01/GetUsagesGlobalScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_vm_managed_compute_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_vm_managed_compute_deployment.py deleted file mode 100644 index d88ea5be7019..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_vm_managed_compute_deployment.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python get_vm_managed_compute_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.managed_compute_deployments.get( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="gpt-oss-120b-byoc", - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/GetVmManagedComputeDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list.py index bb7b1950276e..ea0ebcca0cb5 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/AgentDeployment/list.json +# x-ms-original-file: 2026-11-01/AgentDeployment/list.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_account_models.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_account_models.py index 09ead7f19615..1a047593daa5 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_account_models.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_account_models.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListAccountModels.json +# x-ms-original-file: 2026-11-01/ListAccountModels.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_accounts_by_resource_group.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_accounts_by_resource_group.py index 2e776bd305fa..1053d1dc6044 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_accounts_by_resource_group.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_accounts_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListAccountsByResourceGroup.json +# x-ms-original-file: 2026-11-01/ListAccountsByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_accounts_by_subscription.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_accounts_by_subscription.py index 8c63ffc1dc2a..fb1e427c26e9 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_accounts_by_subscription.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_accounts_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListAccountsBySubscription.json +# x-ms-original-file: 2026-11-01/ListAccountsBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_adapter_deployments.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_adapter_deployments.py deleted file mode 100644 index de14647c2735..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_adapter_deployments.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python list_adapter_deployments.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.adapter_deployments.list( - resource_group_name="resourceGroupName", - account_name="accountName", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-09-15-preview/ListAdapterDeployments.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_agents.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_agents.py index 54d765a26ab6..1acc43db52f7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_agents.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_agents.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/AgentApplication/listAgents.json +# x-ms-original-file: 2026-11-01/AgentApplication/listAgents.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_blocklist_items.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_blocklist_items.py index 5d69431c6977..a37757839060 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_blocklist_items.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_blocklist_items.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListBlocklistItems.json +# x-ms-original-file: 2026-11-01/ListBlocklistItems.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_blocklists.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_blocklists.py index 72ca0e98256a..df40c1e9798c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_blocklists.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_blocklists.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListBlocklists.json +# x-ms-original-file: 2026-11-01/ListBlocklists.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_commitment_plans.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_commitment_plans.py index 5fa4fa324d21..6458f0c1781d 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_commitment_plans.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_commitment_plans.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListCommitmentPlans.json +# x-ms-original-file: 2026-11-01/ListCommitmentPlans.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_commitment_tiers.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_commitment_tiers.py index 34b6b73245bc..457e81ead2a6 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_commitment_tiers.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_commitment_tiers.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListCommitmentTiers.json +# x-ms-original-file: 2026-11-01/ListCommitmentTiers.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_computes.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_computes.py deleted file mode 100644 index 98daaacafa63..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_computes.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python list_computes.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.computes.list( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-09-15-preview/ListComputes.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_defender_for_ai_setting.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_defender_for_ai_setting.py index bcd53ca6e3be..855fc5d18084 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_defender_for_ai_setting.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_defender_for_ai_setting.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListDefenderForAISetting.json +# x-ms-original-file: 2026-11-01/ListDefenderForAISetting.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deleted_accounts_by_subscription.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deleted_accounts_by_subscription.py index aba606645b72..3e97562fcfdb 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deleted_accounts_by_subscription.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deleted_accounts_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListDeletedAccountsBySubscription.json +# x-ms-original-file: 2026-11-01/ListDeletedAccountsBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deployment_skus.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deployment_skus.py index acb0aec87a26..c8616e3c0c89 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deployment_skus.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deployment_skus.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListDeploymentSkus.json +# x-ms-original-file: 2026-11-01/ListDeploymentSkus.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deployments.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deployments.py index da08a88b3ea0..04e53614f27c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deployments.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_deployments.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListDeployments.json +# x-ms-original-file: 2026-11-01/ListDeployments.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_encryption_scopes.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_encryption_scopes.py index ae3b85873725..a8622290b03d 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_encryption_scopes.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_encryption_scopes.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListEncryptionScopes.json +# x-ms-original-file: 2026-11-01/ListEncryptionScopes.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_keys.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_keys.py index 7751b0ab6b77..0cd901da3439 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_keys.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_keys.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ListKeys.json +# x-ms-original-file: 2026-11-01/ListKeys.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities.py index fc9a4175da55..eb043f3536c3 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListLocationBasedModelCapacities.json +# x-ms-original-file: 2026-11-01/ListLocationBasedModelCapacities.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_classic_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_classic_scope.py index 9fc38c2fb16e..7e5478a1b2ae 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_classic_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_classic_scope.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListLocationBasedModelCapacitiesClassicScope.json +# x-ms-original-file: 2026-11-01/ListLocationBasedModelCapacitiesClassicScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_data_zone_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_data_zone_scope.py index 323ab4efb633..9427a91bcebd 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_data_zone_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_data_zone_scope.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListLocationBasedModelCapacitiesDataZoneScope.json +# x-ms-original-file: 2026-11-01/ListLocationBasedModelCapacitiesDataZoneScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_global_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_global_scope.py index 5c4878805ea4..e4647df3a1b8 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_global_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_based_model_capacities_global_scope.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListLocationBasedModelCapacitiesGlobalScope.json +# x-ms-original-file: 2026-11-01/ListLocationBasedModelCapacitiesGlobalScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_models.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_models.py index 182eceeee017..c7494a14efaa 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_models.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_location_models.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListLocationModels.json +# x-ms-original-file: 2026-11-01/ListLocationModels.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities.py index aa8a5b211b55..02a00dd0f91e 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListManagedComputeCapacities.json +# x-ms-original-file: 2026-11-01/ListManagedComputeCapacities.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_bindings.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities_with_deployment.py similarity index 85% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_bindings.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities_with_deployment.py index 3eae5967a9b0..bb47655d97a2 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_bindings.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities_with_deployment.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-cognitiveservices # USAGE - python list_rai_bindings.py + python list_managed_compute_capacities_with_deployment.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.rai_bindings.list( - resource_group_name="resource-group", - account_name="safety-account", + response = client.managed_compute_capacities.list( + offer="MaaP", ) for item in response: print(item) -# x-ms-original-file: 2026-09-15-preview/ListRaiBindings.json +# x-ms-original-file: 2026-11-01/ListManagedComputeCapacitiesWithDeployment.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_regos.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities_with_location.py similarity index 85% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_regos.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities_with_location.py index 4593fc9d369b..31bbb2f62ad6 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_regos.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities_with_location.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-cognitiveservices # USAGE - python list_rai_regos.py + python list_managed_compute_capacities_with_location.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.rai_regos.list( - resource_group_name="resource-group", - account_name="safety-account", + response = client.managed_compute_capacities.list( + offer="MaaP", ) for item in response: print(item) -# x-ms-original-file: 2026-09-15-preview/ListRaiRegos.json +# x-ms-original-file: 2026-11-01/ListManagedComputeCapacitiesWithLocation.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_arc_deployments.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities_with_unsupported_location.py similarity index 84% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_arc_deployments.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities_with_unsupported_location.py index ce4d6db0da53..4d2fad862b3a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_arc_deployments.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_capacities_with_unsupported_location.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-cognitiveservices # USAGE - python list_arc_deployments.py + python list_managed_compute_capacities_with_unsupported_location.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.arc_deployments.list( - resource_group_name="resourceGroupName", - account_name="accountName", + response = client.managed_compute_capacities.list( + offer="MaaP", ) for item in response: print(item) -# x-ms-original-file: 2026-09-15-preview/ListArcDeployments.json +# x-ms-original-file: 2026-11-01/ListManagedComputeCapacitiesWithUnsupportedLocation.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_deployments.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_deployments.py deleted file mode 100644 index 5ff79196aef4..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_deployments.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python list_managed_compute_deployments.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.managed_compute_deployments.list( - resource_group_name="resourceGroupName", - account_name="accountName", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-09-15-preview/ListManagedComputeDeployments.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_usages.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_usages.py deleted file mode 100644 index d1a76a35db23..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_compute_usages.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python list_managed_compute_usages.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.managed_compute_usages_operation_group.list( - location="eastus", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-09-15-preview/ListManagedComputeUsages.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_network_v2.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_network_v2.py index 3c63f0650618..b743aabee2e9 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_network_v2.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_managed_network_v2.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/listManagedNetworkV2.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/listManagedNetworkV2.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities.py index c7fe5e9835e6..db2356f8656e 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListModelCapacities.json +# x-ms-original-file: 2026-11-01/ListModelCapacities.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_classic_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_classic_scope.py index 55265d5e452b..ec228730d422 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_classic_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_classic_scope.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListModelCapacitiesClassicScope.json +# x-ms-original-file: 2026-11-01/ListModelCapacitiesClassicScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_data_zone_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_data_zone_scope.py index 2d4bfe740ba7..f757d9733208 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_data_zone_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_data_zone_scope.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListModelCapacitiesDataZoneScope.json +# x-ms-original-file: 2026-11-01/ListModelCapacitiesDataZoneScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_global_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_global_scope.py index 9d4e9693acd6..75d5ef2433ad 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_global_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_model_capacities_global_scope.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListModelCapacitiesGlobalScope.json +# x-ms-original-file: 2026-11-01/ListModelCapacitiesGlobalScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_network_security_perimeter_configurations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_network_security_perimeter_configurations.py index b911904806e1..afd285ff9114 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_network_security_perimeter_configurations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_network_security_perimeter_configurations.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListNetworkSecurityPerimeterConfigurations.json +# x-ms-original-file: 2026-11-01/ListNetworkSecurityPerimeterConfigurations.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_private_endpoint_connections.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_private_endpoint_connections.py index 2727343771b2..135503b2ab19 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_private_endpoint_connections.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_private_endpoint_connections.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ListPrivateEndpointConnections.json +# x-ms-original-file: 2026-11-01/ListPrivateEndpointConnections.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_private_link_resources.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_private_link_resources.py index 9da74e70b616..bc9eef6ce077 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_private_link_resources.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_private_link_resources.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ListPrivateLinkResources.json +# x-ms-original-file: 2026-11-01/ListPrivateLinkResources.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_projects.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_projects.py index 470c178070a2..30b6bb8f8190 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_projects.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_projects.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListProjects.json +# x-ms-original-file: 2026-11-01/ListProjects.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_quota_tiers.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_quota_tiers.py index ff042f30890e..7564b5242b2e 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_quota_tiers.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_quota_tiers.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListQuotaTiers.json +# x-ms-original-file: 2026-11-01/ListQuotaTiers.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_content_filters.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_content_filters.py index cbee66b67b44..3fe5266b1629 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_content_filters.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_content_filters.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListRaiContentFilters.json +# x-ms-original-file: 2026-11-01/ListRaiContentFilters.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_external_safety_providers.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_external_safety_providers.py index 55779bf4311c..06e63bad6f0b 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_external_safety_providers.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_external_safety_providers.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListRaiExternalSafetyProviders.json +# x-ms-original-file: 2026-11-01/ListRaiExternalSafetyProviders.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_policies.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_policies.py index 1703264068e6..8c83c15a2897 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_policies.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_policies.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListRaiPolicies.json +# x-ms-original-file: 2026-11-01/ListRaiPolicies.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_tool_labels.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_tool_labels.py index 7c4204cac283..5425920ea2f9 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_tool_labels.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_tool_labels.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListRaiToolLabels.json +# x-ms-original-file: 2026-11-01/ListRaiToolLabels.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_topics.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_topics.py index c6a8a6c56272..ef52f8a7083c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_topics.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rai_topics.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListRaiTopics.json +# x-ms-original-file: 2026-11-01/ListRaiTopics.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rule_v2.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rule_v2.py index 304b3557a6ab..13d6fff3f36f 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rule_v2.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_rule_v2.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/listRuleV2.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/listRuleV2.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plan_associations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plan_associations.py index 0ec8c8e84165..34066eed174d 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plan_associations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plan_associations.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListSharedCommitmentPlanAssociations.json +# x-ms-original-file: 2026-11-01/ListSharedCommitmentPlanAssociations.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plans_by_resource_group.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plans_by_resource_group.py index 15b22fbf17ef..9d9089b3a37f 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plans_by_resource_group.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plans_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListSharedCommitmentPlansByResourceGroup.json +# x-ms-original-file: 2026-11-01/ListSharedCommitmentPlansByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plans_by_subscription.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plans_by_subscription.py index 6eb2b6be092a..501e77119243 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plans_by_subscription.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_shared_commitment_plans_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListSharedCommitmentPlansBySubscription.json +# x-ms-original-file: 2026-11-01/ListSharedCommitmentPlansBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_skus.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_skus.py index 6dd74df44f0f..40ee8340f9e4 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_skus.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_skus.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ListSkus.json +# x-ms-original-file: 2026-11-01/ListSkus.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages.py index f8735f31c4dc..75328651a162 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListUsages.json +# x-ms-original-file: 2026-11-01/ListUsages.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_classic_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_classic_scope.py index 7b019916a8de..40c776ba2783 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_classic_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_classic_scope.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListUsagesClassicScope.json +# x-ms-original-file: 2026-11-01/ListUsagesClassicScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_data_zone_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_data_zone_scope.py index f3171696698c..1099bbc9239c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_data_zone_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_data_zone_scope.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListUsagesDataZoneScope.json +# x-ms-original-file: 2026-11-01/ListUsagesDataZoneScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_global_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_global_scope.py index ae337d8e792d..9975d57f3620 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_global_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_global_scope.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListUsagesGlobalScope.json +# x-ms-original-file: 2026-11-01/ListUsagesGlobalScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_with_resource_metadata.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_with_resource_metadata.py index fddfe5a17f2d..ae5a554e1da7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_with_resource_metadata.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_usages_with_resource_metadata.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ListUsagesWithResourceMetadata.json +# x-ms-original-file: 2026-11-01/ListUsagesWithResourceMetadata.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_vm_managed_compute_deployments.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_vm_managed_compute_deployments.py deleted file mode 100644 index 0fbc2a2ee852..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_vm_managed_compute_deployments.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python list_vm_managed_compute_deployments.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.managed_compute_deployments.list( - resource_group_name="resourceGroupName", - account_name="accountName", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-09-15-preview/ListVmManagedComputeDeployments.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_workbenches.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_workbenches.py deleted file mode 100644 index 0d7fe5d53ef7..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/list_workbenches.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python list_workbenches.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.workbenches.list( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - project_name="myProject", - ) - for item in response: - print(item) - - -# x-ms-original-file: 2026-09-15-preview/ListWorkbenches.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/patch_managed_network_v2.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/patch_managed_network_v2.py index 5b8a49ecf2f9..a7130eca5186 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/patch_managed_network_v2.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/patch_managed_network_v2.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/patchManagedNetworkV2.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/patchManagedNetworkV2.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/pause_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/pause_deployment.py index d4654e192a1e..4e7d758e6897 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/pause_deployment.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/pause_deployment.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PauseDeployment.json +# x-ms-original-file: 2026-11-01/PauseDeployment.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/post_outbound_rules_v2.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/post_outbound_rules_v2.py index 9d809f369513..9a8f7325c9a5 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/post_outbound_rules_v2.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/post_outbound_rules_v2.py @@ -48,6 +48,6 @@ def main(): print(item) -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/postOutboundRulesV2.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/postOutboundRulesV2.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/provision_managed_network.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/provision_managed_network.py index bbcb08dd740b..6513cbb02a91 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/provision_managed_network.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/provision_managed_network.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ManagedNetwork/provisionManagedNetwork.json +# x-ms-original-file: 2026-11-01/ManagedNetwork/provisionManagedNetwork.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/purge_deleted_account.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/purge_deleted_account.py index 1f7e62293b9e..e5b4ba84b7d1 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/purge_deleted_account.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/purge_deleted_account.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-09-15-preview/PurgeDeletedAccount.json +# x-ms-original-file: 2026-11-01/PurgeDeletedAccount.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_commitment_plan.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_commitment_plan.py index 0d2605c793c9..751cebb176e3 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_commitment_plan.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_commitment_plan.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutCommitmentPlan.json +# x-ms-original-file: 2026-11-01/PutCommitmentPlan.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_compute.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_compute.py deleted file mode 100644 index 548cd90baf24..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_compute.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python put_compute.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.computes.begin_create_or_update( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - compute_name="myCompute", - resource={ - "identity": {"type": "None"}, - "properties": { - "computeType": "Cluster", - "location": "eastus", - "pools": [ - {"instanceType": "Standard_DS3_v2", "name": "default", "nodeCount": 2, "vmPriority": "Regular"} - ], - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-09-15-preview/PutCompute.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_defender_for_ai_setting.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_defender_for_ai_setting.py index 48b7a0ee9ae8..610f48d2252c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_defender_for_ai_setting.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_defender_for_ai_setting.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutDefenderForAISetting.json +# x-ms-original-file: 2026-11-01/PutDefenderForAISetting.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_deployment.py index edf3f6cb0ce2..bbd0cc012bd0 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_deployment.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_deployment.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutDeployment.json +# x-ms-original-file: 2026-11-01/PutDeployment.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_deployment_with_speculative_decoding.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_deployment_with_speculative_decoding.py index aed9dbad8bef..1fc391e76d4a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_deployment_with_speculative_decoding.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_deployment_with_speculative_decoding.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,15 +39,6 @@ def main(): "deploymentState": "Running", "model": {"format": "Fireworks", "name": "FW-Qwen3-14B", "version": "1"}, "serviceTier": "Default", - "speculativeDecoding": { - "draftModel": { - "format": "FireworksCustom", - "name": "testDraftModel", - "source": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName/projects/projectName", - "version": "1", - }, - "draftTokenCount": 4, - }, }, "sku": {"capacity": 80, "name": "GlobalProvisionedManaged"}, }, @@ -56,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutDeploymentWithSpeculativeDecoding.json +# x-ms-original-file: 2026-11-01/PutDeploymentWithSpeculativeDecoding.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_encryption_scope.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_encryption_scope.py index 2fe3b4c115c6..9655a7c185e7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_encryption_scope.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_encryption_scope.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutEncryptionScope.json +# x-ms-original-file: 2026-11-01/PutEncryptionScope.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_private_endpoint_connection.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_private_endpoint_connection.py index ecd28ae24d8c..e23444709259 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_private_endpoint_connection.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_private_endpoint_connection.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutPrivateEndpointConnection.json +# x-ms-original-file: 2026-11-01/PutPrivateEndpointConnection.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_binding.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_binding.py deleted file mode 100644 index da7570cd569a..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_binding.py +++ /dev/null @@ -1,50 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python put_rai_binding.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.rai_bindings.create_or_update( - resource_group_name="resource-group", - account_name="safety-account", - rai_binding_name="chat-guard", - rai_binding={ - "properties": { - "boundResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.CognitiveServices/accounts/aoai-account/deployments/chat-prod", - "targetPolicyName": "agent-guard", - } - }, - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/PutRaiBinding.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_blocklist.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_blocklist.py index 508a97e6725d..ac3c4d503943 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_blocklist.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_blocklist.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutRaiBlocklist.json +# x-ms-original-file: 2026-11-01/PutRaiBlocklist.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_blocklist_item.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_blocklist_item.py index e69991e6e419..558060dcbb72 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_blocklist_item.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_blocklist_item.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutRaiBlocklistItem.json +# x-ms-original-file: 2026-11-01/PutRaiBlocklistItem.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_external_safety_provider.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_external_safety_provider.py index 2b8d700c92ca..c293c65269ab 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_external_safety_provider.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_external_safety_provider.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutRaiExternalSafetyProvider.json +# x-ms-original-file: 2026-11-01/PutRaiExternalSafetyProvider.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy.py index 98b607e843e9..5e18688db3b5 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy.py @@ -106,6 +106,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutRaiPolicy.json +# x-ms-original-file: 2026-11-01/PutRaiPolicy.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_acs.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_acs.py index f9ec7e6d1761..fa4d22aaf7b6 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_acs.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_acs.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,73 +36,13 @@ def main(): rai_policy_name="agent-guard", rai_policy={ "properties": { - "acs": { - "agent_control_specification_version": "0.4.0-alpha.1", - "annotators": {}, - "intervention_points": { - "input": { - "policy": { - "aacs_moderation": { - "harm_configs": [{"category": "PromptInjection"}], - "subject_format": "text", - }, - "id": "input-guard", - }, - "policy_target": "$snap.input", - "policy_target_kind": "user_input", - }, - "post_tool_call": { - "policy": {"id": "tool-guard"}, - "policy_target": "$snap.tool_result.value", - "policy_target_kind": "tool_result", - "tool_name_from": "$snap.tool_call.name", - }, - "pre_tool_call": { - "policy": {"id": "tool-guard"}, - "policy_target": "$snap.tool_call.args", - "policy_target_kind": "tool_args", - "tool_name_from": "$snap.tool_call.name", - }, - }, - "metadata": {"name": "agent-guard"}, - "policies": { - "input-guard": {"query": "data.input_guard.verdict", "type": "rego"}, - "tool-guard": {"query": "data.tool_guard.verdict", "type": "rego"}, - }, - "tools": { - "web_search": { - "allowed_domains": ["learn.microsoft.com"], - "clearance": "public", - "description": "Search approved public documentation", - "id": "web_search", - "security_labels": ["network_egress", "untrusted_content"], - "type": "retrieval", - }, - "wire_transfer": { - "clearance": "confidential", - "id": "wire_transfer", - "security_labels": ["financial_write"], - "type": "financial_action", - }, - }, - }, - "acsRegos": [{"regoName": "input-guard"}, {"regoName": "tool-guard"}], - "customBlocklists": [{"blocking": True, "blocklistName": "blocked-terms", "source": "Prompt"}], - "customExternalSafetyProviders": [ - { - "blocking": True, - "externalSafetyProviderName": "contoso-safety-provider", - "managedIdentityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/safety-provider-identity", - "source": "Prompt", - } - ], - "format": "ACS", + "customBlocklists": [{"blocking": True, "blocklistName": "blocked-terms", "source": "Prompt"}] } }, ) print(response) -# x-ms-original-file: 2026-09-15-preview/PutRaiPolicyAcs.json +# x-ms-original-file: 2026-11-01/PutRaiPolicyAcs.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_acs_without_tools.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_acs_without_tools.py index c675e61677e7..186029c706c9 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_acs_without_tools.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_acs_without_tools.py @@ -34,27 +34,11 @@ def main(): resource_group_name="resource-group", account_name="safety-account", rai_policy_name="input-guard", - rai_policy={ - "properties": { - "acs": { - "agent_control_specification_version": "0.4.0-alpha.1", - "intervention_points": { - "input": { - "policy": {"id": "input-guard"}, - "policy_target": "$snap.input", - "policy_target_kind": "user_input", - } - }, - "policies": {"input-guard": {"query": "data.input_guard.verdict", "type": "rego"}}, - }, - "acsRegos": [{"regoName": "input-guard"}], - "format": "ACS", - } - }, + rai_policy={"properties": {}}, ) print(response) -# x-ms-original-file: 2026-09-15-preview/PutRaiPolicyAcsWithoutTools.json +# x-ms-original-file: 2026-11-01/PutRaiPolicyAcsWithoutTools.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_with_egress.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_with_egress.py index 34f5a46f79de..ab32870ba83c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_with_egress.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_policy_with_egress.py @@ -92,6 +92,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutRaiPolicyWithEgress.json +# x-ms-original-file: 2026-11-01/PutRaiPolicyWithEgress.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_rego.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_rego.py deleted file mode 100644 index c18727234bfb..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_rego.py +++ /dev/null @@ -1,51 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python put_rai_rego.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.rai_regos.create_or_update( - resource_group_name="resource-group", - account_name="safety-account", - rai_rego_name="input-guard", - rai_rego={ - "properties": { - "encoding": "None", - "rego": 'package input_guard\n\nimport rego.v1\n\ndefault verdict := {"decision": "allow"}\n\nverdict := {"decision": "deny", "reason": "prompt_injection_detected"} if {\n input.snapshot.moderation.harm.PromptInjection.detected\n}', - }, - "tags": {"environment": "production"}, - }, - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/PutRaiRego.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_tool_label.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_tool_label.py index abe51833aa13..ab420608bced 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_tool_label.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_tool_label.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutRaiToolLabel.json +# x-ms-original-file: 2026-11-01/PutRaiToolLabel.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_topic.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_topic.py index 5a6d29ecfe44..29453d8f7a93 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_topic.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_rai_topic.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutRaiTopic.json +# x-ms-original-file: 2026-11-01/PutRaiTopic.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_subscription_rai_policy.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_subscription_rai_policy.py index 500baf727774..d3d18d2ee336 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_subscription_rai_policy.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_subscription_rai_policy.py @@ -104,6 +104,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/PutSubscriptionRaiPolicy.json +# x-ms-original-file: 2026-11-01/PutSubscriptionRaiPolicy.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_workbench.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_workbench.py deleted file mode 100644 index e285e1392671..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_workbench.py +++ /dev/null @@ -1,62 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python put_workbench.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.workbenches.begin_create_or_update( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - project_name="myProject", - workbench_name="myWorkbench", - resource={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rgcognitiveservices/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {} - }, - }, - "properties": { - "datasetId": "dataset-12345", - "gpuCount": 1, - "idleTimeBeforeShutdown": "PT30M", - "imageLink": "mcr.microsoft.com/azureml/curated/pytorch-gpu:latest", - "instanceType": "Singularity.ND12_H100_v5-n1", - "sshSettings": {"adminEnabled": True, "sshPublicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQ..."}, - "targetClusterId": "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/vc-rg/providers/Microsoft.MachineLearningServices/virtualClusters/test-vc", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-09-15-preview/PutWorkbench.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/reconcile_network_security_perimeter_configurations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/reconcile_network_security_perimeter_configurations.py index 098892e138ac..c603ecb67fec 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/reconcile_network_security_perimeter_configurations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/reconcile_network_security_perimeter_configurations.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ReconcileNetworkSecurityPerimeterConfigurations.json +# x-ms-original-file: 2026-11-01/ReconcileNetworkSecurityPerimeterConfigurations.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/regenerate_key.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/regenerate_key.py index 2dec6990198b..c9f0bbb65e3a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/regenerate_key.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/regenerate_key.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/RegenerateKey.json +# x-ms-original-file: 2026-11-01/RegenerateKey.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/restart_container_instance_compute.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/restart_container_instance_compute.py deleted file mode 100644 index 7dd3f687981c..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/restart_container_instance_compute.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python restart_container_instance_compute.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.computes.begin_restart( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - compute_name="myContainerInstance", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/RestartContainerInstanceCompute.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/restart_workbench.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/restart_workbench.py deleted file mode 100644 index 1389b914d047..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/restart_workbench.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python restart_workbench.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.workbenches.begin_restart( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - project_name="myProject", - workbench_name="myWorkbench", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/RestartWorkbench.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/resume_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/resume_deployment.py index cb82a1aed460..15c347fe4e11 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/resume_deployment.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/resume_deployment.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/ResumeDeployment.json +# x-ms-original-file: 2026-11-01/ResumeDeployment.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start.py index 58b4aa6ab66a..6ab6f0fb79fa 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: 2026-09-15-preview/AgentDeployment/start.json +# x-ms-original-file: 2026-11-01/AgentDeployment/start.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start_container_instance_compute.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start_container_instance_compute.py deleted file mode 100644 index 858c590ecf8f..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start_container_instance_compute.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python start_container_instance_compute.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.computes.begin_start( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - compute_name="myContainerInstance", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/StartContainerInstanceCompute.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start_workbench.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start_workbench.py deleted file mode 100644 index 7ea3efcdb5d3..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/start_workbench.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python start_workbench.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.workbenches.begin_start( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - project_name="myProject", - workbench_name="myWorkbench", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/StartWorkbench.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop.py index 32f12fc0833e..fdc119021e19 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: 2026-09-15-preview/AgentDeployment/stop.json +# x-ms-original-file: 2026-11-01/AgentDeployment/stop.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop_container_instance_compute.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop_container_instance_compute.py deleted file mode 100644 index e84dc9eeccd1..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop_container_instance_compute.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python stop_container_instance_compute.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.computes.begin_stop( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - compute_name="myContainerInstance", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/StopContainerInstanceCompute.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop_workbench.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop_workbench.py deleted file mode 100644 index 8d97c5e82c8a..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/stop_workbench.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python stop_workbench.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.workbenches.begin_stop( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - project_name="myProject", - workbench_name="myWorkbench", - ).result() - - -# x-ms-original-file: 2026-09-15-preview/StopWorkbench.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/test_rai_external_safety_provider.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/test_rai_external_safety_provider.py index 46870c83abe3..16cf25e2a307 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/test_rai_external_safety_provider.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/test_rai_external_safety_provider.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/TestRaiExternalSafetyProvider.json +# x-ms-original-file: 2026-11-01/TestRaiExternalSafetyProvider.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update.py index 3ec60312b9a5..863957fc12dd 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/AccountConnection/update.json +# x-ms-original-file: 2026-11-01/AccountConnection/update.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account.py index d5ffc5e5acf1..4af21cf8a555 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -34,20 +33,11 @@ def main(): response = client.accounts.begin_update( resource_group_name="bvttest", account_name="bingSearch", - account={ - "location": "global", - "properties": { - "costControlConnections": { - "appInsightsConnectionId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/bvttest/providers/Microsoft.CognitiveServices/accounts/bingSearch/connections/myAppInsightsConnection", - "eventGridConnectionId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/bvttest/providers/Microsoft.CognitiveServices/accounts/bingSearch/connections/myEventGridConnection", - } - }, - "sku": {"name": "S2"}, - }, + account={"location": "global", "properties": {}, "sku": {"name": "S2"}}, ).result() print(response) -# x-ms-original-file: 2026-09-15-preview/UpdateAccount.json +# x-ms-original-file: 2026-11-01/UpdateAccount.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_workbench.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account_clear_trusted_certificate_sources.py similarity index 80% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_workbench.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account_clear_trusted_certificate_sources.py index 745fe00d38ad..b14ca51c05b8 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/get_workbench.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account_clear_trusted_certificate_sources.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-cognitiveservices # USAGE - python get_workbench.py + python update_account_clear_trusted_certificate_sources.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,15 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.workbenches.get( - resource_group_name="rgcognitiveservices", + response = client.accounts.begin_update( + resource_group_name="myResourceGroup", account_name="myAccount", - project_name="myProject", - workbench_name="myWorkbench", - ) + account={"properties": {"trustedCertificateSources": []}}, + ).result() print(response) -# x-ms-original-file: 2026-09-15-preview/GetWorkbench.json +# x-ms-original-file: 2026-11-01/UpdateAccountClearTrustedCertificateSources.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account_preserve_trusted_certificate_sources.py similarity index 78% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account_preserve_trusted_certificate_sources.py index 2cfa7ae6e649..91d018a6f6e5 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account_preserve_trusted_certificate_sources.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-cognitiveservices # USAGE - python update_workbench.py + python update_account_preserve_trusted_certificate_sources.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,16 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.workbenches.update( - resource_group_name="rgcognitiveservices", + response = client.accounts.begin_update( + resource_group_name="myResourceGroup", account_name="myAccount", - project_name="myProject", - workbench_name="myWorkbench", - properties={"properties": {"idleTimeBeforeShutdown": "PT1H"}}, - ) + account={"properties": {"trustedCertificateSources": None}, "tags": {"environment": "production"}}, + ).result() print(response) -# x-ms-original-file: 2026-09-15-preview/UpdateWorkbench.json +# x-ms-original-file: 2026-11-01/UpdateAccountPreserveTrustedCertificateSources.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_workbench_pending.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account_rotate_trusted_certificate_sources.py similarity index 61% rename from sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_workbench_pending.py rename to sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account_rotate_trusted_certificate_sources.py index 414259ca6cb3..dab941f8a50a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/put_workbench_pending.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_account_rotate_trusted_certificate_sources.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-cognitiveservices # USAGE - python put_workbench_pending.py + python update_account_rotate_trusted_certificate_sources.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,21 +31,27 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.workbenches.begin_create_or_update( - resource_group_name="rgcognitiveservices", + response = client.accounts.begin_update( + resource_group_name="myResourceGroup", account_name="myAccount", - project_name="myProject", - workbench_name="myWorkbench", - resource={ + account={ "properties": { - "imageLink": "mcr.microsoft.com/azureml/curated/pytorch-gpu:latest", - "targetClusterId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rgcognitiveservices/providers/Microsoft.CognitiveServices/accounts/myAccount/computes/myCluster", + "trustedCertificateSources": [ + { + "certificateBundleReferences": [ + {"secretName": "corporate-ca-bundle", "secretVersion": "33333333333333333333333333333333"}, + {"secretName": "partner-ca-bundle", "secretVersion": "22222222222222222222222222222222"}, + ], + "resourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myKeyVault", + "type": "AzureKeyVault", + } + ] } }, ).result() print(response) -# x-ms-original-file: 2026-09-15-preview/PutWorkbenchPending.json +# x-ms-original-file: 2026-11-01/UpdateAccountRotateTrustedCertificateSources.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_arc_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_arc_deployment.py deleted file mode 100644 index 82ffe735ce35..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_arc_deployment.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python update_arc_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.arc_deployments.begin_update( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="phi-3-arc", - properties={ - "properties": { - "nodeSelector": {"agentpool": "cpu"}, - "replicas": 3, - "resources": {"limits": {"cpu": "4", "memory": "16Gi"}, "requests": {"cpu": "500m", "memory": "2Gi"}}, - } - }, - ).result() - print(response) - - -# x-ms-original-file: 2026-09-15-preview/UpdateArcDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_defender_for_ai_setting.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_defender_for_ai_setting.py index 758ea85f47ef..95af7a87a1fc 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_defender_for_ai_setting.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_defender_for_ai_setting.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/UpdateDefenderForAISetting.json +# x-ms-original-file: 2026-11-01/UpdateDefenderForAISetting.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_deployment.py index dec14e388b10..1d7221b1ccc6 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_deployment.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_deployment.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/UpdateDeployment.json +# x-ms-original-file: 2026-11-01/UpdateDeployment.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_managed_compute_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_managed_compute_deployment.py deleted file mode 100644 index a26c838ceb6c..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_managed_compute_deployment.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python update_managed_compute_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.managed_compute_deployments.begin_update( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="gpt-oss-120b-gpu", - properties={"sku": {"capacity": 2, "name": "GlobalManagedCompute"}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-09-15-preview/UpdateManagedComputeDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_metadata.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_metadata.py deleted file mode 100644 index 8c76ef1ff423..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_metadata.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python update_metadata.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.cost_controls.update( - resource_group_name="foundry-resource-group", - account_name="foundry-account", - cost_control_name="legacy-budget", - properties={"properties": {"displayName": "Renamed legacy budget"}}, - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/CostControl/updateMetadata.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_projects.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_projects.py index e4ed15334436..579d944ec654 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_projects.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_projects.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/UpdateProjects.json +# x-ms-original-file: 2026-11-01/UpdateProjects.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_quota_tier.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_quota_tier.py index a4d64e003f2c..dcf817b8bd09 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_quota_tier.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_quota_tier.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/UpdateQuotaTier.json +# x-ms-original-file: 2026-11-01/UpdateQuotaTier.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_binding.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_binding.py deleted file mode 100644 index 235bb632e3f7..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_binding.py +++ /dev/null @@ -1,50 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python update_rai_binding.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.rai_bindings.create_or_update( - resource_group_name="resource-group", - account_name="safety-account", - rai_binding_name="chat-guard", - rai_binding={ - "properties": { - "boundResourceId": "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/target-resource-group/providers/Microsoft.CognitiveServices/accounts/aoai-account/deployments/chat-canary", - "targetPolicyName": "agent-guard-v2", - } - }, - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/UpdateRaiBinding.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_policy_acs.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_policy_acs.py index 740c94a3b678..42ccc7480a4c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_policy_acs.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_policy_acs.py @@ -34,69 +34,11 @@ def main(): resource_group_name="resource-group", account_name="safety-account", rai_policy_name="agent-guard", - rai_policy={ - "properties": { - "acs": { - "agent_control_specification_version": "0.4.0-alpha.1", - "intervention_points": { - "input": { - "policy": { - "aacs_moderation": { - "harm_configs": [ - {"category": "Hate", "harm_config_id": "Hate_Text_MultiSev"}, - {"category": "PromptInjection"}, - ], - "subject_format": "text", - }, - "id": "input-guard", - }, - "policy_target": "$snap.input", - "policy_target_kind": "user_input", - }, - "post_tool_call": { - "policy": {"id": "tool-guard"}, - "policy_target": "$snap.tool_result.value", - "policy_target_kind": "tool_result", - "tool_name_from": "$snap.tool_call.name", - }, - "pre_tool_call": { - "policy": {"id": "tool-guard"}, - "policy_target": "$snap.tool_call.args", - "policy_target_kind": "tool_args", - "tool_name_from": "$snap.tool_call.name", - }, - }, - "policies": { - "input-guard": {"query": "data.input_guard.verdict", "type": "rego"}, - "tool-guard": {"query": "data.tool_guard.verdict", "type": "rego"}, - }, - "tools": { - "web_search": { - "allowed_domains": ["learn.microsoft.com", "support.microsoft.com"], - "clearance": "public", - "description": "Search approved public documentation and approved partner sites", - "id": "web_search", - "security_labels": ["network_egress", "untrusted_content"], - "type": "retrieval", - }, - "wire_transfer": { - "clearance": "confidential", - "id": "wire_transfer", - "security_labels": ["financial_write"], - "type": "financial_action", - }, - }, - }, - "acsRegos": [{"regoName": "input-guard"}, {"regoName": "tool-guard"}], - "customBlocklists": [], - "customExternalSafetyProviders": [], - "format": "ACS", - } - }, + rai_policy={"properties": {"customBlocklists": []}}, ) print(response) -# x-ms-original-file: 2026-09-15-preview/UpdateRaiPolicyAcs.json +# x-ms-original-file: 2026-11-01/UpdateRaiPolicyAcs.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_rego.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_rego.py deleted file mode 100644 index 4ed0adf4d1af..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_rai_rego.py +++ /dev/null @@ -1,50 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python update_rai_rego.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.rai_regos.create_or_update( - resource_group_name="resource-group", - account_name="safety-account", - rai_rego_name="input-guard", - rai_rego={ - "properties": { - "encoding": "None", - "rego": 'package input_guard\n\nimport rego.v1\n\ndefault verdict := {"decision": "allow"}\n\nblocking_signal if {\n input.snapshot.moderation.harm.PromptInjection.detected\n}\n\nblocking_signal if {\n input.snapshot.moderation.harm.Hate.severity >= 4\n}\n\nverdict := {"decision": "deny", "reason": "unsafe_input"} if {\n blocking_signal\n}', - } - }, - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/UpdateRaiRego.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_shared_commitment_plan.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_shared_commitment_plan.py index f47af6d2f3d3..0e42fbe417d7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_shared_commitment_plan.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_shared_commitment_plan.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-09-15-preview/UpdateSharedCommitmentPlan.json +# x-ms-original-file: 2026-11-01/UpdateSharedCommitmentPlan.json if __name__ == "__main__": main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_vm_managed_compute_deployment.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_vm_managed_compute_deployment.py deleted file mode 100644 index e5c3e12f9b11..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_vm_managed_compute_deployment.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python update_vm_managed_compute_deployment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.managed_compute_deployments.begin_update( - resource_group_name="resourceGroupName", - account_name="accountName", - deployment_name="gpt-oss-120b-byoc", - properties={"sku": {"capacity": 2, "name": "VmManagedCompute"}}, - ).result() - print(response) - - -# x-ms-original-file: 2026-09-15-preview/UpdateVmManagedComputeDeployment.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench_compute_properties.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench_compute_properties.py deleted file mode 100644 index 1d18062d1f4a..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench_compute_properties.py +++ /dev/null @@ -1,59 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python update_workbench_compute_properties.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.workbenches.update( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - project_name="myProject", - workbench_name="myWorkbench", - properties={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/rgcognitiveservices/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {} - }, - }, - "properties": { - "gpuCount": 1, - "idleTimeBeforeShutdown": "PT1H", - "instanceType": "Singularity.ND12_H100_v5-n1", - "targetClusterId": "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/vc-rg/providers/Microsoft.MachineLearningServices/virtualClusters/test-vc", - }, - }, - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/UpdateWorkbenchComputeProperties.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench_reset_compute_properties.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench_reset_compute_properties.py deleted file mode 100644 index 1fd44d567b00..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_samples/update_workbench_reset_compute_properties.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cognitiveservices -# USAGE - python update_workbench_reset_compute_properties.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CognitiveServicesManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.workbenches.update( - resource_group_name="rgcognitiveservices", - account_name="myAccount", - project_name="myProject", - workbench_name="myWorkbench", - properties={"properties": {"gpuCount": None, "instanceType": None}}, - ) - print(response) - - -# x-ms-original-file: 2026-09-15-preview/UpdateWorkbenchResetComputeProperties.json -if __name__ == "__main__": - main() diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_accounts_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_accounts_operations.py index 7bf0c649dabd..4157ef1010fa 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_accounts_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_accounts_operations.py @@ -50,7 +50,6 @@ def test_accounts_begin_create(self, resource_group): "properties": { "a365LoggingEnabled": bool, "abusePenalty": {"action": "str", "expiration": "2020-02-20 00:00:00", "rateLimitPercentage": 0.0}, - "agentHostingConfigurations": ["agent_hosting_configuration"], "allowProjectManagement": bool, "allowedFqdnList": ["str"], "amlWorkspace": {"identityClientId": "str", "resourceId": "str"}, @@ -82,10 +81,7 @@ def test_accounts_begin_create(self, resource_group): ], }, "capabilities": [{"name": "str", "value": "str"}], - "capabilitySettings": {"blobStore": "str", "documentStore": "str", "vectorStore": "str"}, "commitmentPlanAssociations": [{"commitmentPlanId": "str", "commitmentPlanLocation": "str"}], - "costControlConnections": {"appInsightsConnectionId": "str", "eventGridConnectionId": "str"}, - "costControlIds": ["str"], "customSubDomainName": "str", "dateCreated": "str", "defaultProject": "str", @@ -103,12 +99,6 @@ def test_accounts_begin_create(self, resource_group): }, "endpoint": "str", "endpoints": {"str": "str"}, - "foundryAutoUpgrade": { - "mode": "str", - "plannedByMicrosoft": bool, - "scheduledAt": "2020-02-20 00:00:00", - "statusReason": "str", - }, "internalId": "str", "isMigrated": bool, "locations": { @@ -180,6 +170,13 @@ def test_accounts_begin_create(self, resource_group): "lastChangeDate": "str", }, "storedCompletionsDisabled": bool, + "trustedCertificateSources": [ + { + "certificateBundleReferences": [{"secretName": "str", "secretVersion": "str"}], + "resourceId": "str", + "type": "str", + } + ], "userOwnedStorage": [{"identityClientId": "str", "resourceId": "str"}], }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, @@ -220,7 +217,6 @@ def test_accounts_begin_update(self, resource_group): "properties": { "a365LoggingEnabled": bool, "abusePenalty": {"action": "str", "expiration": "2020-02-20 00:00:00", "rateLimitPercentage": 0.0}, - "agentHostingConfigurations": ["agent_hosting_configuration"], "allowProjectManagement": bool, "allowedFqdnList": ["str"], "amlWorkspace": {"identityClientId": "str", "resourceId": "str"}, @@ -252,10 +248,7 @@ def test_accounts_begin_update(self, resource_group): ], }, "capabilities": [{"name": "str", "value": "str"}], - "capabilitySettings": {"blobStore": "str", "documentStore": "str", "vectorStore": "str"}, "commitmentPlanAssociations": [{"commitmentPlanId": "str", "commitmentPlanLocation": "str"}], - "costControlConnections": {"appInsightsConnectionId": "str", "eventGridConnectionId": "str"}, - "costControlIds": ["str"], "customSubDomainName": "str", "dateCreated": "str", "defaultProject": "str", @@ -273,12 +266,6 @@ def test_accounts_begin_update(self, resource_group): }, "endpoint": "str", "endpoints": {"str": "str"}, - "foundryAutoUpgrade": { - "mode": "str", - "plannedByMicrosoft": bool, - "scheduledAt": "2020-02-20 00:00:00", - "statusReason": "str", - }, "internalId": "str", "isMigrated": bool, "locations": { @@ -350,6 +337,13 @@ def test_accounts_begin_update(self, resource_group): "lastChangeDate": "str", }, "storedCompletionsDisabled": bool, + "trustedCertificateSources": [ + { + "certificateBundleReferences": [{"secretName": "str", "secretVersion": "str"}], + "resourceId": "str", + "type": "str", + } + ], "userOwnedStorage": [{"identityClientId": "str", "resourceId": "str"}], }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, @@ -453,46 +447,3 @@ def test_accounts_list_models(self, resource_group): result = [r for r in response] # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_accounts_evaluate_deployment_policies(self, resource_group): - response = self.client.accounts.evaluate_deployment_policies( - resource_group_name=resource_group.name, - account_name="str", - body={ - "deployments": [ - { - "name": "str", - "properties": { - "model": { - "callRateLimit": { - "count": 0.0, - "renewalPeriod": 0.0, - "rules": [ - { - "count": 0.0, - "dynamicThrottlingEnabled": bool, - "key": "str", - "matchPatterns": [{"method": "str", "path": "str"}], - "minCount": 0.0, - "renewalPeriod": 0.0, - } - ], - }, - "format": "str", - "name": "str", - "publisher": "str", - "source": "str", - "sourceAccount": "str", - "version": "str", - }, - "raiPolicyName": "str", - }, - } - ] - }, - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_accounts_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_accounts_operations_async.py index cb53857c6623..6105c8013e27 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_accounts_operations_async.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_accounts_operations_async.py @@ -56,7 +56,6 @@ async def test_accounts_begin_create(self, resource_group): "expiration": "2020-02-20 00:00:00", "rateLimitPercentage": 0.0, }, - "agentHostingConfigurations": ["agent_hosting_configuration"], "allowProjectManagement": bool, "allowedFqdnList": ["str"], "amlWorkspace": {"identityClientId": "str", "resourceId": "str"}, @@ -88,10 +87,7 @@ async def test_accounts_begin_create(self, resource_group): ], }, "capabilities": [{"name": "str", "value": "str"}], - "capabilitySettings": {"blobStore": "str", "documentStore": "str", "vectorStore": "str"}, "commitmentPlanAssociations": [{"commitmentPlanId": "str", "commitmentPlanLocation": "str"}], - "costControlConnections": {"appInsightsConnectionId": "str", "eventGridConnectionId": "str"}, - "costControlIds": ["str"], "customSubDomainName": "str", "dateCreated": "str", "defaultProject": "str", @@ -109,12 +105,6 @@ async def test_accounts_begin_create(self, resource_group): }, "endpoint": "str", "endpoints": {"str": "str"}, - "foundryAutoUpgrade": { - "mode": "str", - "plannedByMicrosoft": bool, - "scheduledAt": "2020-02-20 00:00:00", - "statusReason": "str", - }, "internalId": "str", "isMigrated": bool, "locations": { @@ -186,6 +176,13 @@ async def test_accounts_begin_create(self, resource_group): "lastChangeDate": "str", }, "storedCompletionsDisabled": bool, + "trustedCertificateSources": [ + { + "certificateBundleReferences": [{"secretName": "str", "secretVersion": "str"}], + "resourceId": "str", + "type": "str", + } + ], "userOwnedStorage": [{"identityClientId": "str", "resourceId": "str"}], }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, @@ -232,7 +229,6 @@ async def test_accounts_begin_update(self, resource_group): "expiration": "2020-02-20 00:00:00", "rateLimitPercentage": 0.0, }, - "agentHostingConfigurations": ["agent_hosting_configuration"], "allowProjectManagement": bool, "allowedFqdnList": ["str"], "amlWorkspace": {"identityClientId": "str", "resourceId": "str"}, @@ -264,10 +260,7 @@ async def test_accounts_begin_update(self, resource_group): ], }, "capabilities": [{"name": "str", "value": "str"}], - "capabilitySettings": {"blobStore": "str", "documentStore": "str", "vectorStore": "str"}, "commitmentPlanAssociations": [{"commitmentPlanId": "str", "commitmentPlanLocation": "str"}], - "costControlConnections": {"appInsightsConnectionId": "str", "eventGridConnectionId": "str"}, - "costControlIds": ["str"], "customSubDomainName": "str", "dateCreated": "str", "defaultProject": "str", @@ -285,12 +278,6 @@ async def test_accounts_begin_update(self, resource_group): }, "endpoint": "str", "endpoints": {"str": "str"}, - "foundryAutoUpgrade": { - "mode": "str", - "plannedByMicrosoft": bool, - "scheduledAt": "2020-02-20 00:00:00", - "statusReason": "str", - }, "internalId": "str", "isMigrated": bool, "locations": { @@ -362,6 +349,13 @@ async def test_accounts_begin_update(self, resource_group): "lastChangeDate": "str", }, "storedCompletionsDisabled": bool, + "trustedCertificateSources": [ + { + "certificateBundleReferences": [{"secretName": "str", "secretVersion": "str"}], + "resourceId": "str", + "type": "str", + } + ], "userOwnedStorage": [{"identityClientId": "str", "resourceId": "str"}], }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, @@ -468,46 +462,3 @@ async def test_accounts_list_models(self, resource_group): result = [r async for r in response] # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_accounts_evaluate_deployment_policies(self, resource_group): - response = await self.client.accounts.evaluate_deployment_policies( - resource_group_name=resource_group.name, - account_name="str", - body={ - "deployments": [ - { - "name": "str", - "properties": { - "model": { - "callRateLimit": { - "count": 0.0, - "renewalPeriod": 0.0, - "rules": [ - { - "count": 0.0, - "dynamicThrottlingEnabled": bool, - "key": "str", - "matchPatterns": [{"method": "str", "path": "str"}], - "minCount": 0.0, - "renewalPeriod": 0.0, - } - ], - }, - "format": "str", - "name": "str", - "publisher": "str", - "source": "str", - "sourceAccount": "str", - "version": "str", - }, - "raiPolicyName": "str", - }, - } - ] - }, - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_adapter_deployments_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_adapter_deployments_operations.py deleted file mode 100644 index 285405d03bcc..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_adapter_deployments_operations.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementAdapterDeploymentsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_adapter_deployments_get(self, resource_group): - response = self.client.adapter_deployments.get( - resource_group_name=resource_group.name, - account_name="str", - adapter_deployment_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_adapter_deployments_begin_create_or_update(self, resource_group): - response = self.client.adapter_deployments.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - adapter_deployment_name="str", - resource={ - "etag": "str", - "id": "str", - "name": "str", - "properties": { - "sourceModelId": "str", - "targetDeploymentName": "str", - "activeTargetDeploymentName": "str", - "lastOperation": { - "startedAt": "2020-02-20 00:00:00", - "status": "str", - "type": "str", - "completedAt": "2020-02-20 00:00:00", - "requestedTargetDeploymentName": "str", - }, - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_adapter_deployments_list(self, resource_group): - response = self.client.adapter_deployments.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_adapter_deployments_begin_delete(self, resource_group): - response = self.client.adapter_deployments.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - adapter_deployment_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_adapter_deployments_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_adapter_deployments_operations_async.py deleted file mode 100644 index 6abbe656dc77..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_adapter_deployments_operations_async.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementAdapterDeploymentsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_adapter_deployments_get(self, resource_group): - response = await self.client.adapter_deployments.get( - resource_group_name=resource_group.name, - account_name="str", - adapter_deployment_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_adapter_deployments_begin_create_or_update(self, resource_group): - response = await ( - await self.client.adapter_deployments.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - adapter_deployment_name="str", - resource={ - "etag": "str", - "id": "str", - "name": "str", - "properties": { - "sourceModelId": "str", - "targetDeploymentName": "str", - "activeTargetDeploymentName": "str", - "lastOperation": { - "startedAt": "2020-02-20 00:00:00", - "status": "str", - "type": "str", - "completedAt": "2020-02-20 00:00:00", - "requestedTargetDeploymentName": "str", - }, - "provisioningState": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_adapter_deployments_list(self, resource_group): - response = self.client.adapter_deployments.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_adapter_deployments_begin_delete(self, resource_group): - response = await ( - await self.client.adapter_deployments.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - adapter_deployment_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_arc_deployments_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_arc_deployments_operations.py deleted file mode 100644 index e15af8d237d2..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_arc_deployments_operations.py +++ /dev/null @@ -1,128 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementArcDeploymentsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_arc_deployments_get(self, resource_group): - response = self.client.arc_deployments.get( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_arc_deployments_begin_create_or_update(self, resource_group): - response = self.client.arc_deployments.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - resource={ - "properties": { - "compute": "str", - "extensionId": "str", - "model": {"format": "str", "name": "str"}, - "replicas": 0, - "resources": { - "limits": {"cpu": "str", "gpu": 0, "memory": "str"}, - "requests": {"cpu": "str", "memory": "str"}, - }, - "runtime": "str", - "capabilities": {"str": "str"}, - "deploymentState": "str", - "deploymentTemplate": "str", - "inferenceEndpoint": "str", - "nodeSelector": {"str": "str"}, - "provisioningDetails": {"lastOperationTimestamp": "2020-02-20 00:00:00", "message": "str"}, - "provisioningState": "str", - "raiPolicyName": "str", - "vllmParameters": { - "enforceEager": bool, - "gpuMemoryUtilization": 0.0, - "maxModelLen": 0, - "tensorParallelSize": 0, - }, - }, - "sku": {"name": "str"}, - "etag": "str", - "id": "str", - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_arc_deployments_begin_update(self, resource_group): - response = self.client.arc_deployments.begin_update( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - properties={ - "properties": { - "nodeSelector": {"str": "str"}, - "replicas": 0, - "resources": { - "limits": {"cpu": "str", "gpu": 0, "memory": "str"}, - "requests": {"cpu": "str", "memory": "str"}, - }, - } - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_arc_deployments_begin_delete(self, resource_group): - response = self.client.arc_deployments.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_arc_deployments_list(self, resource_group): - response = self.client.arc_deployments.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_arc_deployments_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_arc_deployments_operations_async.py deleted file mode 100644 index 428213a8d7a2..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_arc_deployments_operations_async.py +++ /dev/null @@ -1,135 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementArcDeploymentsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_arc_deployments_get(self, resource_group): - response = await self.client.arc_deployments.get( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_arc_deployments_begin_create_or_update(self, resource_group): - response = await ( - await self.client.arc_deployments.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - resource={ - "properties": { - "compute": "str", - "extensionId": "str", - "model": {"format": "str", "name": "str"}, - "replicas": 0, - "resources": { - "limits": {"cpu": "str", "gpu": 0, "memory": "str"}, - "requests": {"cpu": "str", "memory": "str"}, - }, - "runtime": "str", - "capabilities": {"str": "str"}, - "deploymentState": "str", - "deploymentTemplate": "str", - "inferenceEndpoint": "str", - "nodeSelector": {"str": "str"}, - "provisioningDetails": {"lastOperationTimestamp": "2020-02-20 00:00:00", "message": "str"}, - "provisioningState": "str", - "raiPolicyName": "str", - "vllmParameters": { - "enforceEager": bool, - "gpuMemoryUtilization": 0.0, - "maxModelLen": 0, - "tensorParallelSize": 0, - }, - }, - "sku": {"name": "str"}, - "etag": "str", - "id": "str", - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_arc_deployments_begin_update(self, resource_group): - response = await ( - await self.client.arc_deployments.begin_update( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - properties={ - "properties": { - "nodeSelector": {"str": "str"}, - "replicas": 0, - "resources": { - "limits": {"cpu": "str", "gpu": 0, "memory": "str"}, - "requests": {"cpu": "str", "memory": "str"}, - }, - } - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_arc_deployments_begin_delete(self, resource_group): - response = await ( - await self.client.arc_deployments.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_arc_deployments_list(self, resource_group): - response = self.client.arc_deployments.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_compute_operations_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_compute_operations_operations.py deleted file mode 100644 index 9195e10aee23..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_compute_operations_operations.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementComputeOperationsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_compute_operations_get(self, resource_group): - response = self.client.compute_operations.get( - location="str", - operation_id="str", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_compute_operations_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_compute_operations_operations_async.py deleted file mode 100644 index fc55ed377500..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_compute_operations_operations_async.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementComputeOperationsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_compute_operations_get(self, resource_group): - response = await self.client.compute_operations.get( - location="str", - operation_id="str", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_computes_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_computes_operations.py deleted file mode 100644 index baed03c1b358..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_computes_operations.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementComputesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_computes_get(self, resource_group): - response = self.client.computes.get( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_computes_begin_create_or_update(self, resource_group): - response = self.client.computes.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - resource={ - "properties": "compute_properties", - "etag": "str", - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "kind": "str", - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_computes_begin_delete(self, resource_group): - response = self.client.computes.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_computes_list(self, resource_group): - response = self.client.computes.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_computes_begin_start(self, resource_group): - response = self.client.computes.begin_start( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_computes_begin_stop(self, resource_group): - response = self.client.computes.begin_stop( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_computes_begin_restart(self, resource_group): - response = self.client.computes.begin_restart( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_computes_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_computes_operations_async.py deleted file mode 100644 index 0ad72c37a928..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_computes_operations_async.py +++ /dev/null @@ -1,135 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementComputesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_computes_get(self, resource_group): - response = await self.client.computes.get( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_computes_begin_create_or_update(self, resource_group): - response = await ( - await self.client.computes.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - resource={ - "properties": "compute_properties", - "etag": "str", - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "kind": "str", - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_computes_begin_delete(self, resource_group): - response = await ( - await self.client.computes.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_computes_list(self, resource_group): - response = self.client.computes.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_computes_begin_start(self, resource_group): - response = await ( - await self.client.computes.begin_start( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_computes_begin_stop(self, resource_group): - response = await ( - await self.client.computes.begin_stop( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_computes_begin_restart(self, resource_group): - response = await ( - await self.client.computes.begin_restart( - resource_group_name=resource_group.name, - account_name="str", - compute_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_cost_controls_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_cost_controls_operations.py deleted file mode 100644 index 6f67b7adce5e..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_cost_controls_operations.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementCostControlsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cost_controls_get(self, resource_group): - response = self.client.cost_controls.get( - resource_group_name=resource_group.name, - account_name="str", - cost_control_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cost_controls_create_or_update(self, resource_group): - response = self.client.cost_controls.create_or_update( - resource_group_name=resource_group.name, - account_name="str", - cost_control_name="str", - resource={ - "etag": "str", - "id": "str", - "name": "str", - "properties": { - "rules": [ - { - "amount": 0.0, - "counterKey": {"type": "str", "attribute": "str"}, - "name": "str", - "unit": "str", - "match": { - "agentResourceIds": ["str"], - "identityObjectIds": ["str"], - "projectIds": ["str"], - "sessionIds": ["str"], - }, - "period": "str", - "recurring": bool, - "thresholds": [{"action": "str", "type": "str", "value": 0.0}], - } - ], - "displayName": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cost_controls_update(self, resource_group): - response = self.client.cost_controls.update( - resource_group_name=resource_group.name, - account_name="str", - cost_control_name="str", - properties={ - "properties": { - "displayName": "str", - "rules": [ - { - "amount": 0.0, - "counterKey": {"type": "str", "attribute": "str"}, - "name": "str", - "unit": "str", - "match": { - "agentResourceIds": ["str"], - "identityObjectIds": ["str"], - "projectIds": ["str"], - "sessionIds": ["str"], - }, - "period": "str", - "recurring": bool, - "thresholds": [{"action": "str", "type": "str", "value": 0.0}], - } - ], - } - }, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cost_controls_delete(self, resource_group): - response = self.client.cost_controls.delete( - resource_group_name=resource_group.name, - account_name="str", - cost_control_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_cost_controls_list(self, resource_group): - response = self.client.cost_controls.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_cost_controls_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_cost_controls_operations_async.py deleted file mode 100644 index 626fc5164ae6..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_cost_controls_operations_async.py +++ /dev/null @@ -1,135 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementCostControlsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cost_controls_get(self, resource_group): - response = await self.client.cost_controls.get( - resource_group_name=resource_group.name, - account_name="str", - cost_control_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cost_controls_create_or_update(self, resource_group): - response = await self.client.cost_controls.create_or_update( - resource_group_name=resource_group.name, - account_name="str", - cost_control_name="str", - resource={ - "etag": "str", - "id": "str", - "name": "str", - "properties": { - "rules": [ - { - "amount": 0.0, - "counterKey": {"type": "str", "attribute": "str"}, - "name": "str", - "unit": "str", - "match": { - "agentResourceIds": ["str"], - "identityObjectIds": ["str"], - "projectIds": ["str"], - "sessionIds": ["str"], - }, - "period": "str", - "recurring": bool, - "thresholds": [{"action": "str", "type": "str", "value": 0.0}], - } - ], - "displayName": "str", - }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cost_controls_update(self, resource_group): - response = await self.client.cost_controls.update( - resource_group_name=resource_group.name, - account_name="str", - cost_control_name="str", - properties={ - "properties": { - "displayName": "str", - "rules": [ - { - "amount": 0.0, - "counterKey": {"type": "str", "attribute": "str"}, - "name": "str", - "unit": "str", - "match": { - "agentResourceIds": ["str"], - "identityObjectIds": ["str"], - "projectIds": ["str"], - "sessionIds": ["str"], - }, - "period": "str", - "recurring": bool, - "thresholds": [{"action": "str", "type": "str", "value": 0.0}], - } - ], - } - }, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cost_controls_delete(self, resource_group): - response = await self.client.cost_controls.delete( - resource_group_name=resource_group.name, - account_name="str", - cost_control_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_cost_controls_list(self, resource_group): - response = self.client.cost_controls.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_deployments_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_deployments_operations.py index 214b54f74997..1fb27389a17a 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_deployments_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_deployments_operations.py @@ -59,7 +59,6 @@ def test_deployments_begin_create_or_update(self, resource_group): "capabilities": {"str": "str"}, "capacitySettings": {"designatedCapacity": 0, "priority": 0}, "contextCacheContainerId": "str", - "costControlIds": ["str"], "currentCapacity": 0, "deploymentState": "str", "dynamicThrottlingEnabled": bool, @@ -127,31 +126,6 @@ def test_deployments_begin_create_or_update(self, resource_group): }, "scaleSettings": {"activeCapacity": 0, "capacity": 0, "scaleType": "str"}, "serviceTier": "str", - "speculativeDecoding": { - "draftModel": { - "callRateLimit": { - "count": 0.0, - "renewalPeriod": 0.0, - "rules": [ - { - "count": 0.0, - "dynamicThrottlingEnabled": bool, - "key": "str", - "matchPatterns": [{"method": "str", "path": "str"}], - "minCount": 0.0, - "renewalPeriod": 0.0, - } - ], - }, - "format": "str", - "name": "str", - "publisher": "str", - "source": "str", - "sourceAccount": "str", - "version": "str", - }, - "draftTokenCount": 0, - }, "spilloverDeploymentName": "str", "versionUpgradeOption": "str", }, diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_deployments_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_deployments_operations_async.py index e7e5a7c3a9c3..99fb10bf5746 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_deployments_operations_async.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_deployments_operations_async.py @@ -61,7 +61,6 @@ async def test_deployments_begin_create_or_update(self, resource_group): "capabilities": {"str": "str"}, "capacitySettings": {"designatedCapacity": 0, "priority": 0}, "contextCacheContainerId": "str", - "costControlIds": ["str"], "currentCapacity": 0, "deploymentState": "str", "dynamicThrottlingEnabled": bool, @@ -129,31 +128,6 @@ async def test_deployments_begin_create_or_update(self, resource_group): }, "scaleSettings": {"activeCapacity": 0, "capacity": 0, "scaleType": "str"}, "serviceTier": "str", - "speculativeDecoding": { - "draftModel": { - "callRateLimit": { - "count": 0.0, - "renewalPeriod": 0.0, - "rules": [ - { - "count": 0.0, - "dynamicThrottlingEnabled": bool, - "key": "str", - "matchPatterns": [{"method": "str", "path": "str"}], - "minCount": 0.0, - "renewalPeriod": 0.0, - } - ], - }, - "format": "str", - "name": "str", - "publisher": "str", - "source": "str", - "sourceAccount": "str", - "version": "str", - }, - "draftTokenCount": 0, - }, "spilloverDeploymentName": "str", "versionUpgradeOption": "str", }, diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_deployments_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_deployments_operations.py deleted file mode 100644 index 73cc828e6e3e..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_deployments_operations.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementManagedComputeDeploymentsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_compute_deployments_get(self, resource_group): - response = self.client.managed_compute_deployments.get( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_compute_deployments_begin_create_or_update(self, resource_group): - response = self.client.managed_compute_deployments.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - resource={ - "etag": "str", - "id": "str", - "name": "str", - "properties": { - "model": "str", - "acceleratorType": "str", - "acceleratorsPerInstance": 0, - "capabilities": {"str": "str"}, - "computeId": "str", - "deploymentTemplate": "str", - "gatedModelAccess": {"connectionId": "str"}, - "priority": "str", - "provisioningDetails": {"lastOperationTimestamp": "2020-02-20 00:00:00", "message": "str"}, - "provisioningState": "str", - "routes": {"chatCompletionsScoringPath": "str", "messagesApiScoringPath": "str", "swagger": "str"}, - "totalAccelerators": 0, - "versionUpgradeOption": "str", - }, - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_compute_deployments_begin_update(self, resource_group): - response = self.client.managed_compute_deployments.begin_update( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - properties={"sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}}, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_compute_deployments_begin_delete(self, resource_group): - response = self.client.managed_compute_deployments.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_compute_deployments_list(self, resource_group): - response = self.client.managed_compute_deployments.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_deployments_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_deployments_operations_async.py deleted file mode 100644 index 087f8b7e14f7..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_deployments_operations_async.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementManagedComputeDeploymentsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_compute_deployments_get(self, resource_group): - response = await self.client.managed_compute_deployments.get( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_compute_deployments_begin_create_or_update(self, resource_group): - response = await ( - await self.client.managed_compute_deployments.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - resource={ - "etag": "str", - "id": "str", - "name": "str", - "properties": { - "model": "str", - "acceleratorType": "str", - "acceleratorsPerInstance": 0, - "capabilities": {"str": "str"}, - "computeId": "str", - "deploymentTemplate": "str", - "gatedModelAccess": {"connectionId": "str"}, - "priority": "str", - "provisioningDetails": {"lastOperationTimestamp": "2020-02-20 00:00:00", "message": "str"}, - "provisioningState": "str", - "routes": { - "chatCompletionsScoringPath": "str", - "messagesApiScoringPath": "str", - "swagger": "str", - }, - "totalAccelerators": 0, - "versionUpgradeOption": "str", - }, - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_compute_deployments_begin_update(self, resource_group): - response = await ( - await self.client.managed_compute_deployments.begin_update( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - properties={"sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}}, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_compute_deployments_begin_delete(self, resource_group): - response = await ( - await self.client.managed_compute_deployments.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - deployment_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_compute_deployments_list(self, resource_group): - response = self.client.managed_compute_deployments.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_usages_operation_group_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_usages_operation_group_operations.py deleted file mode 100644 index a8dd6b2c3ae8..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_usages_operation_group_operations.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementManagedComputeUsagesOperationGroupOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_compute_usages_operation_group_list(self, resource_group): - response = self.client.managed_compute_usages_operation_group.list( - location="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_usages_operation_group_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_usages_operation_group_operations_async.py deleted file mode 100644 index 86cb34988f0e..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_managed_compute_usages_operation_group_operations_async.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementManagedComputeUsagesOperationGroupOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_compute_usages_operation_group_list(self, resource_group): - response = self.client.managed_compute_usages_operation_group.list( - location="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_projects_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_projects_operations.py index f5c4e30ae436..b016b7bff581 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_projects_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_projects_operations.py @@ -49,7 +49,6 @@ def test_projects_begin_create(self, resource_group): "location": "str", "name": "str", "properties": { - "capabilitySettings": {"blobStore": "str", "documentStore": "str", "vectorStore": "str"}, "description": "str", "displayName": "str", "endpoints": {"str": "str"}, @@ -91,7 +90,6 @@ def test_projects_begin_update(self, resource_group): "location": "str", "name": "str", "properties": { - "capabilitySettings": {"blobStore": "str", "documentStore": "str", "vectorStore": "str"}, "description": "str", "displayName": "str", "endpoints": {"str": "str"}, diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_projects_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_projects_operations_async.py index fd783ce6b511..34d2ebb6ac8b 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_projects_operations_async.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_projects_operations_async.py @@ -51,7 +51,6 @@ async def test_projects_begin_create(self, resource_group): "location": "str", "name": "str", "properties": { - "capabilitySettings": {"blobStore": "str", "documentStore": "str", "vectorStore": "str"}, "description": "str", "displayName": "str", "endpoints": {"str": "str"}, @@ -95,7 +94,6 @@ async def test_projects_begin_update(self, resource_group): "location": "str", "name": "str", "properties": { - "capabilitySettings": {"blobStore": "str", "documentStore": "str", "vectorStore": "str"}, "description": "str", "displayName": "str", "endpoints": {"str": "str"}, diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_bindings_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_bindings_operations.py deleted file mode 100644 index 9ed3fc959114..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_bindings_operations.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementRaiBindingsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_rai_bindings_get(self, resource_group): - response = self.client.rai_bindings.get( - resource_group_name=resource_group.name, - account_name="str", - rai_binding_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_rai_bindings_create_or_update(self, resource_group): - response = self.client.rai_bindings.create_or_update( - resource_group_name=resource_group.name, - account_name="str", - rai_binding_name="str", - rai_binding={ - "etag": "str", - "id": "str", - "name": "str", - "properties": {"boundResourceId": "str", "targetPolicyName": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_rai_bindings_delete(self, resource_group): - response = self.client.rai_bindings.delete( - resource_group_name=resource_group.name, - account_name="str", - rai_binding_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_rai_bindings_list(self, resource_group): - response = self.client.rai_bindings.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_bindings_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_bindings_operations_async.py deleted file mode 100644 index 64caed4b55d6..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_bindings_operations_async.py +++ /dev/null @@ -1,83 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementRaiBindingsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_rai_bindings_get(self, resource_group): - response = await self.client.rai_bindings.get( - resource_group_name=resource_group.name, - account_name="str", - rai_binding_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_rai_bindings_create_or_update(self, resource_group): - response = await self.client.rai_bindings.create_or_update( - resource_group_name=resource_group.name, - account_name="str", - rai_binding_name="str", - rai_binding={ - "etag": "str", - "id": "str", - "name": "str", - "properties": {"boundResourceId": "str", "targetPolicyName": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_rai_bindings_delete(self, resource_group): - response = await self.client.rai_bindings.delete( - resource_group_name=resource_group.name, - account_name="str", - rai_binding_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_rai_bindings_list(self, resource_group): - response = self.client.rai_bindings.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_policies_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_policies_operations.py index fd684a90575e..c166b0c2eeee 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_policies_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_policies_operations.py @@ -42,78 +42,6 @@ def test_rai_policies_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "acs": { - "agent_control_specification_version": "str", - "intervention_points": { - "input": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - }, - "output": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - }, - "post_tool_call": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - "tool_name_from": "str", - }, - "pre_tool_call": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - "tool_name_from": "str", - }, - }, - "policies": {"str": {"query": "str", "type": "str"}}, - "annotators": {}, - "metadata": {"str": {}}, - "tools": { - "str": { - "clearance": "str", - "description": "str", - "id": "str", - "security_labels": ["str"], - "type": "str", - } - }, - }, - "acsRegos": [{"regoName": "str"}], "basePolicyName": "str", "contentFilters": [ { @@ -126,14 +54,6 @@ def test_rai_policies_create_or_update(self, resource_group): } ], "customBlocklists": [{"blocking": bool, "blocklistName": "str", "source": "str"}], - "customExternalSafetyProviders": [ - { - "externalSafetyProviderName": "str", - "source": "str", - "blocking": bool, - "managedIdentityResourceId": "str", - } - ], "egressPolicy": { "defaultAction": "str", "description": "str", @@ -162,7 +82,6 @@ def test_rai_policies_create_or_update(self, resource_group): } ], }, - "format": "str", "mode": "str", "safetyProviders": [{"blocking": bool, "safetyProviderName": "str", "source": "str"}], "type": "str", diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_policies_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_policies_operations_async.py index 6e6505eae99d..f37645639de9 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_policies_operations_async.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_policies_operations_async.py @@ -43,78 +43,6 @@ async def test_rai_policies_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "acs": { - "agent_control_specification_version": "str", - "intervention_points": { - "input": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - }, - "output": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - }, - "post_tool_call": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - "tool_name_from": "str", - }, - "pre_tool_call": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - "tool_name_from": "str", - }, - }, - "policies": {"str": {"query": "str", "type": "str"}}, - "annotators": {}, - "metadata": {"str": {}}, - "tools": { - "str": { - "clearance": "str", - "description": "str", - "id": "str", - "security_labels": ["str"], - "type": "str", - } - }, - }, - "acsRegos": [{"regoName": "str"}], "basePolicyName": "str", "contentFilters": [ { @@ -127,14 +55,6 @@ async def test_rai_policies_create_or_update(self, resource_group): } ], "customBlocklists": [{"blocking": bool, "blocklistName": "str", "source": "str"}], - "customExternalSafetyProviders": [ - { - "externalSafetyProviderName": "str", - "source": "str", - "blocking": bool, - "managedIdentityResourceId": "str", - } - ], "egressPolicy": { "defaultAction": "str", "description": "str", @@ -163,7 +83,6 @@ async def test_rai_policies_create_or_update(self, resource_group): } ], }, - "format": "str", "mode": "str", "safetyProviders": [{"blocking": bool, "safetyProviderName": "str", "source": "str"}], "type": "str", diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_regos_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_regos_operations.py deleted file mode 100644 index 27cf1c7ee526..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_regos_operations.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementRaiRegosOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_rai_regos_get(self, resource_group): - response = self.client.rai_regos.get( - resource_group_name=resource_group.name, - account_name="str", - rai_rego_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_rai_regos_create_or_update(self, resource_group): - response = self.client.rai_regos.create_or_update( - resource_group_name=resource_group.name, - account_name="str", - rai_rego_name="str", - rai_rego={ - "etag": "str", - "id": "str", - "name": "str", - "properties": {"rego": "str", "encoding": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_rai_regos_delete(self, resource_group): - response = self.client.rai_regos.delete( - resource_group_name=resource_group.name, - account_name="str", - rai_rego_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_rai_regos_list(self, resource_group): - response = self.client.rai_regos.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_regos_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_regos_operations_async.py deleted file mode 100644 index 3747e9399402..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_rai_regos_operations_async.py +++ /dev/null @@ -1,83 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementRaiRegosOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_rai_regos_get(self, resource_group): - response = await self.client.rai_regos.get( - resource_group_name=resource_group.name, - account_name="str", - rai_rego_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_rai_regos_create_or_update(self, resource_group): - response = await self.client.rai_regos.create_or_update( - resource_group_name=resource_group.name, - account_name="str", - rai_rego_name="str", - rai_rego={ - "etag": "str", - "id": "str", - "name": "str", - "properties": {"rego": "str", "encoding": "str"}, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_rai_regos_delete(self, resource_group): - response = await self.client.rai_regos.delete( - resource_group_name=resource_group.name, - account_name="str", - rai_rego_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_rai_regos_list(self, resource_group): - response = self.client.rai_regos.list( - resource_group_name=resource_group.name, - account_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_subscription_rai_policy_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_subscription_rai_policy_operations.py index 20ff1d081cfc..874eb822f0bd 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_subscription_rai_policy_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_subscription_rai_policy_operations.py @@ -38,78 +38,6 @@ def test_subscription_rai_policy_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "acs": { - "agent_control_specification_version": "str", - "intervention_points": { - "input": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - }, - "output": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - }, - "post_tool_call": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - "tool_name_from": "str", - }, - "pre_tool_call": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - "tool_name_from": "str", - }, - }, - "policies": {"str": {"query": "str", "type": "str"}}, - "annotators": {}, - "metadata": {"str": {}}, - "tools": { - "str": { - "clearance": "str", - "description": "str", - "id": "str", - "security_labels": ["str"], - "type": "str", - } - }, - }, - "acsRegos": [{"regoName": "str"}], "basePolicyName": "str", "contentFilters": [ { @@ -122,14 +50,6 @@ def test_subscription_rai_policy_create_or_update(self, resource_group): } ], "customBlocklists": [{"blocking": bool, "blocklistName": "str", "source": "str"}], - "customExternalSafetyProviders": [ - { - "externalSafetyProviderName": "str", - "source": "str", - "blocking": bool, - "managedIdentityResourceId": "str", - } - ], "egressPolicy": { "defaultAction": "str", "description": "str", @@ -158,7 +78,6 @@ def test_subscription_rai_policy_create_or_update(self, resource_group): } ], }, - "format": "str", "mode": "str", "safetyProviders": [{"blocking": bool, "safetyProviderName": "str", "source": "str"}], "type": "str", diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_subscription_rai_policy_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_subscription_rai_policy_operations_async.py index 5404cee311ac..1bd61ca4853c 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_subscription_rai_policy_operations_async.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_subscription_rai_policy_operations_async.py @@ -39,78 +39,6 @@ async def test_subscription_rai_policy_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "acs": { - "agent_control_specification_version": "str", - "intervention_points": { - "input": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - }, - "output": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - }, - "post_tool_call": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - "tool_name_from": "str", - }, - "pre_tool_call": { - "policy": { - "id": "str", - "aacs_moderation": { - "harm_configs": [{"category": "str", "harm_config_id": "str"}], - "subject_format": "str", - }, - "query": "str", - }, - "policy_target": "str", - "policy_target_kind": "str", - "annotations": {}, - "tool_name_from": "str", - }, - }, - "policies": {"str": {"query": "str", "type": "str"}}, - "annotators": {}, - "metadata": {"str": {}}, - "tools": { - "str": { - "clearance": "str", - "description": "str", - "id": "str", - "security_labels": ["str"], - "type": "str", - } - }, - }, - "acsRegos": [{"regoName": "str"}], "basePolicyName": "str", "contentFilters": [ { @@ -123,14 +51,6 @@ async def test_subscription_rai_policy_create_or_update(self, resource_group): } ], "customBlocklists": [{"blocking": bool, "blocklistName": "str", "source": "str"}], - "customExternalSafetyProviders": [ - { - "externalSafetyProviderName": "str", - "source": "str", - "blocking": bool, - "managedIdentityResourceId": "str", - } - ], "egressPolicy": { "defaultAction": "str", "description": "str", @@ -159,7 +79,6 @@ async def test_subscription_rai_policy_create_or_update(self, resource_group): } ], }, - "format": "str", "mode": "str", "safetyProviders": [{"blocking": bool, "safetyProviderName": "str", "source": "str"}], "type": "str", diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_workbenches_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_workbenches_operations.py deleted file mode 100644 index 7c1f8b177d7b..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_workbenches_operations.py +++ /dev/null @@ -1,179 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementWorkbenchesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workbenches_get(self, resource_group): - response = self.client.workbenches.get( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workbenches_begin_create_or_update(self, resource_group): - response = self.client.workbenches.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - resource={ - "properties": { - "imageLink": "str", - "targetClusterId": "str", - "connectivityEndpoints": {"publicIpAddress": "str", "sshPort": 0}, - "creationTime": "2020-02-20 00:00:00", - "datasetId": "str", - "errors": [ - { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - } - ], - "gpuCount": 0, - "idleTimeBeforeShutdown": "str", - "instanceType": "str", - "provisioningState": "str", - "sshSettings": {"adminEnabled": bool, "sshPublicKey": "str"}, - "status": "str", - "webEndpoint": "str", - }, - "etag": "str", - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workbenches_update(self, resource_group): - response = self.client.workbenches.update( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - properties={ - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "properties": { - "gpuCount": 0, - "idleTimeBeforeShutdown": "str", - "instanceType": "str", - "targetClusterId": "str", - }, - }, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workbenches_begin_delete(self, resource_group): - response = self.client.workbenches.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workbenches_list(self, resource_group): - response = self.client.workbenches.list( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workbenches_begin_start(self, resource_group): - response = self.client.workbenches.begin_start( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workbenches_begin_stop(self, resource_group): - response = self.client.workbenches.begin_stop( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workbenches_begin_restart(self, resource_group): - response = self.client.workbenches.begin_restart( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_workbenches_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_workbenches_operations_async.py deleted file mode 100644 index 069c2d52a75c..000000000000 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/generated_tests/test_cognitive_services_management_workbenches_operations_async.py +++ /dev/null @@ -1,190 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestCognitiveServicesManagementWorkbenchesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(CognitiveServicesManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workbenches_get(self, resource_group): - response = await self.client.workbenches.get( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workbenches_begin_create_or_update(self, resource_group): - response = await ( - await self.client.workbenches.begin_create_or_update( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - resource={ - "properties": { - "imageLink": "str", - "targetClusterId": "str", - "connectivityEndpoints": {"publicIpAddress": "str", "sshPort": 0}, - "creationTime": "2020-02-20 00:00:00", - "datasetId": "str", - "errors": [ - { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - } - ], - "gpuCount": 0, - "idleTimeBeforeShutdown": "str", - "instanceType": "str", - "provisioningState": "str", - "sshSettings": {"adminEnabled": bool, "sshPublicKey": "str"}, - "status": "str", - "webEndpoint": "str", - }, - "etag": "str", - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "name": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workbenches_update(self, resource_group): - response = await self.client.workbenches.update( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - properties={ - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "properties": { - "gpuCount": 0, - "idleTimeBeforeShutdown": "str", - "instanceType": "str", - "targetClusterId": "str", - }, - }, - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workbenches_begin_delete(self, resource_group): - response = await ( - await self.client.workbenches.begin_delete( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workbenches_list(self, resource_group): - response = self.client.workbenches.list( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workbenches_begin_start(self, resource_group): - response = await ( - await self.client.workbenches.begin_start( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workbenches_begin_stop(self, resource_group): - response = await ( - await self.client.workbenches.begin_stop( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workbenches_begin_restart(self, resource_group): - response = await ( - await self.client.workbenches.begin_restart( - resource_group_name=resource_group.name, - account_name="str", - project_name="str", - workbench_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/pyproject.toml b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/pyproject.toml index 056b910a0d72..b6b64a4fa374 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/pyproject.toml +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/pyproject.toml @@ -13,7 +13,7 @@ authors = [ description = "Microsoft Azure Cognitiveservices Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", ] requires-python = ">=3.10" keywords = [ @@ -77,7 +78,7 @@ package_name = "azure-mgmt-cognitiveservices" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Cognitive Services Management" package_doc_id = "cognitive-services" -is_stable = false +is_stable = true is_arm = true sample_link = "" title = "CognitiveServicesManagementClient" diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_live.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_live.py index 2d800db05679..8b017e1e6e48 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_live.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_live.py @@ -99,9 +99,7 @@ def test_cost_control_lifecycle(self): models.CostControlPatch( properties=models.CostControlPatchProperties( display_name="SDK live test updated", - rules=[ - _cost_control_rule(amount=50, threshold_action=models.CostControlThresholdAction.BLOCK) - ], + rules=[_cost_control_rule(amount=50, threshold_action=models.CostControlThresholdAction.BLOCK)], ) ), etag=etag, @@ -143,6 +141,7 @@ def test_cost_control_lifecycle(self): except ResourceNotFoundError: pass + def _cost_control_rule(amount, threshold_action): return models.CostControlRule( name="account-budget", diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations.py index aa7cc3c45e87..3d1cfc2b39d7 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations.py @@ -14,7 +14,6 @@ from azure.core.credentials import AccessToken from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient, models - SUBSCRIPTION_ID = "00000000-0000-0000-0000-000000000000" RESOURCE_ID = ( f"/subscriptions/{SUBSCRIPTION_ID}/resourceGroups/rg/providers/" diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations_async.py b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations_async.py index 7d3c767082bd..bf2859e6eb37 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations_async.py +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tests/test_cost_controls_operations_async.py @@ -17,7 +17,6 @@ from azure.mgmt.cognitiveservices import models from azure.mgmt.cognitiveservices.aio import CognitiveServicesManagementClient - SUBSCRIPTION_ID = "00000000-0000-0000-0000-000000000000" RESOURCE_ID = ( f"/subscriptions/{SUBSCRIPTION_ID}/resourceGroups/rg/providers/" diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tsp-location.yaml b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tsp-location.yaml index 8f1f11c5ae85..efda97d299e5 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tsp-location.yaml +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/CognitiveServices -commit: 8554bdf73142233b9584500c9661522d67380638 +commit: bb09e375334d3e064aa5bc06d83a0568ffca0b4c repo: Azure/azure-rest-api-specs additionalDirectories: From 7a1babb8049d58f7e2a35cb20b5e71b47de0f905 Mon Sep 17 00:00:00 2001 From: "Chenxi Jiang (WICRESOFT NORTH AMERICA LTD)" Date: Thu, 12 Nov 2026 11:13:49 +0800 Subject: [PATCH 2/3] Optimize changelog for azure-mgmt-cognitiveservices Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-mgmt-cognitiveservices/CHANGELOG.md | 88 +++++-------------- 1 file changed, 24 insertions(+), 64 deletions(-) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md index c4124715cf75..a79e6a900a70 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md @@ -23,7 +23,6 @@ - Model `AccountProperties` added property `a365_logging_enabled` - Model `AccountProperties` added property `trusted_certificate_sources` - Model `CapabilityHostProperties` added property `enable_public_hosting_environment` - - Model `CommitmentPlanAccountAssociation` added property `properties` - Enum `ConnectionAuthType` added member `ACCOUNT_MANAGED_IDENTITY` - Enum `ConnectionAuthType` added member `AGENTIC_IDENTITY_TOKEN` - Enum `ConnectionAuthType` added member `AGENTIC_USER` @@ -45,7 +44,6 @@ - Enum `ConnectionCategory` added member `REMOTE_A2_A` - Enum `ConnectionCategory` added member `REMOTE_TOOL` - Enum `ConnectionCategory` added member `SHAREPOINT` - - Model `DefenderForAISetting` added property `properties` - Model `DeploymentProperties` added property `context_cache_container_id` - Model `DeploymentProperties` added property `deployment_state` - Model `DeploymentProperties` added property `routing` @@ -59,7 +57,6 @@ - Enum `RaiPolicyContentSource` added member `PRE_TOOL_CALL` - Model `RaiPolicyProperties` added property `egress_policy` - Model `RaiPolicyProperties` added property `safety_providers` - - Model `ResourceSkuRestrictions` added property `values_property` - Model `Usage` added property `id` - Model `Usage` added property `scope_id` - Model `Usage` added property `scope_type` @@ -83,8 +80,6 @@ - Added enum `BuiltInAuthorizationScheme` - Added model `CertificateBundleReference` - Added model `ChannelsBuiltInAuthorizationPolicy` - - Added model `CommitmentPlanAccountAssociationProperties` - - Added model `DefenderForAISettingProperties` - Added model `DeploymentRouting` - Added model `DeploymentSizeCapacity` - Added enum `DeploymentState` @@ -154,12 +149,12 @@ - Added model `TrustedCertificateSource` - Added enum `TrustedCertificateSourceType` - Added model `VersionedAgentReference` - - Model `AccountCapabilityHostsOperations` added method `list` - - Model `AccountsOperations` added parameter `content_type` in method `regenerate_key` - - Model `DeploymentsOperations` added method `pause` - - Model `DeploymentsOperations` added method `resume` - - Model `ProjectCapabilityHostsOperations` added method `list` - - Model `RaiBlocklistItemsOperations` added parameter `content_type` in method `batch_delete` + - Operation group `AccountCapabilityHostsOperations` added method `list` + - Operation group `AccountsOperations` added parameter `content_type` in method `regenerate_key` + - Operation group `DeploymentsOperations` added method `pause` + - Operation group `DeploymentsOperations` added method `resume` + - Operation group `ProjectCapabilityHostsOperations` added method `list` + - Operation group `RaiBlocklistItemsOperations` added parameter `content_type` in method `batch_delete` - Added operation group `AgentApplicationsOperations` - Added operation group `AgentDeploymentsOperations` - Added operation group `ManagedComputeCapacitiesOperations` @@ -175,70 +170,35 @@ ### Breaking Changes - - Method `CognitiveServicesManagementClient.calculate_model_capacity` inserted a `positional_or_keyword` parameter `parameters` - - Method `CognitiveServicesManagementClient.calculate_model_capacity` deleted or renamed its parameter `model` of kind `positional_or_keyword` - - Method `CognitiveServicesManagementClient.calculate_model_capacity` deleted or renamed its parameter `sku_name` of kind `positional_or_keyword` - - Method `CognitiveServicesManagementClient.calculate_model_capacity` deleted or renamed its parameter `workloads` of kind `positional_or_keyword` - - Method `CognitiveServicesManagementClient.check_domain_availability` inserted a `positional_or_keyword` parameter `parameters` - - Method `CognitiveServicesManagementClient.check_domain_availability` deleted or renamed its parameter `kind` of kind `positional_or_keyword` - - Method `CognitiveServicesManagementClient.check_domain_availability` deleted or renamed its parameter `subdomain_name` of kind `positional_or_keyword` - - Method `CognitiveServicesManagementClient.check_domain_availability` deleted or renamed its parameter `type` of kind `positional_or_keyword` - - Method `CognitiveServicesManagementClient.check_sku_availability` inserted a `positional_or_keyword` parameter `parameters` - - Method `CognitiveServicesManagementClient.check_sku_availability` deleted or renamed its parameter `kind` of kind `positional_or_keyword` - - Method `CognitiveServicesManagementClient.check_sku_availability` deleted or renamed its parameter `skus` of kind `positional_or_keyword` - - Method `CognitiveServicesManagementClient.check_sku_availability` deleted or renamed its parameter `type` of kind `positional_or_keyword` - - Model `CommitmentPlanAccountAssociation` deleted or renamed its instance variable `account_id` - - Model `CustomKeys` deleted or renamed its instance variable `keys` - - Model `DefenderForAISetting` deleted or renamed its instance variable `state` + - This version introduces new hybrid models which have dual dictionary and model nature. Please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration. + - For the method breakings, please refer to https://aka.ms/azsdk/python/migrate/operations for migration. + - Method `CognitiveServicesManagementClient.calculate_model_capacity` renamed its parameters `model`/`sku_name`/`workloads` to `parameters` + - Method `CognitiveServicesManagementClient.check_domain_availability` renamed its parameters `kind`/`subdomain_name`/`type` to `parameters` + - Method `CognitiveServicesManagementClient.check_sku_availability` renamed its parameters `kind`/`skus`/`type` to `parameters` + - Model `CommitmentPlanAccountAssociation` moved instance variable `account_id` under property `properties` whose type is `CommitmentPlanAccountAssociationProperties` + - Model `CustomKeys` renamed its instance variable `keys` to `keys_property` + - Model `DefenderForAISetting` moved instance variable `state` under property `properties` whose type is `DefenderForAISettingProperties` - Model `RaiPolicyProperties` deleted or renamed its instance variable `custom_topics` - - Model `ResourceSkuRestrictions` deleted or renamed its instance variable `values` - - Deleted or renamed model `AccountListResult` - - Deleted or renamed model `AccountModelListResult` + - Model `ResourceSkuRestrictions` renamed its instance variable `values` to `values_property` - Deleted or renamed model `AzureEntityResource` - - Deleted or renamed model `CommitmentPlanAccountAssociationListResult` - - Deleted or renamed model `CommitmentPlanListResult` - - Deleted or renamed model `CommitmentTierListResult` - - Deleted or renamed model `ConnectionPropertiesV2BasicResourceArmPaginatedResult` - Deleted or renamed model `CustomTopicConfig` - - Deleted or renamed model `DefenderForAISettingResult` - - Deleted or renamed model `DeploymentListResult` - - Deleted or renamed model `DeploymentSkuListResult` - - Deleted or renamed model `EncryptionScopeListResult` - Deleted or renamed model `ErrorDetailAutoGenerated` - Deleted or renamed model `ErrorResponseAutoGenerated` - - Deleted or renamed model `ModelCapacityListResult` - - Deleted or renamed model `ModelListResult` - - Deleted or renamed model `NetworkSecurityPerimeterConfigurationList` - - Deleted or renamed model `OperationListResult` - - Deleted or renamed model `ProjectListResult` - - Deleted or renamed model `QuotaTierListResult` - - Deleted or renamed model `RaiBlockListItemsResult` - - Deleted or renamed model `RaiBlockListResult` - - Deleted or renamed model `RaiContentFilterListResult` - - Deleted or renamed model `RaiPolicyListResult` - Deleted or renamed model `RaiTopicConfig` - - Deleted or renamed model `RaiTopicResult` - - Deleted or renamed model `ResourceSkuListResult` - - Method `AccountConnectionsOperations.list` changed its parameter `category` from `positional_or_keyword` to `keyword_only` - - Method `AccountConnectionsOperations.list` changed its parameter `include_all` from `positional_or_keyword` to `keyword_only` - - Method `AccountConnectionsOperations.list` changed its parameter `target` from `positional_or_keyword` to `keyword_only` - - Method `AccountsOperations.regenerate_key` inserted a `positional_or_keyword` parameter `parameters` - - Method `AccountsOperations.regenerate_key` deleted or renamed its parameter `key_name` of kind `positional_or_keyword` - - Method `LocationBasedModelCapacitiesOperations.list` changed its parameter `model_format` from `positional_or_keyword` to `keyword_only` - - Method `LocationBasedModelCapacitiesOperations.list` changed its parameter `model_name` from `positional_or_keyword` to `keyword_only` - - Method `LocationBasedModelCapacitiesOperations.list` changed its parameter `model_version` from `positional_or_keyword` to `keyword_only` - - Method `ModelCapacitiesOperations.list` changed its parameter `model_format` from `positional_or_keyword` to `keyword_only` - - Method `ModelCapacitiesOperations.list` changed its parameter `model_name` from `positional_or_keyword` to `keyword_only` - - Method `ModelCapacitiesOperations.list` changed its parameter `model_version` from `positional_or_keyword` to `keyword_only` + - Method `AccountsOperations.regenerate_key` renamed its parameter `key_name` to `parameters` + - Method `AccountConnectionsOperations.list` changed its parameters `category`/`include_all`/`target` from `positional_or_keyword` to `keyword_only` + - Method `LocationBasedModelCapacitiesOperations.list` changed its parameters `model_format`/`model_name`/`model_version` from `positional_or_keyword` to `keyword_only` + - Method `ModelCapacitiesOperations.list` changed its parameters `model_format`/`model_name`/`model_version` from `positional_or_keyword` to `keyword_only` + - Method `ProjectConnectionsOperations.list` changed its parameters `category`/`include_all`/`target` from `positional_or_keyword` to `keyword_only` - Method `ProjectCapabilityHostsOperations.begin_create_or_update` changed type of its parameter `capability_host` from `CapabilityHost` to `ProjectCapabilityHost` - - Method `ProjectConnectionsOperations.list` changed its parameter `category` from `positional_or_keyword` to `keyword_only` - - Method `ProjectConnectionsOperations.list` changed its parameter `include_all` from `positional_or_keyword` to `keyword_only` - - Method `ProjectConnectionsOperations.list` changed its parameter `target` from `positional_or_keyword` to `keyword_only` - Method `RaiBlocklistItemsOperations.batch_delete` changed type of its parameter `rai_blocklist_items_names` from `JSON` to `List[str]` - - Method `ProjectCapabilityHostsOperations.begin_create_or_update` changed return type from `AsyncLROPoller[CapabilityHost]` to `AsyncLROPoller[ProjectCapabilityHost]` - Method `ProjectCapabilityHostsOperations.begin_create_or_update` changed return type from `LROPoller[CapabilityHost]` to `LROPoller[ProjectCapabilityHost]` - Method `ProjectCapabilityHostsOperations.get` changed return type from `CapabilityHost` to `ProjectCapabilityHost` +### Other Changes + + - Deleted model `AccountListResult`/`AccountModelListResult`/`CommitmentPlanAccountAssociationListResult`/`CommitmentPlanListResult`/`CommitmentTierListResult`/`ConnectionPropertiesV2BasicResourceArmPaginatedResult`/`DefenderForAISettingResult`/`DeploymentListResult`/`DeploymentSkuListResult`/`EncryptionScopeListResult`/`ModelCapacityListResult`/`ModelListResult`/`NetworkSecurityPerimeterConfigurationList`/`OperationListResult`/`ProjectListResult`/`QuotaTierListResult`/`RaiBlockListItemsResult`/`RaiBlockListResult`/`RaiContentFilterListResult`/`RaiPolicyListResult`/`RaiTopicResult`/`ResourceSkuListResult` which actually were not used by SDK users + ## 15.0.0b6 (2026-10-10) ### Features Added From 2f8daa0c6a8b3678980fc584ee830f339face9c4 Mon Sep 17 00:00:00 2001 From: Chenxi Jiang <119990644+ChenxiJiang333@users.noreply.github.com> Date: Thu, 12 Nov 2026 11:24:56 +0800 Subject: [PATCH 3/3] Update CHANGELOG.md --- .../azure-mgmt-cognitiveservices/CHANGELOG.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md index a79e6a900a70..5d76eae6af10 100644 --- a/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/azure-mgmt-cognitiveservices/CHANGELOG.md @@ -172,20 +172,17 @@ - This version introduces new hybrid models which have dual dictionary and model nature. Please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration. - For the method breakings, please refer to https://aka.ms/azsdk/python/migrate/operations for migration. - - Method `CognitiveServicesManagementClient.calculate_model_capacity` renamed its parameters `model`/`sku_name`/`workloads` to `parameters` - - Method `CognitiveServicesManagementClient.check_domain_availability` renamed its parameters `kind`/`subdomain_name`/`type` to `parameters` - - Method `CognitiveServicesManagementClient.check_sku_availability` renamed its parameters `kind`/`skus`/`type` to `parameters` + - Method `CognitiveServicesManagementClient.calculate_model_capacity` grouped `model`/`sku_name`/`workloads` into new signature `parameters` + - Method `CognitiveServicesManagementClient.check_domain_availability` grouped `subdomain_name`/`type`/`kind` into new signature `parameters` + - Method `CognitiveServicesManagementClient.check_sku_availability` grouped `skus`/`kind`/`type` into new signature `parameters` + - Method `AccountsOperations.regenerate_key` grouped `key_name` into new signature `parameters` - Model `CommitmentPlanAccountAssociation` moved instance variable `account_id` under property `properties` whose type is `CommitmentPlanAccountAssociationProperties` - Model `CustomKeys` renamed its instance variable `keys` to `keys_property` + - Model `ResourceSkuRestrictions` renamed its instance variable `values` to `values_property` - Model `DefenderForAISetting` moved instance variable `state` under property `properties` whose type is `DefenderForAISettingProperties` - Model `RaiPolicyProperties` deleted or renamed its instance variable `custom_topics` - - Model `ResourceSkuRestrictions` renamed its instance variable `values` to `values_property` - - Deleted or renamed model `AzureEntityResource` - Deleted or renamed model `CustomTopicConfig` - - Deleted or renamed model `ErrorDetailAutoGenerated` - - Deleted or renamed model `ErrorResponseAutoGenerated` - Deleted or renamed model `RaiTopicConfig` - - Method `AccountsOperations.regenerate_key` renamed its parameter `key_name` to `parameters` - Method `AccountConnectionsOperations.list` changed its parameters `category`/`include_all`/`target` from `positional_or_keyword` to `keyword_only` - Method `LocationBasedModelCapacitiesOperations.list` changed its parameters `model_format`/`model_name`/`model_version` from `positional_or_keyword` to `keyword_only` - Method `ModelCapacitiesOperations.list` changed its parameters `model_format`/`model_name`/`model_version` from `positional_or_keyword` to `keyword_only` @@ -197,6 +194,7 @@ ### Other Changes + - Deleted model `AzureEntityResource`/`ErrorDetailAutoGenerated`/`ErrorResponseAutoGenerated` which actually were not used by SDK users - Deleted model `AccountListResult`/`AccountModelListResult`/`CommitmentPlanAccountAssociationListResult`/`CommitmentPlanListResult`/`CommitmentTierListResult`/`ConnectionPropertiesV2BasicResourceArmPaginatedResult`/`DefenderForAISettingResult`/`DeploymentListResult`/`DeploymentSkuListResult`/`EncryptionScopeListResult`/`ModelCapacityListResult`/`ModelListResult`/`NetworkSecurityPerimeterConfigurationList`/`OperationListResult`/`ProjectListResult`/`QuotaTierListResult`/`RaiBlockListItemsResult`/`RaiBlockListResult`/`RaiContentFilterListResult`/`RaiPolicyListResult`/`RaiTopicResult`/`ResourceSkuListResult` which actually were not used by SDK users ## 15.0.0b6 (2026-10-10)