diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json index 071ce382b183..50f972aaf2bc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json +++ b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json @@ -1,11 +1,11 @@ { - "commit": "e5404d3e55f885d2cb8fdbff3fd1a03bcfc6bb4c", + "commit": "76c42da5d630484ecab8a0f3464b17bf4be16457", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.7", "use": [ "@autorest/python@6.13.7", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", + "autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", "readme": "specification/app/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py index 5f29dcf6e118..6b5bc3fc5696 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py @@ -26,15 +26,15 @@ class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance- :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-11-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-03-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2023-11-02-preview") + api_version: str = kwargs.pop("api_version", "2024-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py index 36b82db88f46..a15e7fe7a4c1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py @@ -18,13 +18,8 @@ from ._configuration import ContainerAppsAPIClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( - AppResiliencyOperations, AvailableWorkloadProfilesOperations, BillingMetersOperations, - BuildAuthTokenOperations, - BuildersOperations, - BuildsByBuilderResourceOperations, - BuildsOperations, CertificatesOperations, ConnectedEnvironmentsCertificatesOperations, ConnectedEnvironmentsDaprComponentsOperations, @@ -37,11 +32,7 @@ ContainerAppsRevisionReplicasOperations, ContainerAppsRevisionsOperations, ContainerAppsSourceControlsOperations, - DaprComponentResiliencyPoliciesOperations, DaprComponentsOperations, - DaprSubscriptionsOperations, - DotNetComponentsOperations, - JavaComponentsOperations, JobsExecutionsOperations, JobsOperations, ManagedCertificatesOperations, @@ -65,8 +56,6 @@ class ContainerAppsAPIClient( ): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """ContainerAppsAPIClient. - :ivar app_resiliency: AppResiliencyOperations operations - :vartype app_resiliency: azure.mgmt.appcontainers.operations.AppResiliencyOperations :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations :vartype container_apps_auth_configs: azure.mgmt.appcontainers.operations.ContainerAppsAuthConfigsOperations @@ -75,15 +64,6 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.operations.AvailableWorkloadProfilesOperations :ivar billing_meters: BillingMetersOperations operations :vartype billing_meters: azure.mgmt.appcontainers.operations.BillingMetersOperations - :ivar builders: BuildersOperations operations - :vartype builders: azure.mgmt.appcontainers.operations.BuildersOperations - :ivar builds_by_builder_resource: BuildsByBuilderResourceOperations operations - :vartype builds_by_builder_resource: - azure.mgmt.appcontainers.operations.BuildsByBuilderResourceOperations - :ivar builds: BuildsOperations operations - :vartype builds: azure.mgmt.appcontainers.operations.BuildsOperations - :ivar build_auth_token: BuildAuthTokenOperations operations - :vartype build_auth_token: azure.mgmt.appcontainers.operations.BuildAuthTokenOperations :ivar connected_environments: ConnectedEnvironmentsOperations operations :vartype connected_environments: azure.mgmt.appcontainers.operations.ConnectedEnvironmentsOperations @@ -131,13 +111,8 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.operations.ManagedCertificatesOperations :ivar namespaces: NamespacesOperations operations :vartype namespaces: azure.mgmt.appcontainers.operations.NamespacesOperations - :ivar dapr_component_resiliency_policies: DaprComponentResiliencyPoliciesOperations operations - :vartype dapr_component_resiliency_policies: - azure.mgmt.appcontainers.operations.DaprComponentResiliencyPoliciesOperations :ivar dapr_components: DaprComponentsOperations operations :vartype dapr_components: azure.mgmt.appcontainers.operations.DaprComponentsOperations - :ivar dapr_subscriptions: DaprSubscriptionsOperations operations - :vartype dapr_subscriptions: azure.mgmt.appcontainers.operations.DaprSubscriptionsOperations :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations :vartype managed_environments_storages: azure.mgmt.appcontainers.operations.ManagedEnvironmentsStoragesOperations @@ -149,18 +124,14 @@ class ContainerAppsAPIClient( :ivar managed_environment_usages: ManagedEnvironmentUsagesOperations operations :vartype managed_environment_usages: azure.mgmt.appcontainers.operations.ManagedEnvironmentUsagesOperations - :ivar java_components: JavaComponentsOperations operations - :vartype java_components: azure.mgmt.appcontainers.operations.JavaComponentsOperations - :ivar dot_net_components: DotNetComponentsOperations operations - :vartype dot_net_components: azure.mgmt.appcontainers.operations.DotNetComponentsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-11-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-03-01". 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. @@ -200,7 +171,6 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.app_resiliency = AppResiliencyOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -208,12 +178,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.billing_meters = BillingMetersOperations(self._client, self._config, self._serialize, self._deserialize) - self.builders = BuildersOperations(self._client, self._config, self._serialize, self._deserialize) - self.builds_by_builder_resource = BuildsByBuilderResourceOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.builds = BuildsOperations(self._client, self._config, self._serialize, self._deserialize) - self.build_auth_token = BuildAuthTokenOperations(self._client, self._config, self._serialize, self._deserialize) self.connected_environments = ConnectedEnvironmentsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -253,13 +217,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.dapr_component_resiliency_policies = DaprComponentResiliencyPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.dapr_subscriptions = DaprSubscriptionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.managed_environments_storages = ManagedEnvironmentsStoragesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -270,10 +228,6 @@ def __init__( self.managed_environment_usages = ManagedEnvironmentUsagesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.java_components = JavaComponentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.dot_net_components = DotNetComponentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py index 48b05f9c489c..e5754a47ce68 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py index 079bed7fb5be..4b656c0dc270 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py @@ -26,15 +26,15 @@ class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance- :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-11-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-03-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2023-11-02-preview") + api_version: str = kwargs.pop("api_version", "2024-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py index 33a91fe8d5ac..bca4e7dabc13 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py @@ -18,13 +18,8 @@ from .._serialization import Deserializer, Serializer from ._configuration import ContainerAppsAPIClientConfiguration from .operations import ( - AppResiliencyOperations, AvailableWorkloadProfilesOperations, BillingMetersOperations, - BuildAuthTokenOperations, - BuildersOperations, - BuildsByBuilderResourceOperations, - BuildsOperations, CertificatesOperations, ConnectedEnvironmentsCertificatesOperations, ConnectedEnvironmentsDaprComponentsOperations, @@ -37,11 +32,7 @@ ContainerAppsRevisionReplicasOperations, ContainerAppsRevisionsOperations, ContainerAppsSourceControlsOperations, - DaprComponentResiliencyPoliciesOperations, DaprComponentsOperations, - DaprSubscriptionsOperations, - DotNetComponentsOperations, - JavaComponentsOperations, JobsExecutionsOperations, JobsOperations, ManagedCertificatesOperations, @@ -65,8 +56,6 @@ class ContainerAppsAPIClient( ): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """ContainerAppsAPIClient. - :ivar app_resiliency: AppResiliencyOperations operations - :vartype app_resiliency: azure.mgmt.appcontainers.aio.operations.AppResiliencyOperations :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations :vartype container_apps_auth_configs: azure.mgmt.appcontainers.aio.operations.ContainerAppsAuthConfigsOperations @@ -75,15 +64,6 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.aio.operations.AvailableWorkloadProfilesOperations :ivar billing_meters: BillingMetersOperations operations :vartype billing_meters: azure.mgmt.appcontainers.aio.operations.BillingMetersOperations - :ivar builders: BuildersOperations operations - :vartype builders: azure.mgmt.appcontainers.aio.operations.BuildersOperations - :ivar builds_by_builder_resource: BuildsByBuilderResourceOperations operations - :vartype builds_by_builder_resource: - azure.mgmt.appcontainers.aio.operations.BuildsByBuilderResourceOperations - :ivar builds: BuildsOperations operations - :vartype builds: azure.mgmt.appcontainers.aio.operations.BuildsOperations - :ivar build_auth_token: BuildAuthTokenOperations operations - :vartype build_auth_token: azure.mgmt.appcontainers.aio.operations.BuildAuthTokenOperations :ivar connected_environments: ConnectedEnvironmentsOperations operations :vartype connected_environments: azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsOperations @@ -131,14 +111,8 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.aio.operations.ManagedCertificatesOperations :ivar namespaces: NamespacesOperations operations :vartype namespaces: azure.mgmt.appcontainers.aio.operations.NamespacesOperations - :ivar dapr_component_resiliency_policies: DaprComponentResiliencyPoliciesOperations operations - :vartype dapr_component_resiliency_policies: - azure.mgmt.appcontainers.aio.operations.DaprComponentResiliencyPoliciesOperations :ivar dapr_components: DaprComponentsOperations operations :vartype dapr_components: azure.mgmt.appcontainers.aio.operations.DaprComponentsOperations - :ivar dapr_subscriptions: DaprSubscriptionsOperations operations - :vartype dapr_subscriptions: - azure.mgmt.appcontainers.aio.operations.DaprSubscriptionsOperations :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations :vartype managed_environments_storages: azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsStoragesOperations @@ -150,18 +124,14 @@ class ContainerAppsAPIClient( :ivar managed_environment_usages: ManagedEnvironmentUsagesOperations operations :vartype managed_environment_usages: azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentUsagesOperations - :ivar java_components: JavaComponentsOperations operations - :vartype java_components: azure.mgmt.appcontainers.aio.operations.JavaComponentsOperations - :ivar dot_net_components: DotNetComponentsOperations operations - :vartype dot_net_components: azure.mgmt.appcontainers.aio.operations.DotNetComponentsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-11-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-03-01". 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. @@ -201,7 +171,6 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.app_resiliency = AppResiliencyOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -209,12 +178,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.billing_meters = BillingMetersOperations(self._client, self._config, self._serialize, self._deserialize) - self.builders = BuildersOperations(self._client, self._config, self._serialize, self._deserialize) - self.builds_by_builder_resource = BuildsByBuilderResourceOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.builds = BuildsOperations(self._client, self._config, self._serialize, self._deserialize) - self.build_auth_token = BuildAuthTokenOperations(self._client, self._config, self._serialize, self._deserialize) self.connected_environments = ConnectedEnvironmentsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -254,13 +217,7 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.dapr_component_resiliency_policies = DaprComponentResiliencyPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.dapr_subscriptions = DaprSubscriptionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.managed_environments_storages = ManagedEnvironmentsStoragesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -271,10 +228,6 @@ def __init__( self.managed_environment_usages = ManagedEnvironmentUsagesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.java_components = JavaComponentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.dot_net_components = DotNetComponentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py index 27819202ef8e..1d1af7c18205 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py @@ -6,14 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._app_resiliency_operations import AppResiliencyOperations from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations from ._billing_meters_operations import BillingMetersOperations -from ._builders_operations import BuildersOperations -from ._builds_by_builder_resource_operations import BuildsByBuilderResourceOperations -from ._builds_operations import BuildsOperations -from ._build_auth_token_operations import BuildAuthTokenOperations from ._connected_environments_operations import ConnectedEnvironmentsOperations from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations @@ -32,29 +27,20 @@ from ._certificates_operations import CertificatesOperations from ._managed_certificates_operations import ManagedCertificatesOperations from ._namespaces_operations import NamespacesOperations -from ._dapr_component_resiliency_policies_operations import DaprComponentResiliencyPoliciesOperations from ._dapr_components_operations import DaprComponentsOperations -from ._dapr_subscriptions_operations import DaprSubscriptionsOperations from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations from ._usages_operations import UsagesOperations from ._managed_environment_usages_operations import ManagedEnvironmentUsagesOperations -from ._java_components_operations import JavaComponentsOperations -from ._dot_net_components_operations import DotNetComponentsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ - "AppResiliencyOperations", "ContainerAppsAuthConfigsOperations", "AvailableWorkloadProfilesOperations", "BillingMetersOperations", - "BuildersOperations", - "BuildsByBuilderResourceOperations", - "BuildsOperations", - "BuildAuthTokenOperations", "ConnectedEnvironmentsOperations", "ConnectedEnvironmentsCertificatesOperations", "ConnectedEnvironmentsDaprComponentsOperations", @@ -73,15 +59,11 @@ "CertificatesOperations", "ManagedCertificatesOperations", "NamespacesOperations", - "DaprComponentResiliencyPoliciesOperations", "DaprComponentsOperations", - "DaprSubscriptionsOperations", "ManagedEnvironmentsStoragesOperations", "ContainerAppsSourceControlsOperations", "UsagesOperations", "ManagedEnvironmentUsagesOperations", - "JavaComponentsOperations", - "DotNetComponentsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_app_resiliency_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_app_resiliency_operations.py deleted file mode 100644 index 6e7c5b2e63bd..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_app_resiliency_operations.py +++ /dev/null @@ -1,570 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._app_resiliency_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_update_request, -) -from .._vendor import ContainerAppsAPIClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AppResiliencyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`app_resiliency` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: _models.AppResiliency, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Required. - :type resiliency_envelope: 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: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: Union[_models.AppResiliency, IO[bytes]], - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Is either a - AppResiliency type or a IO[bytes] type. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency or IO[bytes] - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resiliency_envelope, (IOBase, bytes)): - _content = resiliency_envelope - else: - _json = self._serialize.body(resiliency_envelope, "AppResiliency") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("AppResiliency", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("AppResiliency", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: _models.AppResiliency, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Required. - :type resiliency_envelope: 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: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: Union[_models.AppResiliency, IO[bytes]], - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Is either a AppResiliency type or - a IO[bytes] type. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency or IO[bytes] - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resiliency_envelope, (IOBase, bytes)): - _content = resiliency_envelope - else: - _json = self._serialize.body(resiliency_envelope, "AppResiliency") - - _request = build_update_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AppResiliency", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, app_name: str, name: str, **kwargs: Any - ) -> None: - """Delete an application's resiliency policy. - - Delete container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get(self, resource_group_name: str, app_name: str, name: str, **kwargs: Any) -> _models.AppResiliency: - """Get an application's resiliency policy. - - Get container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AppResiliency", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, app_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResiliency"]: - """List an application's resiliency policies. - - List container app resiliency policies. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :return: An iterator like instance of either AppResiliency or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.AppResiliency] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AppResiliencyCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - app_name=app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AppResiliencyCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_build_auth_token_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_build_auth_token_operations.py deleted file mode 100644 index 2fb05c7a410f..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_build_auth_token_operations.py +++ /dev/null @@ -1,114 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._build_auth_token_operations import build_list_request -from .._vendor import ContainerAppsAPIClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class BuildAuthTokenOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`build_auth_token` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list( - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> _models.BuildToken: - """Gets the token used to connect to the endpoint where source code can be uploaded for a build. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: BuildToken or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuildToken - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildToken] = kwargs.pop("cls", None) - - _request = build_list_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BuildToken", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builders_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builders_operations.py deleted file mode 100644 index 1caf40d02969..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builders_operations.py +++ /dev/null @@ -1,781 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._builders_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) -from .._vendor import ContainerAppsAPIClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class BuildersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`builders` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.BuilderResource"]: - """List BuilderResource resources by subscription ID. - - :return: An iterator like instance of either BuilderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BuilderCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.BuilderResource"]: - """List BuilderResource resources by 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 either BuilderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BuilderCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> _models.BuilderResource: - """Get a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: BuilderResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuilderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BuilderResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResource, IO[bytes]], - **kwargs: Any - ) -> _models.BuilderResource: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(builder_envelope, (IOBase, bytes)): - _content = builder_envelope - else: - _json = self._serialize.body(builder_envelope, "BuilderResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("BuilderResource", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("BuilderResource", pipeline_response) - - 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, - builder_name: str, - builder_envelope: _models.BuilderResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResource - :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 either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Required. - :type builder_envelope: 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 either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Is either a BuilderResource type or a - IO[bytes] type. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuilderResource] = 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, - builder_name=builder_name, - builder_envelope=builder_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuilderResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.BuilderResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BuilderResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResourceUpdate, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.BuilderResource]: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.BuilderResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(builder_envelope, (IOBase, bytes)): - _content = builder_envelope - else: - _json = self._serialize.body(builder_envelope, "BuilderResourceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("BuilderResource", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - 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, - builder_name: str, - builder_envelope: _models.BuilderResourceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResourceUpdate - :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 either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Required. - :type builder_envelope: 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 either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResourceUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Is either a - BuilderResourceUpdate type or a IO[bytes] type. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResourceUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuilderResource] = 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, - builder_name=builder_name, - builder_envelope=builder_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuilderResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.BuilderResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BuilderResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, builder_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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( # type: ignore - resource_group_name=resource_group_name, - builder_name=builder_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - 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 - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **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 diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_by_builder_resource_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_by_builder_resource_operations.py deleted file mode 100644 index ae9dcaa12757..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_by_builder_resource_operations.py +++ /dev/null @@ -1,140 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._builds_by_builder_resource_operations import build_list_request -from .._vendor import ContainerAppsAPIClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class BuildsByBuilderResourceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`builds_by_builder_resource` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, builder_name: str, **kwargs: Any - ) -> AsyncIterable["_models.BuildResource"]: - """List BuildResource resources by BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: An iterator like instance of either BuildResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BuildCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_operations.py deleted file mode 100644 index 7ad0aa009496..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_operations.py +++ /dev/null @@ -1,436 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._builds_operations import build_create_or_update_request, build_delete_request, build_get_request -from .._vendor import ContainerAppsAPIClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class BuildsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`builds` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> _models.BuildResource: - """Get a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: BuildResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuildResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BuildResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: Union[_models.BuildResource, IO[bytes]], - **kwargs: Any - ) -> _models.BuildResource: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuildResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(build_envelope, (IOBase, bytes)): - _content = build_envelope - else: - _json = self._serialize.body(build_envelope, "BuildResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("BuildResource", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("BuildResource", pipeline_response) - - 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, - builder_name: str, - build_name: str, - build_envelope: _models.BuildResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Required. - :type build_envelope: ~azure.mgmt.appcontainers.models.BuildResource - :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 either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Required. - :type build_envelope: 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 either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: Union[_models.BuildResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Is either a BuildResource type or - a IO[bytes] type. Required. - :type build_envelope: ~azure.mgmt.appcontainers.models.BuildResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuildResource] = 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, - builder_name=builder_name, - build_name=build_name, - build_envelope=build_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuildResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.BuildResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BuildResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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( # type: ignore - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - 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 - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **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 diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_component_resiliency_policies_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_component_resiliency_policies_operations.py deleted file mode 100644 index 94f079c80704..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_component_resiliency_policies_operations.py +++ /dev/null @@ -1,451 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._dapr_component_resiliency_policies_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, -) -from .._vendor import ContainerAppsAPIClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DaprComponentResiliencyPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`dapr_component_resiliency_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, component_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DaprComponentResiliencyPolicy"]: - """Get the resiliency policies for a Dapr component. - - Get the resiliency policies for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :return: An iterator like instance of either DaprComponentResiliencyPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprComponentResiliencyPoliciesCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DaprComponentResiliencyPoliciesCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, environment_name: str, component_name: str, name: str, **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Get a Dapr component resiliency policy. - - Get a Dapr component resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprComponentResiliencyPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprComponentResiliencyPolicy", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: _models.DaprComponentResiliencyPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Required. - :type dapr_component_resiliency_policy_envelope: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Required. - :type dapr_component_resiliency_policy_envelope: 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: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: Union[_models.DaprComponentResiliencyPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Is either a DaprComponentResiliencyPolicy type or a IO[bytes] type. - Required. - :type dapr_component_resiliency_policy_envelope: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy or IO[bytes] - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DaprComponentResiliencyPolicy] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dapr_component_resiliency_policy_envelope, (IOBase, bytes)): - _content = dapr_component_resiliency_policy_envelope - else: - _json = self._serialize.body(dapr_component_resiliency_policy_envelope, "DaprComponentResiliencyPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DaprComponentResiliencyPolicy", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("DaprComponentResiliencyPolicy", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, component_name: str, name: str, **kwargs: Any - ) -> None: - """Delete a Dapr component resiliency policy. - - Delete a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_subscriptions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_subscriptions_operations.py deleted file mode 100644 index 54b4c58c6440..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_subscriptions_operations.py +++ /dev/null @@ -1,427 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._dapr_subscriptions_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, -) -from .._vendor import ContainerAppsAPIClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DaprSubscriptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`dapr_subscriptions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DaprSubscription"]: - """Get the Dapr subscriptions for a managed environment. - - Get the Dapr subscriptions for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either DaprSubscription or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.DaprSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprSubscriptionsCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DaprSubscriptionsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> _models.DaprSubscription: - """Get a dapr subscription. - - Get a dapr subscription. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprSubscription] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprSubscription", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: _models.DaprSubscription, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Required. - :type dapr_subscription_envelope: ~azure.mgmt.appcontainers.models.DaprSubscription - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Required. - :type dapr_subscription_envelope: 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: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: Union[_models.DaprSubscription, IO[bytes]], - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Is either a - DaprSubscription type or a IO[bytes] type. Required. - :type dapr_subscription_envelope: ~azure.mgmt.appcontainers.models.DaprSubscription or - IO[bytes] - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DaprSubscription] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dapr_subscription_envelope, (IOBase, bytes)): - _content = dapr_subscription_envelope - else: - _json = self._serialize.body(dapr_subscription_envelope, "DaprSubscription") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DaprSubscription", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("DaprSubscription", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> None: - """Delete a Dapr subscription. - - Delete a Dapr subscription from a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dot_net_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dot_net_components_operations.py deleted file mode 100644 index a2794217eb51..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dot_net_components_operations.py +++ /dev/null @@ -1,751 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._dot_net_components_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_update_request, -) -from .._vendor import ContainerAppsAPIClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DotNetComponentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`dot_net_components` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DotNetComponent"]: - """Get the .NET Components for a managed environment. - - Get the .NET Components for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either DotNetComponent or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DotNetComponentsCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DotNetComponentsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> _models.DotNetComponent: - """Get a .NET Component. - - Get a .NET Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :return: DotNetComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DotNetComponent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DotNetComponent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DotNetComponent", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> _models.DotNetComponent: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DotNetComponent] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dot_net_component_envelope, (IOBase, bytes)): - _content = dot_net_component_envelope - else: - _json = self._serialize.body(dot_net_component_envelope, "DotNetComponent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DotNetComponent", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("DotNetComponent", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: _models.DotNetComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent - :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 either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: 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 either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Is either a - DotNetComponent type or a IO[bytes] type. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent or IO[bytes] - :return: An instance of AsyncLROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DotNetComponent] = 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, - environment_name=environment_name, - name=name, - dot_net_component_envelope=dot_net_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DotNetComponent", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DotNetComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DotNetComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.DotNetComponent]: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.DotNetComponent]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dot_net_component_envelope, (IOBase, bytes)): - _content = dot_net_component_envelope - else: - _json = self._serialize.body(dot_net_component_envelope, "DotNetComponent") - - _request = build_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("DotNetComponent", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - 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, - environment_name: str, - name: str, - dot_net_component_envelope: _models.DotNetComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent - :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 either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: 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 either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Is either a - DotNetComponent type or a IO[bytes] type. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent or IO[bytes] - :return: An instance of AsyncLROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DotNetComponent] = 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, - environment_name=environment_name, - name=name, - dot_net_component_envelope=dot_net_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DotNetComponent", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DotNetComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DotNetComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a .NET Component. - - Delete a .NET Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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( # type: ignore - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - 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 - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **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 diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_java_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_java_components_operations.py deleted file mode 100644 index 3c1d14fee1e5..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_java_components_operations.py +++ /dev/null @@ -1,750 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._java_components_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_update_request, -) -from .._vendor import ContainerAppsAPIClientMixinABC - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class JavaComponentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`java_components` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.JavaComponent"]: - """Get the Java Components for a managed environment. - - Get the Java Components for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either JavaComponent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JavaComponentsCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JavaComponentsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> _models.JavaComponent: - """Get a Java Component. - - Get a Java Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :return: JavaComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.JavaComponent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JavaComponent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JavaComponent", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> _models.JavaComponent: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JavaComponent] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(java_component_envelope, (IOBase, bytes)): - _content = java_component_envelope - else: - _json = self._serialize.body(java_component_envelope, "JavaComponent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("JavaComponent", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("JavaComponent", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: _models.JavaComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent - :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 either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: 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 either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Is either a - JavaComponent type or a IO[bytes] type. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent or IO[bytes] - :return: An instance of AsyncLROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JavaComponent] = 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, - environment_name=environment_name, - name=name, - java_component_envelope=java_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JavaComponent", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.JavaComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JavaComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.JavaComponent]: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JavaComponent]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(java_component_envelope, (IOBase, bytes)): - _content = java_component_envelope - else: - _json = self._serialize.body(java_component_envelope, "JavaComponent") - - _request = build_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("JavaComponent", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - 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, - environment_name: str, - name: str, - java_component_envelope: _models.JavaComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent - :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 either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: 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 either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Is either a - JavaComponent type or a IO[bytes] type. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent or IO[bytes] - :return: An instance of AsyncLROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JavaComponent] = 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, - environment_name=environment_name, - name=name, - java_component_envelope=java_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JavaComponent", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.JavaComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JavaComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a Java Component. - - Delete a Java Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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( # type: ignore - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - 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 - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **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 diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py index 22276b34a13d..ab1cc1adb8c3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -71,10 +71,10 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def list_detectors( + @distributed_trace + def list_detectors( self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> _models.DiagnosticsCollection: + ) -> AsyncIterable["_models.Diagnostics"]: """Get the list of diagnostics for a given Container App Job. Get the list of diagnostics for a Container App Job. @@ -84,10 +84,16 @@ async def list_detectors( :type resource_group_name: str :param job_name: Job Name. Required. :type job_name: str - :return: DiagnosticsCollection or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DiagnosticsCollection + :return: An iterator like instance of either Diagnostics or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.Diagnostics] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DiagnosticsCollection] = kwargs.pop("cls", None) + error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -96,41 +102,62 @@ async def list_detectors( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DiagnosticsCollection] = kwargs.pop("cls", None) + _request = build_list_detectors_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) - _request = build_list_detectors_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) + 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), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + 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 = self._deserialize("DiagnosticsCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) - response = pipeline_response.http_response + async def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - deserialized = self._deserialize("DiagnosticsCollection", pipeline_response) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_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 AsyncItemPaged(get_next, extract_data) @distributed_trace_async async def get_detector( @@ -197,8 +224,8 @@ async def get_detector( return deserialized # type: ignore @distributed_trace_async - async def proxy_get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models.Job: - """Get the properties for a given Container App Job. + async def proxy_get(self, resource_group_name: str, job_name: str, api_name: str, **kwargs: Any) -> _models.Job: + """Get the properties of a Container App Job. Get the properties of a Container App Job. @@ -207,6 +234,8 @@ async def proxy_get(self, resource_group_name: str, job_name: str, **kwargs: Any :type resource_group_name: str :param job_name: Job Name. Required. :type job_name: str + :param api_name: Proxy API Name for Container App Job. Required. + :type api_name: str :return: Job or the result of cls(response) :rtype: ~azure.mgmt.appcontainers.models.Job :raises ~azure.core.exceptions.HttpResponseError: @@ -222,15 +251,14 @@ async def proxy_get(self, resource_group_name: str, job_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_name: Literal["rootApi"] = kwargs.pop("api_name", "rootApi") api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) _request = build_proxy_get_request( resource_group_name=resource_group_name, job_name=job_name, - subscription_id=self._config.subscription_id, api_name=api_name, + subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py index d81009d3ad02..132ece90cb50 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py @@ -8,11 +8,8 @@ from ._models_py3 import AllowedAudiencesValidation from ._models_py3 import AllowedPrincipals -from ._models_py3 import AppInsightsConfiguration from ._models_py3 import AppLogsConfiguration from ._models_py3 import AppRegistration -from ._models_py3 import AppResiliency -from ._models_py3 import AppResiliencyCollection from ._models_py3 import Apple from ._models_py3 import AppleRegistration from ._models_py3 import AuthConfig @@ -35,21 +32,12 @@ from ._models_py3 import BillingMeterCollection from ._models_py3 import BillingMeterProperties from ._models_py3 import BlobStorageTokenStore -from ._models_py3 import BuildCollection -from ._models_py3 import BuildConfiguration -from ._models_py3 import BuildResource -from ._models_py3 import BuildToken -from ._models_py3 import BuilderCollection -from ._models_py3 import BuilderResource -from ._models_py3 import BuilderResourceUpdate from ._models_py3 import Certificate from ._models_py3 import CertificateCollection -from ._models_py3 import CertificateKeyVaultProperties from ._models_py3 import CertificatePatch from ._models_py3 import CertificateProperties from ._models_py3 import CheckNameAvailabilityRequest from ._models_py3 import CheckNameAvailabilityResponse -from ._models_py3 import CircuitBreakerPolicy from ._models_py3 import ClientRegistration from ._models_py3 import Configuration from ._models_py3 import ConnectedEnvironment @@ -67,8 +55,6 @@ from ._models_py3 import ContainerAppProbeHttpGetHttpHeadersItem from ._models_py3 import ContainerAppProbeTcpSocket from ._models_py3 import ContainerAppSecret -from ._models_py3 import ContainerRegistry -from ._models_py3 import ContainerRegistryWithCustomImage from ._models_py3 import ContainerResources from ._models_py3 import CookieExpiration from ._models_py3 import CorsPolicy @@ -81,31 +67,15 @@ from ._models_py3 import CustomScaleRule from ._models_py3 import Dapr from ._models_py3 import DaprComponent -from ._models_py3 import DaprComponentResiliencyPoliciesCollection -from ._models_py3 import DaprComponentResiliencyPolicy -from ._models_py3 import DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration -from ._models_py3 import DaprComponentResiliencyPolicyConfiguration -from ._models_py3 import DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration -from ._models_py3 import DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration -from ._models_py3 import DaprComponentResiliencyPolicyTimeoutPolicyConfiguration -from ._models_py3 import DaprComponentServiceBinding from ._models_py3 import DaprComponentsCollection from ._models_py3 import DaprConfiguration from ._models_py3 import DaprMetadata from ._models_py3 import DaprSecret from ._models_py3 import DaprSecretsCollection -from ._models_py3 import DaprServiceBindMetadata -from ._models_py3 import DaprSubscription -from ._models_py3 import DaprSubscriptionBulkSubscribeOptions -from ._models_py3 import DaprSubscriptionRouteRule -from ._models_py3 import DaprSubscriptionRoutes -from ._models_py3 import DaprSubscriptionsCollection -from ._models_py3 import DataDogConfiguration from ._models_py3 import DefaultAuthorizationPolicy from ._models_py3 import DefaultErrorResponse from ._models_py3 import DefaultErrorResponseError from ._models_py3 import DefaultErrorResponseErrorDetailsItem -from ._models_py3 import DestinationsConfiguration from ._models_py3 import DiagnosticDataProviderMetadata from ._models_py3 import DiagnosticDataProviderMetadataPropertyBagItem from ._models_py3 import DiagnosticDataTableResponseColumn @@ -118,14 +88,9 @@ from ._models_py3 import DiagnosticsDefinition from ._models_py3 import DiagnosticsProperties from ._models_py3 import DiagnosticsStatus -from ._models_py3 import DotNetComponent -from ._models_py3 import DotNetComponentConfigurationProperty -from ._models_py3 import DotNetComponentServiceBind -from ._models_py3 import DotNetComponentsCollection from ._models_py3 import EncryptionSettings from ._models_py3 import EnvironmentAuthToken from ._models_py3 import EnvironmentVar -from ._models_py3 import EnvironmentVariable from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse @@ -136,11 +101,6 @@ from ._models_py3 import GithubActionConfiguration from ._models_py3 import GlobalValidation from ._models_py3 import Google -from ._models_py3 import Header -from ._models_py3 import HeaderMatch -from ._models_py3 import HttpConnectionPool -from ._models_py3 import HttpGet -from ._models_py3 import HttpRetryPolicy from ._models_py3 import HttpScaleRule from ._models_py3 import HttpSettings from ._models_py3 import HttpSettingsRoutes @@ -150,10 +110,6 @@ from ._models_py3 import IngressStickySessions from ._models_py3 import InitContainer from ._models_py3 import IpSecurityRestrictionRule -from ._models_py3 import JavaComponent -from ._models_py3 import JavaComponentConfigurationProperty -from ._models_py3 import JavaComponentServiceBind -from ._models_py3 import JavaComponentsCollection from ._models_py3 import Job from ._models_py3 import JobConfiguration from ._models_py3 import JobConfigurationEventTriggerConfig @@ -178,31 +134,27 @@ from ._models_py3 import Login from ._models_py3 import LoginRoutes from ._models_py3 import LoginScopes -from ._models_py3 import LogsConfiguration from ._models_py3 import ManagedCertificate from ._models_py3 import ManagedCertificateCollection from ._models_py3 import ManagedCertificatePatch from ._models_py3 import ManagedCertificateProperties from ._models_py3 import ManagedEnvironment from ._models_py3 import ManagedEnvironmentPropertiesPeerAuthentication +from ._models_py3 import ManagedEnvironmentPropertiesPeerTrafficConfiguration +from ._models_py3 import ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption from ._models_py3 import ManagedEnvironmentStorage from ._models_py3 import ManagedEnvironmentStorageProperties from ._models_py3 import ManagedEnvironmentStoragesCollection from ._models_py3 import ManagedEnvironmentsCollection from ._models_py3 import ManagedServiceIdentity -from ._models_py3 import MetricsConfiguration from ._models_py3 import Mtls -from ._models_py3 import NfsAzureFileProperties from ._models_py3 import Nonce from ._models_py3 import OpenIdConnectClientCredential from ._models_py3 import OpenIdConnectConfig from ._models_py3 import OpenIdConnectLogin from ._models_py3 import OpenIdConnectRegistration -from ._models_py3 import OpenTelemetryConfiguration from ._models_py3 import OperationDetail from ._models_py3 import OperationDisplay -from ._models_py3 import OtlpConfiguration -from ._models_py3 import PreBuildStep from ._models_py3 import ProxyResource from ._models_py3 import QueueScaleRule from ._models_py3 import RegistryCredentials @@ -224,13 +176,9 @@ from ._models_py3 import SourceControl from ._models_py3 import SourceControlCollection from ._models_py3 import SystemData -from ._models_py3 import TcpConnectionPool -from ._models_py3 import TcpRetryPolicy from ._models_py3 import TcpScaleRule from ._models_py3 import Template -from ._models_py3 import TimeoutPolicy from ._models_py3 import TokenStore -from ._models_py3 import TracesConfiguration from ._models_py3 import TrackedResource from ._models_py3 import TrafficWeight from ._models_py3 import Twitter @@ -253,11 +201,7 @@ from ._container_apps_api_client_enums import AppProtocol from ._container_apps_api_client_enums import Applicability from ._container_apps_api_client_enums import BindingType -from ._container_apps_api_client_enums import BuildProvisioningState -from ._container_apps_api_client_enums import BuildStatus -from ._container_apps_api_client_enums import BuilderProvisioningState from ._container_apps_api_client_enums import CertificateProvisioningState -from ._container_apps_api_client_enums import CertificateType from ._container_apps_api_client_enums import CheckNameAvailabilityReason from ._container_apps_api_client_enums import ConnectedEnvironmentProvisioningState from ._container_apps_api_client_enums import ContainerAppContainerRunningState @@ -266,16 +210,11 @@ from ._container_apps_api_client_enums import CookieExpirationConvention from ._container_apps_api_client_enums import CreatedByType from ._container_apps_api_client_enums import DnsVerificationTestResult -from ._container_apps_api_client_enums import DotNetComponentProvisioningState -from ._container_apps_api_client_enums import DotNetComponentType from ._container_apps_api_client_enums import EnvironmentProvisioningState from ._container_apps_api_client_enums import ExtendedLocationTypes from ._container_apps_api_client_enums import ForwardProxyConvention from ._container_apps_api_client_enums import IngressClientCertificateMode -from ._container_apps_api_client_enums import IngressTargetPortHttpScheme from ._container_apps_api_client_enums import IngressTransportMethod -from ._container_apps_api_client_enums import JavaComponentProvisioningState -from ._container_apps_api_client_enums import JavaComponentType from ._container_apps_api_client_enums import JobExecutionRunningState from ._container_apps_api_client_enums import JobProvisioningState from ._container_apps_api_client_enums import LogLevel @@ -297,11 +236,8 @@ __all__ = [ "AllowedAudiencesValidation", "AllowedPrincipals", - "AppInsightsConfiguration", "AppLogsConfiguration", "AppRegistration", - "AppResiliency", - "AppResiliencyCollection", "Apple", "AppleRegistration", "AuthConfig", @@ -324,21 +260,12 @@ "BillingMeterCollection", "BillingMeterProperties", "BlobStorageTokenStore", - "BuildCollection", - "BuildConfiguration", - "BuildResource", - "BuildToken", - "BuilderCollection", - "BuilderResource", - "BuilderResourceUpdate", "Certificate", "CertificateCollection", - "CertificateKeyVaultProperties", "CertificatePatch", "CertificateProperties", "CheckNameAvailabilityRequest", "CheckNameAvailabilityResponse", - "CircuitBreakerPolicy", "ClientRegistration", "Configuration", "ConnectedEnvironment", @@ -356,8 +283,6 @@ "ContainerAppProbeHttpGetHttpHeadersItem", "ContainerAppProbeTcpSocket", "ContainerAppSecret", - "ContainerRegistry", - "ContainerRegistryWithCustomImage", "ContainerResources", "CookieExpiration", "CorsPolicy", @@ -370,31 +295,15 @@ "CustomScaleRule", "Dapr", "DaprComponent", - "DaprComponentResiliencyPoliciesCollection", - "DaprComponentResiliencyPolicy", - "DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration", - "DaprComponentResiliencyPolicyConfiguration", - "DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration", - "DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration", - "DaprComponentResiliencyPolicyTimeoutPolicyConfiguration", - "DaprComponentServiceBinding", "DaprComponentsCollection", "DaprConfiguration", "DaprMetadata", "DaprSecret", "DaprSecretsCollection", - "DaprServiceBindMetadata", - "DaprSubscription", - "DaprSubscriptionBulkSubscribeOptions", - "DaprSubscriptionRouteRule", - "DaprSubscriptionRoutes", - "DaprSubscriptionsCollection", - "DataDogConfiguration", "DefaultAuthorizationPolicy", "DefaultErrorResponse", "DefaultErrorResponseError", "DefaultErrorResponseErrorDetailsItem", - "DestinationsConfiguration", "DiagnosticDataProviderMetadata", "DiagnosticDataProviderMetadataPropertyBagItem", "DiagnosticDataTableResponseColumn", @@ -407,14 +316,9 @@ "DiagnosticsDefinition", "DiagnosticsProperties", "DiagnosticsStatus", - "DotNetComponent", - "DotNetComponentConfigurationProperty", - "DotNetComponentServiceBind", - "DotNetComponentsCollection", "EncryptionSettings", "EnvironmentAuthToken", "EnvironmentVar", - "EnvironmentVariable", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", @@ -425,11 +329,6 @@ "GithubActionConfiguration", "GlobalValidation", "Google", - "Header", - "HeaderMatch", - "HttpConnectionPool", - "HttpGet", - "HttpRetryPolicy", "HttpScaleRule", "HttpSettings", "HttpSettingsRoutes", @@ -439,10 +338,6 @@ "IngressStickySessions", "InitContainer", "IpSecurityRestrictionRule", - "JavaComponent", - "JavaComponentConfigurationProperty", - "JavaComponentServiceBind", - "JavaComponentsCollection", "Job", "JobConfiguration", "JobConfigurationEventTriggerConfig", @@ -467,31 +362,27 @@ "Login", "LoginRoutes", "LoginScopes", - "LogsConfiguration", "ManagedCertificate", "ManagedCertificateCollection", "ManagedCertificatePatch", "ManagedCertificateProperties", "ManagedEnvironment", "ManagedEnvironmentPropertiesPeerAuthentication", + "ManagedEnvironmentPropertiesPeerTrafficConfiguration", + "ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption", "ManagedEnvironmentStorage", "ManagedEnvironmentStorageProperties", "ManagedEnvironmentStoragesCollection", "ManagedEnvironmentsCollection", "ManagedServiceIdentity", - "MetricsConfiguration", "Mtls", - "NfsAzureFileProperties", "Nonce", "OpenIdConnectClientCredential", "OpenIdConnectConfig", "OpenIdConnectLogin", "OpenIdConnectRegistration", - "OpenTelemetryConfiguration", "OperationDetail", "OperationDisplay", - "OtlpConfiguration", - "PreBuildStep", "ProxyResource", "QueueScaleRule", "RegistryCredentials", @@ -513,13 +404,9 @@ "SourceControl", "SourceControlCollection", "SystemData", - "TcpConnectionPool", - "TcpRetryPolicy", "TcpScaleRule", "Template", - "TimeoutPolicy", "TokenStore", - "TracesConfiguration", "TrackedResource", "TrafficWeight", "Twitter", @@ -541,11 +428,7 @@ "AppProtocol", "Applicability", "BindingType", - "BuildProvisioningState", - "BuildStatus", - "BuilderProvisioningState", "CertificateProvisioningState", - "CertificateType", "CheckNameAvailabilityReason", "ConnectedEnvironmentProvisioningState", "ContainerAppContainerRunningState", @@ -554,16 +437,11 @@ "CookieExpirationConvention", "CreatedByType", "DnsVerificationTestResult", - "DotNetComponentProvisioningState", - "DotNetComponentType", "EnvironmentProvisioningState", "ExtendedLocationTypes", "ForwardProxyConvention", "IngressClientCertificateMode", - "IngressTargetPortHttpScheme", "IngressTransportMethod", - "JavaComponentProvisioningState", - "JavaComponentType", "JobExecutionRunningState", "JobProvisioningState", "LogLevel", diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py index 76e21fe999be..694a6932ba5d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py @@ -71,38 +71,6 @@ class BindingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SNI_ENABLED = "SniEnabled" -class BuilderProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Resource instance provisioning state.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - - -class BuildProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Resource instance provisioning state.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - - -class BuildStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the build once it has been provisioned.""" - - NOT_STARTED = "NotStarted" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - CANCELED = "Canceled" - FAILED = "Failed" - - class CertificateProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of the certificate.""" @@ -113,15 +81,6 @@ class CertificateProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta) PENDING = "Pending" -class CertificateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the certificate. Allowed values are ``ServerSSLCertificate`` and - ``ImagePullTrustedCA``. - """ - - SERVER_SSL_CERTIFICATE = "ServerSSLCertificate" - IMAGE_PULL_TRUSTED_CA = "ImagePullTrustedCA" - - class CheckNameAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The reason why the given name is not available.""" @@ -192,23 +151,6 @@ class DnsVerificationTestResult(str, Enum, metaclass=CaseInsensitiveEnumMeta): SKIPPED = "Skipped" -class DotNetComponentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of the .NET Component.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - DELETING = "Deleting" - IN_PROGRESS = "InProgress" - - -class DotNetComponentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the .NET Component.""" - - ASPIRE_DASHBOARD = "AspireDashboard" - ASPIRE_RESOURCE_SERVER_API = "AspireResourceServerApi" - - class EnvironmentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of the Environment.""" @@ -249,13 +191,6 @@ class IngressClientCertificateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta) REQUIRE = "require" -class IngressTargetPortHttpScheme(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether an http app listens on http or https.""" - - HTTP = "http" - HTTPS = "https" - - class IngressTransportMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Ingress transport protocol.""" @@ -265,24 +200,6 @@ class IngressTransportMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): TCP = "tcp" -class JavaComponentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of the Java Component.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - DELETING = "Deleting" - IN_PROGRESS = "InProgress" - - -class JavaComponentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Java Component.""" - - SPRING_BOOT_ADMIN = "SpringBootAdmin" - SPRING_CLOUD_EUREKA = "SpringCloudEureka" - SPRING_CLOUD_CONFIG = "SpringCloudConfig" - - class JobExecutionRunningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Current running State of the job.""" @@ -386,7 +303,6 @@ class StorageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_FILE = "AzureFile" EMPTY_DIR = "EmptyDir" SECRET = "Secret" - NFS_AZURE_FILE = "NfsAzureFile" class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py index e6f107c1bec7..a0f63a50a48d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py @@ -74,26 +74,6 @@ def __init__( self.identities = identities -class AppInsightsConfiguration(_serialization.Model): - """Configuration of Application Insights. - - :ivar connection_string: Application Insights connection string. - :vartype connection_string: str - """ - - _attribute_map = { - "connection_string": {"key": "connectionString", "type": "str"}, - } - - def __init__(self, *, connection_string: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword connection_string: Application Insights connection string. - :paramtype connection_string: str - """ - super().__init__(**kwargs) - self.connection_string = connection_string - - class Apple(_serialization.Model): """The configuration settings of the Apple provider. @@ -289,123 +269,6 @@ class ProxyResource(Resource): """ -class AppResiliency(ProxyResource): - """Configuration to setup App Resiliency. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.appcontainers.models.SystemData - :ivar timeout_policy: Policy to set request timeouts. - :vartype timeout_policy: ~azure.mgmt.appcontainers.models.TimeoutPolicy - :ivar http_retry_policy: Policy that defines http request retry conditions. - :vartype http_retry_policy: ~azure.mgmt.appcontainers.models.HttpRetryPolicy - :ivar tcp_retry_policy: Policy that defines tcp request retry conditions. - :vartype tcp_retry_policy: ~azure.mgmt.appcontainers.models.TcpRetryPolicy - :ivar circuit_breaker_policy: Policy that defines circuit breaker conditions. - :vartype circuit_breaker_policy: ~azure.mgmt.appcontainers.models.CircuitBreakerPolicy - :ivar http_connection_pool: Defines parameters for http connection pooling. - :vartype http_connection_pool: ~azure.mgmt.appcontainers.models.HttpConnectionPool - :ivar tcp_connection_pool: Defines parameters for tcp connection pooling. - :vartype tcp_connection_pool: ~azure.mgmt.appcontainers.models.TcpConnectionPool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "timeout_policy": {"key": "properties.timeoutPolicy", "type": "TimeoutPolicy"}, - "http_retry_policy": {"key": "properties.httpRetryPolicy", "type": "HttpRetryPolicy"}, - "tcp_retry_policy": {"key": "properties.tcpRetryPolicy", "type": "TcpRetryPolicy"}, - "circuit_breaker_policy": {"key": "properties.circuitBreakerPolicy", "type": "CircuitBreakerPolicy"}, - "http_connection_pool": {"key": "properties.httpConnectionPool", "type": "HttpConnectionPool"}, - "tcp_connection_pool": {"key": "properties.tcpConnectionPool", "type": "TcpConnectionPool"}, - } - - def __init__( - self, - *, - timeout_policy: Optional["_models.TimeoutPolicy"] = None, - http_retry_policy: Optional["_models.HttpRetryPolicy"] = None, - tcp_retry_policy: Optional["_models.TcpRetryPolicy"] = None, - circuit_breaker_policy: Optional["_models.CircuitBreakerPolicy"] = None, - http_connection_pool: Optional["_models.HttpConnectionPool"] = None, - tcp_connection_pool: Optional["_models.TcpConnectionPool"] = None, - **kwargs: Any - ) -> None: - """ - :keyword timeout_policy: Policy to set request timeouts. - :paramtype timeout_policy: ~azure.mgmt.appcontainers.models.TimeoutPolicy - :keyword http_retry_policy: Policy that defines http request retry conditions. - :paramtype http_retry_policy: ~azure.mgmt.appcontainers.models.HttpRetryPolicy - :keyword tcp_retry_policy: Policy that defines tcp request retry conditions. - :paramtype tcp_retry_policy: ~azure.mgmt.appcontainers.models.TcpRetryPolicy - :keyword circuit_breaker_policy: Policy that defines circuit breaker conditions. - :paramtype circuit_breaker_policy: ~azure.mgmt.appcontainers.models.CircuitBreakerPolicy - :keyword http_connection_pool: Defines parameters for http connection pooling. - :paramtype http_connection_pool: ~azure.mgmt.appcontainers.models.HttpConnectionPool - :keyword tcp_connection_pool: Defines parameters for tcp connection pooling. - :paramtype tcp_connection_pool: ~azure.mgmt.appcontainers.models.TcpConnectionPool - """ - super().__init__(**kwargs) - self.timeout_policy = timeout_policy - self.http_retry_policy = http_retry_policy - self.tcp_retry_policy = tcp_retry_policy - self.circuit_breaker_policy = circuit_breaker_policy - self.http_connection_pool = http_connection_pool - self.tcp_connection_pool = tcp_connection_pool - - -class AppResiliencyCollection(_serialization.Model): - """Collection of AppResiliency policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.AppResiliency] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AppResiliency]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.AppResiliency"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.AppResiliency] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - class AuthConfig(ProxyResource): """Configuration settings for the Azure ContainerApp Service Authentication / Authorization feature. @@ -1371,127 +1234,6 @@ def __init__(self, *, sas_url_setting_name: str, **kwargs: Any) -> None: self.sas_url_setting_name = sas_url_setting_name -class BuildCollection(_serialization.Model): - """The response of a BuildResource list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The BuildResource items on this page. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.BuildResource] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[BuildResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.BuildResource"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The BuildResource items on this page. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.BuildResource] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class BuildConfiguration(_serialization.Model): - """Configuration of the build. - - :ivar base_os: Base OS used to build and run the app. - :vartype base_os: str - :ivar platform: Platform to be used to build and run the app. - :vartype platform: str - :ivar platform_version: Platform version to be used to build and run the app. - :vartype platform_version: str - :ivar environment_variables: List of environment variables to be passed to the build, secrets - should not be used in environment variable. - :vartype environment_variables: list[~azure.mgmt.appcontainers.models.EnvironmentVariable] - :ivar pre_build_steps: List of steps to perform before the build. - :vartype pre_build_steps: list[~azure.mgmt.appcontainers.models.PreBuildStep] - """ - - _attribute_map = { - "base_os": {"key": "baseOs", "type": "str"}, - "platform": {"key": "platform", "type": "str"}, - "platform_version": {"key": "platformVersion", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "[EnvironmentVariable]"}, - "pre_build_steps": {"key": "preBuildSteps", "type": "[PreBuildStep]"}, - } - - def __init__( - self, - *, - base_os: Optional[str] = None, - platform: Optional[str] = None, - platform_version: Optional[str] = None, - environment_variables: Optional[List["_models.EnvironmentVariable"]] = None, - pre_build_steps: Optional[List["_models.PreBuildStep"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword base_os: Base OS used to build and run the app. - :paramtype base_os: str - :keyword platform: Platform to be used to build and run the app. - :paramtype platform: str - :keyword platform_version: Platform version to be used to build and run the app. - :paramtype platform_version: str - :keyword environment_variables: List of environment variables to be passed to the build, - secrets should not be used in environment variable. - :paramtype environment_variables: list[~azure.mgmt.appcontainers.models.EnvironmentVariable] - :keyword pre_build_steps: List of steps to perform before the build. - :paramtype pre_build_steps: list[~azure.mgmt.appcontainers.models.PreBuildStep] - """ - super().__init__(**kwargs) - self.base_os = base_os - self.platform = platform - self.platform_version = platform_version - self.environment_variables = environment_variables - self.pre_build_steps = pre_build_steps - - -class BuilderCollection(_serialization.Model): - """The response of a BuilderResource list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The BuilderResource items on this page. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.BuilderResource] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[BuilderResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.BuilderResource"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The BuilderResource items on this page. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.BuilderResource] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - class TrackedResource(Resource): """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -1546,8 +1288,8 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw self.location = location -class BuilderResource(TrackedResource): - """Information about the SourceToCloud builder resource. +class Certificate(TrackedResource): + """Certificate used for Custom Domain bindings of Container Apps in a Managed Environment. Variables are only populated by the server, and will be ignored when sending a request. @@ -1568,17 +1310,8 @@ class BuilderResource(TrackedResource): :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :ivar provisioning_state: Provisioning state of a builder resource. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.BuilderProvisioningState - :ivar environment_id: Resource ID of the container apps environment that the builder is - associated with. - :vartype environment_id: str - :ivar container_registries: List of mappings of container registries and the managed identity - used to connect to it. - :vartype container_registries: list[~azure.mgmt.appcontainers.models.ContainerRegistry] + :ivar properties: Certificate resource specific properties. + :vartype properties: ~azure.mgmt.appcontainers.models.CertificateProperties """ _validation = { @@ -1587,7 +1320,6 @@ class BuilderResource(TrackedResource): "type": {"readonly": True}, "system_data": {"readonly": True}, "location": {"required": True}, - "provisioning_state": {"readonly": True}, } _attribute_map = { @@ -1597,10 +1329,7 @@ class BuilderResource(TrackedResource): "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "environment_id": {"key": "properties.environmentId", "type": "str"}, - "container_registries": {"key": "properties.containerRegistries", "type": "[ContainerRegistry]"}, + "properties": {"key": "properties", "type": "CertificateProperties"}, } def __init__( @@ -1608,9 +1337,7 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - environment_id: Optional[str] = None, - container_registries: Optional[List["_models.ContainerRegistry"]] = None, + properties: Optional["_models.CertificateProperties"] = None, **kwargs: Any ) -> None: """ @@ -1618,329 +1345,68 @@ def __init__( :paramtype tags: dict[str, str] :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword identity: The managed service identities assigned to this resource. - :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :keyword environment_id: Resource ID of the container apps environment that the builder is - associated with. - :paramtype environment_id: str - :keyword container_registries: List of mappings of container registries and the managed - identity used to connect to it. - :paramtype container_registries: list[~azure.mgmt.appcontainers.models.ContainerRegistry] + :keyword properties: Certificate resource specific properties. + :paramtype properties: ~azure.mgmt.appcontainers.models.CertificateProperties """ super().__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.provisioning_state = None - self.environment_id = environment_id - self.container_registries = container_registries + self.properties = properties -class BuilderResourceUpdate(_serialization.Model): - """The type used for update operations of the BuilderResource. +class CertificateCollection(_serialization.Model): + """Collection of Certificates. - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar environment_id: Resource ID of the container apps environment that the builder is - associated with. - :vartype environment_id: str + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar value: Collection of resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.Certificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str """ + _validation = { + "value": {"required": True}, + "next_link": {"readonly": True}, + } + _attribute_map = { - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "tags": {"key": "tags", "type": "{str}"}, - "environment_id": {"key": "properties.environmentId", "type": "str"}, + "value": {"key": "value", "type": "[Certificate]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - identity: Optional["_models.ManagedServiceIdentity"] = None, - tags: Optional[Dict[str, str]] = None, - environment_id: Optional[str] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, value: List["_models.Certificate"], **kwargs: Any) -> None: """ - :keyword identity: The managed service identities assigned to this resource. - :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword environment_id: Resource ID of the container apps environment that the builder is - associated with. - :paramtype environment_id: str + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.Certificate] """ super().__init__(**kwargs) - self.identity = identity - self.tags = tags - self.environment_id = environment_id - + self.value = value + self.next_link = None -class BuildResource(ProxyResource): # pylint: disable=too-many-instance-attributes - """Information pertaining to an individual build. - Variables are only populated by the server, and will be ignored when sending a request. +class CertificatePatch(_serialization.Model): + """A certificate to update. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.appcontainers.models.SystemData - :ivar provisioning_state: Build provisioning state. Known values are: "Succeeded", "Failed", - "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.BuildProvisioningState - :ivar build_status: Status of the build once it has been provisioned. Known values are: - "NotStarted", "InProgress", "Succeeded", "Canceled", and "Failed". - :vartype build_status: str or ~azure.mgmt.appcontainers.models.BuildStatus - :ivar destination_container_registry: Container registry that the final image will be uploaded - to. - :vartype destination_container_registry: - ~azure.mgmt.appcontainers.models.ContainerRegistryWithCustomImage - :ivar configuration: Configuration of the build. - :vartype configuration: ~azure.mgmt.appcontainers.models.BuildConfiguration - :ivar upload_endpoint: Endpoint to which the source code should be uploaded. - :vartype upload_endpoint: str - :ivar log_stream_endpoint: Endpoint from which the build logs can be streamed. - :vartype log_stream_endpoint: str - :ivar token_endpoint: Endpoint to use to retrieve an authentication token for log streaming and - uploading source code. - :vartype token_endpoint: str + :ivar tags: Application-specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "build_status": {"readonly": True}, - "upload_endpoint": {"readonly": True}, - "log_stream_endpoint": {"readonly": True}, - "token_endpoint": {"readonly": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "build_status": {"key": "properties.buildStatus", "type": "str"}, - "destination_container_registry": { - "key": "properties.destinationContainerRegistry", - "type": "ContainerRegistryWithCustomImage", - }, - "configuration": {"key": "properties.configuration", "type": "BuildConfiguration"}, - "upload_endpoint": {"key": "properties.uploadEndpoint", "type": "str"}, - "log_stream_endpoint": {"key": "properties.logStreamEndpoint", "type": "str"}, - "token_endpoint": {"key": "properties.tokenEndpoint", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - *, - destination_container_registry: Optional["_models.ContainerRegistryWithCustomImage"] = None, - configuration: Optional["_models.BuildConfiguration"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ - :keyword destination_container_registry: Container registry that the final image will be - uploaded to. - :paramtype destination_container_registry: - ~azure.mgmt.appcontainers.models.ContainerRegistryWithCustomImage - :keyword configuration: Configuration of the build. - :paramtype configuration: ~azure.mgmt.appcontainers.models.BuildConfiguration + :keyword tags: Application-specific metadata in the form of key-value pairs. + :paramtype tags: dict[str, str] """ super().__init__(**kwargs) - self.provisioning_state = None - self.build_status = None - self.destination_container_registry = destination_container_registry - self.configuration = configuration - self.upload_endpoint = None - self.log_stream_endpoint = None - self.token_endpoint = None + self.tags = tags -class BuildToken(_serialization.Model): - """Build Auth Token. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar token: Authentication token. - :vartype token: str - :ivar expires: Token expiration date. - :vartype expires: ~datetime.datetime - """ - - _validation = { - "token": {"readonly": True}, - "expires": {"readonly": True}, - } - - _attribute_map = { - "token": {"key": "token", "type": "str"}, - "expires": {"key": "expires", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.token = None - self.expires = None - - -class Certificate(TrackedResource): - """Certificate used for Custom Domain bindings of Container Apps in a Managed Environment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.appcontainers.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: Certificate resource specific properties. - :vartype properties: ~azure.mgmt.appcontainers.models.CertificateProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "CertificateProperties"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CertificateProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: Certificate resource specific properties. - :paramtype properties: ~azure.mgmt.appcontainers.models.CertificateProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -class CertificateCollection(_serialization.Model): - """Collection of Certificates. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.Certificate] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Certificate]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Certificate"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.Certificate] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class CertificateKeyVaultProperties(_serialization.Model): - """Properties for a certificate stored in a Key Vault. - - :ivar identity: Resource ID of a managed identity to authenticate with Azure Key Vault, or - System to use a system-assigned identity. - :vartype identity: str - :ivar key_vault_url: URL pointing to the Azure Key Vault secret that holds the certificate. - :vartype key_vault_url: str - """ - - _attribute_map = { - "identity": {"key": "identity", "type": "str"}, - "key_vault_url": {"key": "keyVaultUrl", "type": "str"}, - } - - def __init__(self, *, identity: Optional[str] = None, key_vault_url: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword identity: Resource ID of a managed identity to authenticate with Azure Key Vault, or - System to use a system-assigned identity. - :paramtype identity: str - :keyword key_vault_url: URL pointing to the Azure Key Vault secret that holds the certificate. - :paramtype key_vault_url: str - """ - super().__init__(**kwargs) - self.identity = identity - self.key_vault_url = key_vault_url - - -class CertificatePatch(_serialization.Model): - """A certificate to update. - - :ivar tags: Application-specific metadata in the form of key-value pairs. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Application-specific metadata in the form of key-value pairs. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - -class CertificateProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Certificate resource specific properties. +class CertificateProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Certificate resource specific properties. Variables are only populated by the server, and will be ignored when sending a request. @@ -1948,9 +1414,6 @@ class CertificateProperties(_serialization.Model): # pylint: disable=too-many-i "Failed", "Canceled", "DeleteFailed", and "Pending". :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.CertificateProvisioningState - :ivar certificate_key_vault_properties: Properties for a certificate stored in a Key Vault. - :vartype certificate_key_vault_properties: - ~azure.mgmt.appcontainers.models.CertificateKeyVaultProperties :ivar password: Certificate password. :vartype password: str :ivar subject_name: Subject name of the certificate. @@ -1971,10 +1434,6 @@ class CertificateProperties(_serialization.Model): # pylint: disable=too-many-i :vartype valid: bool :ivar public_key_hash: Public key hash. :vartype public_key_hash: str - :ivar certificate_type: The type of the certificate. Allowed values are - ``ServerSSLCertificate`` and ``ImagePullTrustedCA``. Known values are: "ServerSSLCertificate" - and "ImagePullTrustedCA". - :vartype certificate_type: str or ~azure.mgmt.appcontainers.models.CertificateType """ _validation = { @@ -1991,10 +1450,6 @@ class CertificateProperties(_serialization.Model): # pylint: disable=too-many-i _attribute_map = { "provisioning_state": {"key": "provisioningState", "type": "str"}, - "certificate_key_vault_properties": { - "key": "certificateKeyVaultProperties", - "type": "CertificateKeyVaultProperties", - }, "password": {"key": "password", "type": "str"}, "subject_name": {"key": "subjectName", "type": "str"}, "subject_alternative_names": {"key": "subjectAlternativeNames", "type": "[str]"}, @@ -2005,34 +1460,17 @@ class CertificateProperties(_serialization.Model): # pylint: disable=too-many-i "thumbprint": {"key": "thumbprint", "type": "str"}, "valid": {"key": "valid", "type": "bool"}, "public_key_hash": {"key": "publicKeyHash", "type": "str"}, - "certificate_type": {"key": "certificateType", "type": "str"}, } - def __init__( - self, - *, - certificate_key_vault_properties: Optional["_models.CertificateKeyVaultProperties"] = None, - password: Optional[str] = None, - value: Optional[bytes] = None, - certificate_type: Optional[Union[str, "_models.CertificateType"]] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, password: Optional[str] = None, value: Optional[bytes] = None, **kwargs: Any) -> None: """ - :keyword certificate_key_vault_properties: Properties for a certificate stored in a Key Vault. - :paramtype certificate_key_vault_properties: - ~azure.mgmt.appcontainers.models.CertificateKeyVaultProperties :keyword password: Certificate password. :paramtype password: str :keyword value: PFX or PEM blob. :paramtype value: bytes - :keyword certificate_type: The type of the certificate. Allowed values are - ``ServerSSLCertificate`` and ``ImagePullTrustedCA``. Known values are: "ServerSSLCertificate" - and "ImagePullTrustedCA". - :paramtype certificate_type: str or ~azure.mgmt.appcontainers.models.CertificateType """ super().__init__(**kwargs) self.provisioning_state = None - self.certificate_key_vault_properties = certificate_key_vault_properties self.password = password self.subject_name = None self.subject_alternative_names = None @@ -2043,7 +1481,6 @@ def __init__( self.thumbprint = None self.valid = None self.public_key_hash = None - self.certificate_type = certificate_type class CheckNameAvailabilityRequest(_serialization.Model): @@ -2113,51 +1550,6 @@ def __init__( self.message = message -class CircuitBreakerPolicy(_serialization.Model): - """Policy that defines circuit breaker conditions. - - :ivar consecutive_errors: Number of consecutive errors before the circuit breaker opens. - :vartype consecutive_errors: int - :ivar interval_in_seconds: The time interval, in seconds, between endpoint checks. This can - result in opening the circuit breaker if the check fails as well as closing the circuit breaker - if the check succeeds. Defaults to 10s. - :vartype interval_in_seconds: int - :ivar max_ejection_percent: Maximum percentage of hosts that will be ejected after failure - threshold has been met. - :vartype max_ejection_percent: int - """ - - _attribute_map = { - "consecutive_errors": {"key": "consecutiveErrors", "type": "int"}, - "interval_in_seconds": {"key": "intervalInSeconds", "type": "int"}, - "max_ejection_percent": {"key": "maxEjectionPercent", "type": "int"}, - } - - def __init__( - self, - *, - consecutive_errors: Optional[int] = None, - interval_in_seconds: Optional[int] = None, - max_ejection_percent: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword consecutive_errors: Number of consecutive errors before the circuit breaker opens. - :paramtype consecutive_errors: int - :keyword interval_in_seconds: The time interval, in seconds, between endpoint checks. This can - result in opening the circuit breaker if the check fails as well as closing the circuit breaker - if the check succeeds. Defaults to 10s. - :paramtype interval_in_seconds: int - :keyword max_ejection_percent: Maximum percentage of hosts that will be ejected after failure - threshold has been met. - :paramtype max_ejection_percent: int - """ - super().__init__(**kwargs) - self.consecutive_errors = consecutive_errors - self.interval_in_seconds = interval_in_seconds - self.max_ejection_percent = max_ejection_percent - - class ClientRegistration(_serialization.Model): """The configuration settings of the app registration for providers that have client ids and client secrets. @@ -3153,77 +2545,6 @@ def __init__(self, **kwargs: Any) -> None: self.key_vault_url = None -class ContainerRegistry(_serialization.Model): - """Model representing a mapping from a container registry to the identity used to connect to it. - - All required parameters must be populated in order to send to server. - - :ivar container_registry_server: Login server of the container registry. Required. - :vartype container_registry_server: str - :ivar identity_resource_id: Resource ID of the managed identity. Required. - :vartype identity_resource_id: str - """ - - _validation = { - "container_registry_server": {"required": True}, - "identity_resource_id": {"required": True}, - } - - _attribute_map = { - "container_registry_server": {"key": "containerRegistryServer", "type": "str"}, - "identity_resource_id": {"key": "identityResourceId", "type": "str"}, - } - - def __init__(self, *, container_registry_server: str, identity_resource_id: str, **kwargs: Any) -> None: - """ - :keyword container_registry_server: Login server of the container registry. Required. - :paramtype container_registry_server: str - :keyword identity_resource_id: Resource ID of the managed identity. Required. - :paramtype identity_resource_id: str - """ - super().__init__(**kwargs) - self.container_registry_server = container_registry_server - self.identity_resource_id = identity_resource_id - - -class ContainerRegistryWithCustomImage(_serialization.Model): - """Container registry that the final image will be uploaded to. - - All required parameters must be populated in order to send to server. - - :ivar server: Login server of the container registry that the final image should be uploaded - to. Builder resource needs to have this container registry defined along with an identity to - use to access it. Required. - :vartype server: str - :ivar image: Full name that the final image should be uploaded as, including both image name - and tag. - :vartype image: str - """ - - _validation = { - "server": {"required": True}, - } - - _attribute_map = { - "server": {"key": "server", "type": "str"}, - "image": {"key": "image", "type": "str"}, - } - - def __init__(self, *, server: str, image: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword server: Login server of the container registry that the final image should be uploaded - to. Builder resource needs to have this container registry defined along with an identity to - use to access it. Required. - :paramtype server: str - :keyword image: Full name that the final image should be uploaded as, including both image name - and tag. - :paramtype image: str - """ - super().__init__(**kwargs) - self.server = server - self.image = image - - class ContainerResources(_serialization.Model): """Container App container resource requirements. @@ -3421,9 +2742,6 @@ class CustomDomainConfiguration(_serialization.Model): :vartype custom_domain_verification_id: str :ivar dns_suffix: Dns suffix for the environment domain. :vartype dns_suffix: str - :ivar certificate_key_vault_properties: Certificate stored in Azure Key Vault. - :vartype certificate_key_vault_properties: - ~azure.mgmt.appcontainers.models.CertificateKeyVaultProperties :ivar certificate_value: PFX or PEM blob. :vartype certificate_value: bytes :ivar certificate_password: Certificate password. @@ -3446,10 +2764,6 @@ class CustomDomainConfiguration(_serialization.Model): _attribute_map = { "custom_domain_verification_id": {"key": "customDomainVerificationId", "type": "str"}, "dns_suffix": {"key": "dnsSuffix", "type": "str"}, - "certificate_key_vault_properties": { - "key": "certificateKeyVaultProperties", - "type": "CertificateKeyVaultProperties", - }, "certificate_value": {"key": "certificateValue", "type": "bytearray"}, "certificate_password": {"key": "certificatePassword", "type": "str"}, "expiration_date": {"key": "expirationDate", "type": "iso-8601"}, @@ -3461,7 +2775,6 @@ def __init__( self, *, dns_suffix: Optional[str] = None, - certificate_key_vault_properties: Optional["_models.CertificateKeyVaultProperties"] = None, certificate_value: Optional[bytes] = None, certificate_password: Optional[str] = None, **kwargs: Any @@ -3469,9 +2782,6 @@ def __init__( """ :keyword dns_suffix: Dns suffix for the environment domain. :paramtype dns_suffix: str - :keyword certificate_key_vault_properties: Certificate stored in Azure Key Vault. - :paramtype certificate_key_vault_properties: - ~azure.mgmt.appcontainers.models.CertificateKeyVaultProperties :keyword certificate_value: PFX or PEM blob. :paramtype certificate_value: bytes :keyword certificate_password: Certificate password. @@ -3480,7 +2790,6 @@ def __init__( super().__init__(**kwargs) self.custom_domain_verification_id = None self.dns_suffix = dns_suffix - self.certificate_key_vault_properties = certificate_key_vault_properties self.certificate_value = certificate_value self.certificate_password = certificate_password self.expiration_date = None @@ -3882,10 +3191,6 @@ class DaprComponent(ProxyResource): # pylint: disable=too-many-instance-attribu :vartype metadata: list[~azure.mgmt.appcontainers.models.DaprMetadata] :ivar scopes: Names of container apps that can use this Dapr component. :vartype scopes: list[str] - :ivar service_component_bind: List of container app services that are bound to the Dapr - component. - :vartype service_component_bind: - list[~azure.mgmt.appcontainers.models.DaprComponentServiceBinding] """ _validation = { @@ -3908,7 +3213,6 @@ class DaprComponent(ProxyResource): # pylint: disable=too-many-instance-attribu "secret_store_component": {"key": "properties.secretStoreComponent", "type": "str"}, "metadata": {"key": "properties.metadata", "type": "[DaprMetadata]"}, "scopes": {"key": "properties.scopes", "type": "[str]"}, - "service_component_bind": {"key": "properties.serviceComponentBind", "type": "[DaprComponentServiceBinding]"}, } def __init__( @@ -3922,7 +3226,6 @@ def __init__( secret_store_component: Optional[str] = None, metadata: Optional[List["_models.DaprMetadata"]] = None, scopes: Optional[List[str]] = None, - service_component_bind: Optional[List["_models.DaprComponentServiceBinding"]] = None, **kwargs: Any ) -> None: """ @@ -3942,10 +3245,6 @@ def __init__( :paramtype metadata: list[~azure.mgmt.appcontainers.models.DaprMetadata] :keyword scopes: Names of container apps that can use this Dapr component. :paramtype scopes: list[str] - :keyword service_component_bind: List of container app services that are bound to the Dapr - component. - :paramtype service_component_bind: - list[~azure.mgmt.appcontainers.models.DaprComponentServiceBinding] """ super().__init__(**kwargs) self.component_type = component_type @@ -3956,18 +3255,17 @@ def __init__( self.secret_store_component = secret_store_component self.metadata = metadata self.scopes = scopes - self.service_component_bind = service_component_bind -class DaprComponentResiliencyPoliciesCollection(_serialization.Model): # pylint: disable=name-too-long - """Dapr Component Resiliency Policies ARM resource. +class DaprComponentsCollection(_serialization.Model): + """Dapr Components ARM resource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy] + :vartype value: list[~azure.mgmt.appcontainers.models.DaprComponent] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -3978,353 +3276,31 @@ class DaprComponentResiliencyPoliciesCollection(_serialization.Model): # pylint } _attribute_map = { - "value": {"key": "value", "type": "[DaprComponentResiliencyPolicy]"}, + "value": {"key": "value", "type": "[DaprComponent]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: List["_models.DaprComponentResiliencyPolicy"], **kwargs: Any) -> None: + def __init__(self, *, value: List["_models.DaprComponent"], **kwargs: Any) -> None: """ :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy] + :paramtype value: list[~azure.mgmt.appcontainers.models.DaprComponent] """ super().__init__(**kwargs) self.value = value self.next_link = None -class DaprComponentResiliencyPolicy(ProxyResource): - """Dapr Component Resiliency Policy. +class DaprConfiguration(_serialization.Model): + """Configuration properties Dapr component. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.appcontainers.models.SystemData - :ivar inbound_policy: The optional inbound component resiliency policy configuration. - :vartype inbound_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyConfiguration - :ivar outbound_policy: The optional outbound component resiliency policy configuration. - :vartype outbound_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyConfiguration + :ivar version: The version of Dapr. + :vartype version: str """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "inbound_policy": {"key": "properties.inboundPolicy", "type": "DaprComponentResiliencyPolicyConfiguration"}, - "outbound_policy": {"key": "properties.outboundPolicy", "type": "DaprComponentResiliencyPolicyConfiguration"}, - } - - def __init__( - self, - *, - inbound_policy: Optional["_models.DaprComponentResiliencyPolicyConfiguration"] = None, - outbound_policy: Optional["_models.DaprComponentResiliencyPolicyConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword inbound_policy: The optional inbound component resiliency policy configuration. - :paramtype inbound_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyConfiguration - :keyword outbound_policy: The optional outbound component resiliency policy configuration. - :paramtype outbound_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyConfiguration - """ - super().__init__(**kwargs) - self.inbound_policy = inbound_policy - self.outbound_policy = outbound_policy - - -class DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration( - _serialization.Model -): # pylint: disable=name-too-long - """Dapr Component Resiliency Policy Circuit Breaker Policy Configuration. - - :ivar consecutive_errors: The number of consecutive errors before the circuit is opened. - :vartype consecutive_errors: int - :ivar timeout_in_seconds: The interval in seconds until a retry attempt is made after the - circuit is opened. - :vartype timeout_in_seconds: int - :ivar interval_in_seconds: The optional interval in seconds after which the error count resets - to 0. An interval of 0 will never reset. If not specified, the timeoutInSeconds value will be - used. - :vartype interval_in_seconds: int - """ - - _attribute_map = { - "consecutive_errors": {"key": "consecutiveErrors", "type": "int"}, - "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, - "interval_in_seconds": {"key": "intervalInSeconds", "type": "int"}, - } - - def __init__( - self, - *, - consecutive_errors: Optional[int] = None, - timeout_in_seconds: Optional[int] = None, - interval_in_seconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword consecutive_errors: The number of consecutive errors before the circuit is opened. - :paramtype consecutive_errors: int - :keyword timeout_in_seconds: The interval in seconds until a retry attempt is made after the - circuit is opened. - :paramtype timeout_in_seconds: int - :keyword interval_in_seconds: The optional interval in seconds after which the error count - resets to 0. An interval of 0 will never reset. If not specified, the timeoutInSeconds value - will be used. - :paramtype interval_in_seconds: int - """ - super().__init__(**kwargs) - self.consecutive_errors = consecutive_errors - self.timeout_in_seconds = timeout_in_seconds - self.interval_in_seconds = interval_in_seconds - - -class DaprComponentResiliencyPolicyConfiguration(_serialization.Model): # pylint: disable=name-too-long - """Dapr Component Resiliency Policy Configuration. - - :ivar http_retry_policy: The optional HTTP retry policy configuration. - :vartype http_retry_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration - :ivar timeout_policy: The optional timeout policy configuration. - :vartype timeout_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration - :ivar circuit_breaker_policy: The optional circuit breaker policy configuration. - :vartype circuit_breaker_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration - """ - - _attribute_map = { - "http_retry_policy": { - "key": "httpRetryPolicy", - "type": "DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration", - }, - "timeout_policy": {"key": "timeoutPolicy", "type": "DaprComponentResiliencyPolicyTimeoutPolicyConfiguration"}, - "circuit_breaker_policy": { - "key": "circuitBreakerPolicy", - "type": "DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration", - }, - } - - def __init__( - self, - *, - http_retry_policy: Optional["_models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration"] = None, - timeout_policy: Optional["_models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration"] = None, - circuit_breaker_policy: Optional[ - "_models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration" - ] = None, - **kwargs: Any - ) -> None: - """ - :keyword http_retry_policy: The optional HTTP retry policy configuration. - :paramtype http_retry_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration - :keyword timeout_policy: The optional timeout policy configuration. - :paramtype timeout_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration - :keyword circuit_breaker_policy: The optional circuit breaker policy configuration. - :paramtype circuit_breaker_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration - """ - super().__init__(**kwargs) - self.http_retry_policy = http_retry_policy - self.timeout_policy = timeout_policy - self.circuit_breaker_policy = circuit_breaker_policy - - -class DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration(_serialization.Model): # pylint: disable=name-too-long - """Dapr Component Resiliency Policy HTTP Retry Backoff Configuration. - - :ivar initial_delay_in_milliseconds: The optional initial delay in milliseconds before an - operation is retried. - :vartype initial_delay_in_milliseconds: int - :ivar max_interval_in_milliseconds: The optional maximum time interval in milliseconds between - retry attempts. - :vartype max_interval_in_milliseconds: int - """ - - _attribute_map = { - "initial_delay_in_milliseconds": {"key": "initialDelayInMilliseconds", "type": "int"}, - "max_interval_in_milliseconds": {"key": "maxIntervalInMilliseconds", "type": "int"}, - } - - def __init__( - self, - *, - initial_delay_in_milliseconds: Optional[int] = None, - max_interval_in_milliseconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword initial_delay_in_milliseconds: The optional initial delay in milliseconds before an - operation is retried. - :paramtype initial_delay_in_milliseconds: int - :keyword max_interval_in_milliseconds: The optional maximum time interval in milliseconds - between retry attempts. - :paramtype max_interval_in_milliseconds: int - """ - super().__init__(**kwargs) - self.initial_delay_in_milliseconds = initial_delay_in_milliseconds - self.max_interval_in_milliseconds = max_interval_in_milliseconds - - -class DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration(_serialization.Model): # pylint: disable=name-too-long - """Dapr Component Resiliency Policy HTTP Retry Policy Configuration. - - :ivar max_retries: The optional maximum number of retries. - :vartype max_retries: int - :ivar retry_back_off: The optional retry backoff configuration. - :vartype retry_back_off: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration - """ - - _attribute_map = { - "max_retries": {"key": "maxRetries", "type": "int"}, - "retry_back_off": {"key": "retryBackOff", "type": "DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration"}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = None, - retry_back_off: Optional["_models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword max_retries: The optional maximum number of retries. - :paramtype max_retries: int - :keyword retry_back_off: The optional retry backoff configuration. - :paramtype retry_back_off: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration - """ - super().__init__(**kwargs) - self.max_retries = max_retries - self.retry_back_off = retry_back_off - - -class DaprComponentResiliencyPolicyTimeoutPolicyConfiguration(_serialization.Model): # pylint: disable=name-too-long - """Dapr Component Resiliency Policy Timeout Policy Configuration. - - :ivar response_timeout_in_seconds: The optional response timeout in seconds. - :vartype response_timeout_in_seconds: int - """ - - _attribute_map = { - "response_timeout_in_seconds": {"key": "responseTimeoutInSeconds", "type": "int"}, - } - - def __init__(self, *, response_timeout_in_seconds: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword response_timeout_in_seconds: The optional response timeout in seconds. - :paramtype response_timeout_in_seconds: int - """ - super().__init__(**kwargs) - self.response_timeout_in_seconds = response_timeout_in_seconds - - -class DaprComponentsCollection(_serialization.Model): - """Dapr Components ARM resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.DaprComponent] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DaprComponent]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DaprComponent"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.DaprComponent] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class DaprComponentServiceBinding(_serialization.Model): - """Configuration to bind a Dapr Component to a dev ContainerApp Service. - - :ivar name: Name of the service bind. - :vartype name: str - :ivar service_id: Resource id of the target service. - :vartype service_id: str - :ivar metadata: Service bind metadata. - :vartype metadata: ~azure.mgmt.appcontainers.models.DaprServiceBindMetadata - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "service_id": {"key": "serviceId", "type": "str"}, - "metadata": {"key": "metadata", "type": "DaprServiceBindMetadata"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - service_id: Optional[str] = None, - metadata: Optional["_models.DaprServiceBindMetadata"] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the service bind. - :paramtype name: str - :keyword service_id: Resource id of the target service. - :paramtype service_id: str - :keyword metadata: Service bind metadata. - :paramtype metadata: ~azure.mgmt.appcontainers.models.DaprServiceBindMetadata - """ - super().__init__(**kwargs) - self.name = name - self.service_id = service_id - self.metadata = metadata - - -class DaprConfiguration(_serialization.Model): - """Configuration properties Dapr component. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar version: The version of Dapr. - :vartype version: str - """ - - _validation = { - "version": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { @@ -4432,289 +3408,6 @@ def __init__(self, *, value: List["_models.DaprSecret"], **kwargs: Any) -> None: self.value = value -class DaprServiceBindMetadata(_serialization.Model): - """Dapr component metadata. - - :ivar name: Service bind metadata property name. - :vartype name: str - :ivar value: Service bind metadata property value. - :vartype value: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: Service bind metadata property name. - :paramtype name: str - :keyword value: Service bind metadata property value. - :paramtype value: str - """ - super().__init__(**kwargs) - self.name = name - self.value = value - - -class DaprSubscription(ProxyResource): # pylint: disable=too-many-instance-attributes - """Dapr PubSub Event Subscription. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.appcontainers.models.SystemData - :ivar pubsub_name: Dapr PubSub component name. - :vartype pubsub_name: str - :ivar topic: Topic name. - :vartype topic: str - :ivar dead_letter_topic: Deadletter topic name. - :vartype dead_letter_topic: str - :ivar routes: Subscription routes. - :vartype routes: ~azure.mgmt.appcontainers.models.DaprSubscriptionRoutes - :ivar scopes: Application scopes to restrict the subscription to specific apps. - :vartype scopes: list[str] - :ivar metadata: Subscription metadata. - :vartype metadata: dict[str, str] - :ivar bulk_subscribe: Bulk subscription options. - :vartype bulk_subscribe: ~azure.mgmt.appcontainers.models.DaprSubscriptionBulkSubscribeOptions - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "pubsub_name": {"key": "properties.pubsubName", "type": "str"}, - "topic": {"key": "properties.topic", "type": "str"}, - "dead_letter_topic": {"key": "properties.deadLetterTopic", "type": "str"}, - "routes": {"key": "properties.routes", "type": "DaprSubscriptionRoutes"}, - "scopes": {"key": "properties.scopes", "type": "[str]"}, - "metadata": {"key": "properties.metadata", "type": "{str}"}, - "bulk_subscribe": {"key": "properties.bulkSubscribe", "type": "DaprSubscriptionBulkSubscribeOptions"}, - } - - def __init__( - self, - *, - pubsub_name: Optional[str] = None, - topic: Optional[str] = None, - dead_letter_topic: Optional[str] = None, - routes: Optional["_models.DaprSubscriptionRoutes"] = None, - scopes: Optional[List[str]] = None, - metadata: Optional[Dict[str, str]] = None, - bulk_subscribe: Optional["_models.DaprSubscriptionBulkSubscribeOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword pubsub_name: Dapr PubSub component name. - :paramtype pubsub_name: str - :keyword topic: Topic name. - :paramtype topic: str - :keyword dead_letter_topic: Deadletter topic name. - :paramtype dead_letter_topic: str - :keyword routes: Subscription routes. - :paramtype routes: ~azure.mgmt.appcontainers.models.DaprSubscriptionRoutes - :keyword scopes: Application scopes to restrict the subscription to specific apps. - :paramtype scopes: list[str] - :keyword metadata: Subscription metadata. - :paramtype metadata: dict[str, str] - :keyword bulk_subscribe: Bulk subscription options. - :paramtype bulk_subscribe: - ~azure.mgmt.appcontainers.models.DaprSubscriptionBulkSubscribeOptions - """ - super().__init__(**kwargs) - self.pubsub_name = pubsub_name - self.topic = topic - self.dead_letter_topic = dead_letter_topic - self.routes = routes - self.scopes = scopes - self.metadata = metadata - self.bulk_subscribe = bulk_subscribe - - -class DaprSubscriptionBulkSubscribeOptions(_serialization.Model): - """Dapr PubSub Bulk Subscription Options. - - :ivar enabled: Enable bulk subscription. - :vartype enabled: bool - :ivar max_messages_count: Maximum number of messages to deliver in a bulk message. - :vartype max_messages_count: int - :ivar max_await_duration_ms: Maximum duration in milliseconds to wait before a bulk message is - sent to the app. - :vartype max_await_duration_ms: int - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "max_messages_count": {"key": "maxMessagesCount", "type": "int"}, - "max_await_duration_ms": {"key": "maxAwaitDurationMs", "type": "int"}, - } - - def __init__( - self, - *, - enabled: bool = False, - max_messages_count: Optional[int] = None, - max_await_duration_ms: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Enable bulk subscription. - :paramtype enabled: bool - :keyword max_messages_count: Maximum number of messages to deliver in a bulk message. - :paramtype max_messages_count: int - :keyword max_await_duration_ms: Maximum duration in milliseconds to wait before a bulk message - is sent to the app. - :paramtype max_await_duration_ms: int - """ - super().__init__(**kwargs) - self.enabled = enabled - self.max_messages_count = max_messages_count - self.max_await_duration_ms = max_await_duration_ms - - -class DaprSubscriptionRouteRule(_serialization.Model): - """Dapr Pubsub Event Subscription Route Rule is used to specify the condition for sending a - message to a specific path. - - :ivar match: The optional CEL expression used to match the event. If the match is not - specified, then the route is considered the default. The rules are tested in the order - specified, so they should be define from most-to-least specific. The default route should - appear last in the list. - :vartype match: str - :ivar path: The path for events that match this rule. - :vartype path: str - """ - - _attribute_map = { - "match": {"key": "match", "type": "str"}, - "path": {"key": "path", "type": "str"}, - } - - def __init__(self, *, match: Optional[str] = None, path: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword match: The optional CEL expression used to match the event. If the match is not - specified, then the route is considered the default. The rules are tested in the order - specified, so they should be define from most-to-least specific. The default route should - appear last in the list. - :paramtype match: str - :keyword path: The path for events that match this rule. - :paramtype path: str - """ - super().__init__(**kwargs) - self.match = match - self.path = path - - -class DaprSubscriptionRoutes(_serialization.Model): - """Dapr PubSub Event Subscription Routes configuration. - - :ivar rules: The list of Dapr PubSub Event Subscription Route Rules. - :vartype rules: list[~azure.mgmt.appcontainers.models.DaprSubscriptionRouteRule] - :ivar default: The default path to deliver events that do not match any of the rules. - :vartype default: str - """ - - _attribute_map = { - "rules": {"key": "rules", "type": "[DaprSubscriptionRouteRule]"}, - "default": {"key": "default", "type": "str"}, - } - - def __init__( - self, - *, - rules: Optional[List["_models.DaprSubscriptionRouteRule"]] = None, - default: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword rules: The list of Dapr PubSub Event Subscription Route Rules. - :paramtype rules: list[~azure.mgmt.appcontainers.models.DaprSubscriptionRouteRule] - :keyword default: The default path to deliver events that do not match any of the rules. - :paramtype default: str - """ - super().__init__(**kwargs) - self.rules = rules - self.default = default - - -class DaprSubscriptionsCollection(_serialization.Model): - """Dapr Subscriptions ARM resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.DaprSubscription] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DaprSubscription]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DaprSubscription"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.DaprSubscription] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class DataDogConfiguration(_serialization.Model): - """Configuration of datadog. - - :ivar site: The data dog site. - :vartype site: str - :ivar key: The data dog api key. - :vartype key: str - """ - - _attribute_map = { - "site": {"key": "site", "type": "str"}, - "key": {"key": "key", "type": "str"}, - } - - def __init__(self, *, site: Optional[str] = None, key: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword site: The data dog site. - :paramtype site: str - :keyword key: The data dog api key. - :paramtype key: str - """ - super().__init__(**kwargs) - self.site = site - self.key = key - - class DefaultAuthorizationPolicy(_serialization.Model): """The configuration settings of the Azure Active Directory default authorization policy. @@ -4854,38 +3547,6 @@ def __init__(self, **kwargs: Any) -> None: self.target = None -class DestinationsConfiguration(_serialization.Model): - """Configuration of Open Telemetry destinations. - - :ivar data_dog_configuration: Open telemetry datadog destination configuration. - :vartype data_dog_configuration: ~azure.mgmt.appcontainers.models.DataDogConfiguration - :ivar otlp_configurations: Open telemetry otlp configurations. - :vartype otlp_configurations: list[~azure.mgmt.appcontainers.models.OtlpConfiguration] - """ - - _attribute_map = { - "data_dog_configuration": {"key": "dataDogConfiguration", "type": "DataDogConfiguration"}, - "otlp_configurations": {"key": "otlpConfigurations", "type": "[OtlpConfiguration]"}, - } - - def __init__( - self, - *, - data_dog_configuration: Optional["_models.DataDogConfiguration"] = None, - otlp_configurations: Optional[List["_models.OtlpConfiguration"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword data_dog_configuration: Open telemetry datadog destination configuration. - :paramtype data_dog_configuration: ~azure.mgmt.appcontainers.models.DataDogConfiguration - :keyword otlp_configurations: Open telemetry otlp configurations. - :paramtype otlp_configurations: list[~azure.mgmt.appcontainers.models.OtlpConfiguration] - """ - super().__init__(**kwargs) - self.data_dog_configuration = data_dog_configuration - self.otlp_configurations = otlp_configurations - - class DiagnosticDataProviderMetadata(_serialization.Model): """Details of a diagnostics data provider. @@ -5328,188 +3989,29 @@ def __init__(self, *, message: Optional[str] = None, status_id: Optional[int] = class DiagnosticSupportTopic(_serialization.Model): """Support topic information. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Unique topic identifier. - :vartype id: str - :ivar pes_id: PES identifier. - :vartype pes_id: str - """ - - _validation = { - "id": {"readonly": True}, - "pes_id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "pes_id": {"key": "pesId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.pes_id = None - - -class DotNetComponent(ProxyResource): - """.NET Component. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.appcontainers.models.SystemData - :ivar component_type: Type of the .NET Component. Known values are: "AspireDashboard" and - "AspireResourceServerApi". - :vartype component_type: str or ~azure.mgmt.appcontainers.models.DotNetComponentType - :ivar provisioning_state: Provisioning state of the .NET Component. Known values are: - "Succeeded", "Failed", "Canceled", "Deleting", and "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.DotNetComponentProvisioningState - :ivar configurations: List of .NET Components configuration properties. - :vartype configurations: - list[~azure.mgmt.appcontainers.models.DotNetComponentConfigurationProperty] - :ivar service_binds: List of .NET Components that are bound to the .NET component. - :vartype service_binds: list[~azure.mgmt.appcontainers.models.DotNetComponentServiceBind] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "component_type": {"key": "properties.componentType", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "configurations": {"key": "properties.configurations", "type": "[DotNetComponentConfigurationProperty]"}, - "service_binds": {"key": "properties.serviceBinds", "type": "[DotNetComponentServiceBind]"}, - } - - def __init__( - self, - *, - component_type: Optional[Union[str, "_models.DotNetComponentType"]] = None, - configurations: Optional[List["_models.DotNetComponentConfigurationProperty"]] = None, - service_binds: Optional[List["_models.DotNetComponentServiceBind"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword component_type: Type of the .NET Component. Known values are: "AspireDashboard" and - "AspireResourceServerApi". - :paramtype component_type: str or ~azure.mgmt.appcontainers.models.DotNetComponentType - :keyword configurations: List of .NET Components configuration properties. - :paramtype configurations: - list[~azure.mgmt.appcontainers.models.DotNetComponentConfigurationProperty] - :keyword service_binds: List of .NET Components that are bound to the .NET component. - :paramtype service_binds: list[~azure.mgmt.appcontainers.models.DotNetComponentServiceBind] - """ - super().__init__(**kwargs) - self.component_type = component_type - self.provisioning_state = None - self.configurations = configurations - self.service_binds = service_binds - - -class DotNetComponentConfigurationProperty(_serialization.Model): - """Configuration properties for a .NET Component. - - :ivar property_name: The name of the property. - :vartype property_name: str - :ivar value: The value of the property. - :vartype value: str - """ - - _attribute_map = { - "property_name": {"key": "propertyName", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, property_name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword property_name: The name of the property. - :paramtype property_name: str - :keyword value: The value of the property. - :paramtype value: str - """ - super().__init__(**kwargs) - self.property_name = property_name - self.value = value - - -class DotNetComponentsCollection(_serialization.Model): - """.NET Components ARM resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.DotNetComponent] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DotNetComponent]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DotNetComponent"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.DotNetComponent] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class DotNetComponentServiceBind(_serialization.Model): - """Configuration to bind a .NET Component to another .NET Component. - - :ivar name: Name of the service bind. - :vartype name: str - :ivar service_id: Resource id of the target service. - :vartype service_id: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Unique topic identifier. + :vartype id: str + :ivar pes_id: PES identifier. + :vartype pes_id: str """ + _validation = { + "id": {"readonly": True}, + "pes_id": {"readonly": True}, + } + _attribute_map = { - "name": {"key": "name", "type": "str"}, - "service_id": {"key": "serviceId", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "pes_id": {"key": "pesId", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, service_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: Name of the service bind. - :paramtype name: str - :keyword service_id: Resource id of the target service. - :paramtype service_id: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.name = name - self.service_id = service_id + self.id = None + self.pes_id = None class EncryptionSettings(_serialization.Model): @@ -5651,39 +4153,6 @@ def __init__( self.secret_ref = secret_ref -class EnvironmentVariable(_serialization.Model): - """Model representing an environment variable. - - All required parameters must be populated in order to send to server. - - :ivar name: Environment variable name. Required. - :vartype name: str - :ivar value: Environment variable value. Required. - :vartype value: str - """ - - _validation = { - "name": {"required": True}, - "value": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, name: str, value: str, **kwargs: Any) -> None: - """ - :keyword name: Environment variable name. Required. - :paramtype name: str - :keyword value: Environment variable value. Required. - :paramtype value: str - """ - super().__init__(**kwargs) - self.name = name - self.value = value - - class ErrorAdditionalInfo(_serialization.Model): """The resource management error additional info. @@ -5962,9 +4431,6 @@ class GithubActionConfiguration(_serialization.Model): :vartype runtime_stack: str :ivar runtime_version: Runtime version. :vartype runtime_version: str - :ivar build_environment_variables: List of environment variables to be passed to the build. - :vartype build_environment_variables: - list[~azure.mgmt.appcontainers.models.EnvironmentVariable] """ _attribute_map = { @@ -5977,7 +4443,6 @@ class GithubActionConfiguration(_serialization.Model): "os": {"key": "os", "type": "str"}, "runtime_stack": {"key": "runtimeStack", "type": "str"}, "runtime_version": {"key": "runtimeVersion", "type": "str"}, - "build_environment_variables": {"key": "buildEnvironmentVariables", "type": "[EnvironmentVariable]"}, } def __init__( @@ -5992,7 +4457,6 @@ def __init__( os: Optional[str] = None, runtime_stack: Optional[str] = None, runtime_version: Optional[str] = None, - build_environment_variables: Optional[List["_models.EnvironmentVariable"]] = None, **kwargs: Any ) -> None: """ @@ -6014,9 +4478,6 @@ def __init__( :paramtype runtime_stack: str :keyword runtime_version: Runtime version. :paramtype runtime_version: str - :keyword build_environment_variables: List of environment variables to be passed to the build. - :paramtype build_environment_variables: - list[~azure.mgmt.appcontainers.models.EnvironmentVariable] """ super().__init__(**kwargs) self.registry_info = registry_info @@ -6028,7 +4489,6 @@ def __init__( self.os = os self.runtime_stack = runtime_stack self.runtime_version = runtime_version - self.build_environment_variables = build_environment_variables class GlobalValidation(_serialization.Model): @@ -6138,218 +4598,6 @@ def __init__( self.validation = validation -class Header(_serialization.Model): - """Header of otlp configuration. - - :ivar key: The key of otlp configuration header. - :vartype key: str - :ivar value: The value of otlp configuration header. - :vartype value: str - """ - - _attribute_map = { - "key": {"key": "key", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, key: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword key: The key of otlp configuration header. - :paramtype key: str - :keyword value: The value of otlp configuration header. - :paramtype value: str - """ - super().__init__(**kwargs) - self.key = key - self.value = value - - -class HeaderMatch(_serialization.Model): - """Conditions required to match a header. - - :ivar header: Name of the header. - :vartype header: str - :ivar exact_match: Exact value of the header. - :vartype exact_match: str - :ivar prefix_match: Prefix value of the header. - :vartype prefix_match: str - :ivar suffix_match: Suffix value of the header. - :vartype suffix_match: str - :ivar regex_match: Regex value of the header. - :vartype regex_match: str - """ - - _attribute_map = { - "header": {"key": "header", "type": "str"}, - "exact_match": {"key": "match.exactMatch", "type": "str"}, - "prefix_match": {"key": "match.prefixMatch", "type": "str"}, - "suffix_match": {"key": "match.suffixMatch", "type": "str"}, - "regex_match": {"key": "match.regexMatch", "type": "str"}, - } - - def __init__( - self, - *, - header: Optional[str] = None, - exact_match: Optional[str] = None, - prefix_match: Optional[str] = None, - suffix_match: Optional[str] = None, - regex_match: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword header: Name of the header. - :paramtype header: str - :keyword exact_match: Exact value of the header. - :paramtype exact_match: str - :keyword prefix_match: Prefix value of the header. - :paramtype prefix_match: str - :keyword suffix_match: Suffix value of the header. - :paramtype suffix_match: str - :keyword regex_match: Regex value of the header. - :paramtype regex_match: str - """ - super().__init__(**kwargs) - self.header = header - self.exact_match = exact_match - self.prefix_match = prefix_match - self.suffix_match = suffix_match - self.regex_match = regex_match - - -class HttpConnectionPool(_serialization.Model): - """Defines parameters for http connection pooling. - - :ivar http1_max_pending_requests: Maximum number of pending http1 requests allowed. - :vartype http1_max_pending_requests: int - :ivar http2_max_requests: Maximum number of http2 requests allowed. - :vartype http2_max_requests: int - """ - - _attribute_map = { - "http1_max_pending_requests": {"key": "http1MaxPendingRequests", "type": "int"}, - "http2_max_requests": {"key": "http2MaxRequests", "type": "int"}, - } - - def __init__( - self, - *, - http1_max_pending_requests: Optional[int] = None, - http2_max_requests: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword http1_max_pending_requests: Maximum number of pending http1 requests allowed. - :paramtype http1_max_pending_requests: int - :keyword http2_max_requests: Maximum number of http2 requests allowed. - :paramtype http2_max_requests: int - """ - super().__init__(**kwargs) - self.http1_max_pending_requests = http1_max_pending_requests - self.http2_max_requests = http2_max_requests - - -class HttpGet(_serialization.Model): - """Model representing a http get request. - - All required parameters must be populated in order to send to server. - - :ivar url: URL to make HTTP GET request against. Required. - :vartype url: str - :ivar file_name: Name of the file that the request should be saved to. - :vartype file_name: str - :ivar headers: List of headers to send with the request. - :vartype headers: list[str] - """ - - _validation = { - "url": {"required": True}, - } - - _attribute_map = { - "url": {"key": "url", "type": "str"}, - "file_name": {"key": "fileName", "type": "str"}, - "headers": {"key": "headers", "type": "[str]"}, - } - - def __init__( - self, *, url: str, file_name: Optional[str] = None, headers: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword url: URL to make HTTP GET request against. Required. - :paramtype url: str - :keyword file_name: Name of the file that the request should be saved to. - :paramtype file_name: str - :keyword headers: List of headers to send with the request. - :paramtype headers: list[str] - """ - super().__init__(**kwargs) - self.url = url - self.file_name = file_name - self.headers = headers - - -class HttpRetryPolicy(_serialization.Model): - """Policy that defines http request retry conditions. - - :ivar max_retries: Maximum number of times a request will retry. - :vartype max_retries: int - :ivar headers: Headers that must be present for a request to be retried. - :vartype headers: list[~azure.mgmt.appcontainers.models.HeaderMatch] - :ivar http_status_codes: Additional http status codes that can trigger a retry. - :vartype http_status_codes: list[int] - :ivar errors: Errors that can trigger a retry. - :vartype errors: list[str] - :ivar initial_delay_in_milliseconds: Initial delay, in milliseconds, before retrying a request. - :vartype initial_delay_in_milliseconds: int - :ivar max_interval_in_milliseconds: Maximum interval, in milliseconds, between retries. - :vartype max_interval_in_milliseconds: int - """ - - _attribute_map = { - "max_retries": {"key": "maxRetries", "type": "int"}, - "headers": {"key": "matches.headers", "type": "[HeaderMatch]"}, - "http_status_codes": {"key": "matches.httpStatusCodes", "type": "[int]"}, - "errors": {"key": "matches.errors", "type": "[str]"}, - "initial_delay_in_milliseconds": {"key": "retryBackOff.initialDelayInMilliseconds", "type": "int"}, - "max_interval_in_milliseconds": {"key": "retryBackOff.maxIntervalInMilliseconds", "type": "int"}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = None, - headers: Optional[List["_models.HeaderMatch"]] = None, - http_status_codes: Optional[List[int]] = None, - errors: Optional[List[str]] = None, - initial_delay_in_milliseconds: Optional[int] = None, - max_interval_in_milliseconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword max_retries: Maximum number of times a request will retry. - :paramtype max_retries: int - :keyword headers: Headers that must be present for a request to be retried. - :paramtype headers: list[~azure.mgmt.appcontainers.models.HeaderMatch] - :keyword http_status_codes: Additional http status codes that can trigger a retry. - :paramtype http_status_codes: list[int] - :keyword errors: Errors that can trigger a retry. - :paramtype errors: list[str] - :keyword initial_delay_in_milliseconds: Initial delay, in milliseconds, before retrying a - request. - :paramtype initial_delay_in_milliseconds: int - :keyword max_interval_in_milliseconds: Maximum interval, in milliseconds, between retries. - :paramtype max_interval_in_milliseconds: int - """ - super().__init__(**kwargs) - self.max_retries = max_retries - self.headers = headers - self.http_status_codes = http_status_codes - self.errors = errors - self.initial_delay_in_milliseconds = initial_delay_in_milliseconds - self.max_interval_in_milliseconds = max_interval_in_milliseconds - - class HttpScaleRule(_serialization.Model): """Container App container Http scaling rule. @@ -6570,10 +4818,6 @@ class Ingress(_serialization.Model): # pylint: disable=too-many-instance-attrib :vartype cors_policy: ~azure.mgmt.appcontainers.models.CorsPolicy :ivar additional_port_mappings: Settings to expose additional ports on container app. :vartype additional_port_mappings: list[~azure.mgmt.appcontainers.models.IngressPortMapping] - :ivar target_port_http_scheme: Whether an http app listens on http or https. Known values are: - "http" and "https". - :vartype target_port_http_scheme: str or - ~azure.mgmt.appcontainers.models.IngressTargetPortHttpScheme """ _validation = { @@ -6594,7 +4838,6 @@ class Ingress(_serialization.Model): # pylint: disable=too-many-instance-attrib "client_certificate_mode": {"key": "clientCertificateMode", "type": "str"}, "cors_policy": {"key": "corsPolicy", "type": "CorsPolicy"}, "additional_port_mappings": {"key": "additionalPortMappings", "type": "[IngressPortMapping]"}, - "target_port_http_scheme": {"key": "targetPortHttpScheme", "type": "str"}, } def __init__( @@ -6612,7 +4855,6 @@ def __init__( client_certificate_mode: Optional[Union[str, "_models.IngressClientCertificateMode"]] = None, cors_policy: Optional["_models.CorsPolicy"] = None, additional_port_mappings: Optional[List["_models.IngressPortMapping"]] = None, - target_port_http_scheme: Optional[Union[str, "_models.IngressTargetPortHttpScheme"]] = None, **kwargs: Any ) -> None: """ @@ -6647,10 +4889,6 @@ def __init__( :paramtype cors_policy: ~azure.mgmt.appcontainers.models.CorsPolicy :keyword additional_port_mappings: Settings to expose additional ports on container app. :paramtype additional_port_mappings: list[~azure.mgmt.appcontainers.models.IngressPortMapping] - :keyword target_port_http_scheme: Whether an http app listens on http or https. Known values - are: "http" and "https". - :paramtype target_port_http_scheme: str or - ~azure.mgmt.appcontainers.models.IngressTargetPortHttpScheme """ super().__init__(**kwargs) self.fqdn = None @@ -6666,7 +4904,6 @@ def __init__( self.client_certificate_mode = client_certificate_mode self.cors_policy = cors_policy self.additional_port_mappings = additional_port_mappings - self.target_port_http_scheme = target_port_http_scheme class IngressPortMapping(_serialization.Model): @@ -6788,185 +5025,26 @@ def __init__( name: str, ip_address_range: str, action: Union[str, "_models.Action"], - description: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name for the IP restriction rule. Required. - :paramtype name: str - :keyword description: Describe the IP restriction rule that is being sent to the container-app. - This is an optional field. - :paramtype description: str - :keyword ip_address_range: CIDR notation to match incoming IP address. Required. - :paramtype ip_address_range: str - :keyword action: Allow or Deny rules to determine for incoming IP. Note: Rules can only consist - of ALL Allow or ALL Deny. Required. Known values are: "Allow" and "Deny". - :paramtype action: str or ~azure.mgmt.appcontainers.models.Action - """ - super().__init__(**kwargs) - self.name = name - self.description = description - self.ip_address_range = ip_address_range - self.action = action - - -class JavaComponent(ProxyResource): - """Java Component. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long - :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.appcontainers.models.SystemData - :ivar component_type: Type of the Java Component. Known values are: "SpringBootAdmin", - "SpringCloudEureka", and "SpringCloudConfig". - :vartype component_type: str or ~azure.mgmt.appcontainers.models.JavaComponentType - :ivar provisioning_state: Provisioning state of the Java Component. Known values are: - "Succeeded", "Failed", "Canceled", "Deleting", and "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.JavaComponentProvisioningState - :ivar configurations: List of Java Components configuration properties. - :vartype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :ivar service_binds: List of Java Components that are bound to the Java component. - :vartype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "component_type": {"key": "properties.componentType", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "configurations": {"key": "properties.configurations", "type": "[JavaComponentConfigurationProperty]"}, - "service_binds": {"key": "properties.serviceBinds", "type": "[JavaComponentServiceBind]"}, - } - - def __init__( - self, - *, - component_type: Optional[Union[str, "_models.JavaComponentType"]] = None, - configurations: Optional[List["_models.JavaComponentConfigurationProperty"]] = None, - service_binds: Optional[List["_models.JavaComponentServiceBind"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword component_type: Type of the Java Component. Known values are: "SpringBootAdmin", - "SpringCloudEureka", and "SpringCloudConfig". - :paramtype component_type: str or ~azure.mgmt.appcontainers.models.JavaComponentType - :keyword configurations: List of Java Components configuration properties. - :paramtype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :keyword service_binds: List of Java Components that are bound to the Java component. - :paramtype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - """ - super().__init__(**kwargs) - self.component_type = component_type - self.provisioning_state = None - self.configurations = configurations - self.service_binds = service_binds - - -class JavaComponentConfigurationProperty(_serialization.Model): - """Configuration properties for a Java Component. - - :ivar property_name: The name of the property. - :vartype property_name: str - :ivar value: The value of the property. - :vartype value: str - """ - - _attribute_map = { - "property_name": {"key": "propertyName", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, property_name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword property_name: The name of the property. - :paramtype property_name: str - :keyword value: The value of the property. - :paramtype value: str - """ - super().__init__(**kwargs) - self.property_name = property_name - self.value = value - - -class JavaComponentsCollection(_serialization.Model): - """Java Components ARM resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.JavaComponent] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[JavaComponent]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.JavaComponent"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.JavaComponent] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class JavaComponentServiceBind(_serialization.Model): - """Configuration to bind a Java Component to another Java Component. - - :ivar name: Name of the service bind. - :vartype name: str - :ivar service_id: Resource id of the target service. - :vartype service_id: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "service_id": {"key": "serviceId", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, service_id: Optional[str] = None, **kwargs: Any) -> None: + description: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword name: Name of the service bind. + :keyword name: Name for the IP restriction rule. Required. :paramtype name: str - :keyword service_id: Resource id of the target service. - :paramtype service_id: str + :keyword description: Describe the IP restriction rule that is being sent to the container-app. + This is an optional field. + :paramtype description: str + :keyword ip_address_range: CIDR notation to match incoming IP address. Required. + :paramtype ip_address_range: str + :keyword action: Allow or Deny rules to determine for incoming IP. Note: Rules can only consist + of ALL Allow or ALL Deny. Required. Known values are: "Allow" and "Deny". + :paramtype action: str or ~azure.mgmt.appcontainers.models.Action """ super().__init__(**kwargs) self.name = name - self.service_id = service_id + self.description = description + self.ip_address_range = ip_address_range + self.action = action class Job(TrackedResource): # pylint: disable=too-many-instance-attributes @@ -6991,8 +5069,6 @@ class Job(TrackedResource): # pylint: disable=too-many-instance-attributes :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar extended_location: The complex type of the extended location. - :vartype extended_location: ~azure.mgmt.appcontainers.models.ExtendedLocation :ivar identity: Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code. :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity @@ -7031,7 +5107,6 @@ class Job(TrackedResource): # pylint: disable=too-many-instance-attributes "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "environment_id": {"key": "properties.environmentId", "type": "str"}, @@ -7047,7 +5122,6 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - extended_location: Optional["_models.ExtendedLocation"] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, environment_id: Optional[str] = None, workload_profile_name: Optional[str] = None, @@ -7060,8 +5134,6 @@ def __init__( :paramtype tags: dict[str, str] :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword extended_location: The complex type of the extended location. - :paramtype extended_location: ~azure.mgmt.appcontainers.models.ExtendedLocation :keyword identity: Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code. :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity @@ -7075,7 +5147,6 @@ def __init__( :paramtype template: ~azure.mgmt.appcontainers.models.JobTemplate """ super().__init__(tags=tags, location=location, **kwargs) - self.extended_location = extended_location self.identity = identity self.provisioning_state = None self.environment_id = environment_id @@ -7527,8 +5598,6 @@ def __init__( class JobPatchProperties(_serialization.Model): """Container Apps Job resource specific properties. - :ivar extended_location: The complex type of the extended location. - :vartype extended_location: ~azure.mgmt.appcontainers.models.ExtendedLocation :ivar identity: Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code. :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity @@ -7539,7 +5608,6 @@ class JobPatchProperties(_serialization.Model): """ _attribute_map = { - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "tags": {"key": "tags", "type": "{str}"}, "properties": {"key": "properties", "type": "JobPatchPropertiesProperties"}, @@ -7548,15 +5616,12 @@ class JobPatchProperties(_serialization.Model): def __init__( self, *, - extended_location: Optional["_models.ExtendedLocation"] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.JobPatchPropertiesProperties"] = None, **kwargs: Any ) -> None: """ - :keyword extended_location: The complex type of the extended location. - :paramtype extended_location: ~azure.mgmt.appcontainers.models.ExtendedLocation :keyword identity: Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code. :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity @@ -7566,7 +5631,6 @@ def __init__( :paramtype properties: ~azure.mgmt.appcontainers.models.JobPatchPropertiesProperties """ super().__init__(**kwargs) - self.extended_location = extended_location self.identity = identity self.tags = tags self.properties = properties @@ -7915,38 +5979,23 @@ class LogAnalyticsConfiguration(_serialization.Model): :vartype customer_id: str :ivar shared_key: Log analytics customer key. :vartype shared_key: str - :ivar dynamic_json_columns: Boolean indicating whether to parse json string log into dynamic - json columns. - :vartype dynamic_json_columns: bool """ _attribute_map = { "customer_id": {"key": "customerId", "type": "str"}, "shared_key": {"key": "sharedKey", "type": "str"}, - "dynamic_json_columns": {"key": "dynamicJsonColumns", "type": "bool"}, } - def __init__( - self, - *, - customer_id: Optional[str] = None, - shared_key: Optional[str] = None, - dynamic_json_columns: Optional[bool] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, customer_id: Optional[str] = None, shared_key: Optional[str] = None, **kwargs: Any) -> None: """ :keyword customer_id: Log analytics customer id. :paramtype customer_id: str :keyword shared_key: Log analytics customer key. :paramtype shared_key: str - :keyword dynamic_json_columns: Boolean indicating whether to parse json string log into dynamic - json columns. - :paramtype dynamic_json_columns: bool """ super().__init__(**kwargs) self.customer_id = customer_id self.shared_key = shared_key - self.dynamic_json_columns = dynamic_json_columns class Login(_serialization.Model): @@ -8058,26 +6107,6 @@ def __init__(self, *, scopes: Optional[List[str]] = None, **kwargs: Any) -> None self.scopes = scopes -class LogsConfiguration(_serialization.Model): - """Configuration of Open Telemetry logs. - - :ivar destinations: Open telemetry logs destinations. - :vartype destinations: list[str] - """ - - _attribute_map = { - "destinations": {"key": "destinations", "type": "[str]"}, - } - - def __init__(self, *, destinations: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword destinations: Open telemetry logs destinations. - :paramtype destinations: list[str] - """ - super().__init__(**kwargs) - self.destinations = destinations - - class ManagedCertificate(TrackedResource): """Managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. @@ -8279,9 +6308,6 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- :vartype location: str :ivar kind: Kind of the Environment. :vartype kind: str - :ivar identity: Managed identities for the Managed Environment to interact with other Azure - services without maintaining any secrets or credentials in code. - :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity :ivar provisioning_state: Provisioning state of the Environment. Known values are: "Succeeded", "Failed", "Canceled", "Waiting", "InitializationInProgress", "InfrastructureSetupInProgress", "InfrastructureSetupComplete", "ScheduledForDelete", "UpgradeRequested", and "UpgradeFailed". @@ -8305,11 +6331,6 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- app logs to a destination. Currently only "log-analytics" is supported. :vartype app_logs_configuration: ~azure.mgmt.appcontainers.models.AppLogsConfiguration - :ivar app_insights_configuration: Environment level Application Insights configuration. - :vartype app_insights_configuration: ~azure.mgmt.appcontainers.models.AppInsightsConfiguration - :ivar open_telemetry_configuration: Environment Open Telemetry configuration. - :vartype open_telemetry_configuration: - ~azure.mgmt.appcontainers.models.OpenTelemetryConfiguration :ivar zone_redundant: Whether or not this Managed Environment is zone-redundant. :vartype zone_redundant: bool :ivar custom_domain_configuration: Custom domain configuration for the environment. @@ -8330,6 +6351,9 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- :ivar peer_authentication: Peer authentication settings for the Managed Environment. :vartype peer_authentication: ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication + :ivar peer_traffic_configuration: Peer traffic settings for the Managed Environment. + :vartype peer_traffic_configuration: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration """ _validation = { @@ -8353,7 +6377,6 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, "kind": {"key": "kind", "type": "str"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "dapr_ai_instrumentation_key": {"key": "properties.daprAIInstrumentationKey", "type": "str"}, "dapr_ai_connection_string": {"key": "properties.daprAIConnectionString", "type": "str"}, @@ -8362,14 +6385,6 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- "default_domain": {"key": "properties.defaultDomain", "type": "str"}, "static_ip": {"key": "properties.staticIp", "type": "str"}, "app_logs_configuration": {"key": "properties.appLogsConfiguration", "type": "AppLogsConfiguration"}, - "app_insights_configuration": { - "key": "properties.appInsightsConfiguration", - "type": "AppInsightsConfiguration", - }, - "open_telemetry_configuration": { - "key": "properties.openTelemetryConfiguration", - "type": "OpenTelemetryConfiguration", - }, "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, "custom_domain_configuration": { "key": "properties.customDomainConfiguration", @@ -8384,6 +6399,10 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- "key": "properties.peerAuthentication", "type": "ManagedEnvironmentPropertiesPeerAuthentication", }, + "peer_traffic_configuration": { + "key": "properties.peerTrafficConfiguration", + "type": "ManagedEnvironmentPropertiesPeerTrafficConfiguration", + }, } def __init__( # pylint: disable=too-many-locals @@ -8392,13 +6411,10 @@ def __init__( # pylint: disable=too-many-locals location: str, tags: Optional[Dict[str, str]] = None, kind: Optional[str] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, dapr_ai_instrumentation_key: Optional[str] = None, dapr_ai_connection_string: Optional[str] = None, vnet_configuration: Optional["_models.VnetConfiguration"] = None, app_logs_configuration: Optional["_models.AppLogsConfiguration"] = None, - app_insights_configuration: Optional["_models.AppInsightsConfiguration"] = None, - open_telemetry_configuration: Optional["_models.OpenTelemetryConfiguration"] = None, zone_redundant: Optional[bool] = None, custom_domain_configuration: Optional["_models.CustomDomainConfiguration"] = None, workload_profiles: Optional[List["_models.WorkloadProfile"]] = None, @@ -8406,6 +6422,7 @@ def __init__( # pylint: disable=too-many-locals dapr_configuration: Optional["_models.DaprConfiguration"] = None, infrastructure_resource_group: Optional[str] = None, peer_authentication: Optional["_models.ManagedEnvironmentPropertiesPeerAuthentication"] = None, + peer_traffic_configuration: Optional["_models.ManagedEnvironmentPropertiesPeerTrafficConfiguration"] = None, **kwargs: Any ) -> None: """ @@ -8415,9 +6432,6 @@ def __init__( # pylint: disable=too-many-locals :paramtype location: str :keyword kind: Kind of the Environment. :paramtype kind: str - :keyword identity: Managed identities for the Managed Environment to interact with other Azure - services without maintaining any secrets or credentials in code. - :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity :keyword dapr_ai_instrumentation_key: Azure Monitor instrumentation key used by Dapr to export Service to Service communication telemetry. :paramtype dapr_ai_instrumentation_key: str @@ -8430,12 +6444,6 @@ def __init__( # pylint: disable=too-many-locals app logs to a destination. Currently only "log-analytics" is supported. :paramtype app_logs_configuration: ~azure.mgmt.appcontainers.models.AppLogsConfiguration - :keyword app_insights_configuration: Environment level Application Insights configuration. - :paramtype app_insights_configuration: - ~azure.mgmt.appcontainers.models.AppInsightsConfiguration - :keyword open_telemetry_configuration: Environment Open Telemetry configuration. - :paramtype open_telemetry_configuration: - ~azure.mgmt.appcontainers.models.OpenTelemetryConfiguration :keyword zone_redundant: Whether or not this Managed Environment is zone-redundant. :paramtype zone_redundant: bool :keyword custom_domain_configuration: Custom domain configuration for the environment. @@ -8454,10 +6462,12 @@ def __init__( # pylint: disable=too-many-locals :keyword peer_authentication: Peer authentication settings for the Managed Environment. :paramtype peer_authentication: ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication + :keyword peer_traffic_configuration: Peer traffic settings for the Managed Environment. + :paramtype peer_traffic_configuration: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration """ super().__init__(tags=tags, location=location, **kwargs) self.kind = kind - self.identity = identity self.provisioning_state = None self.dapr_ai_instrumentation_key = dapr_ai_instrumentation_key self.dapr_ai_connection_string = dapr_ai_connection_string @@ -8466,8 +6476,6 @@ def __init__( # pylint: disable=too-many-locals self.default_domain = None self.static_ip = None self.app_logs_configuration = app_logs_configuration - self.app_insights_configuration = app_insights_configuration - self.open_telemetry_configuration = open_telemetry_configuration self.zone_redundant = zone_redundant self.custom_domain_configuration = custom_domain_configuration self.event_stream_endpoint = None @@ -8476,6 +6484,7 @@ def __init__( # pylint: disable=too-many-locals self.dapr_configuration = dapr_configuration self.infrastructure_resource_group = infrastructure_resource_group self.peer_authentication = peer_authentication + self.peer_traffic_configuration = peer_traffic_configuration class ManagedEnvironmentPropertiesPeerAuthentication(_serialization.Model): # pylint: disable=name-too-long @@ -8498,6 +6507,55 @@ def __init__(self, *, mtls: Optional["_models.Mtls"] = None, **kwargs: Any) -> N self.mtls = mtls +class ManagedEnvironmentPropertiesPeerTrafficConfiguration(_serialization.Model): # pylint: disable=name-too-long + """Peer traffic settings for the Managed Environment. + + :ivar encryption: Peer traffic encryption settings for the Managed Environment. + :vartype encryption: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption + """ + + _attribute_map = { + "encryption": {"key": "encryption", "type": "ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption"}, + } + + def __init__( + self, + *, + encryption: Optional["_models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption"] = None, + **kwargs: Any + ) -> None: + """ + :keyword encryption: Peer traffic encryption settings for the Managed Environment. + :paramtype encryption: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption + """ + super().__init__(**kwargs) + self.encryption = encryption + + +class ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption( + _serialization.Model +): # pylint: disable=name-too-long + """Peer traffic encryption settings for the Managed Environment. + + :ivar enabled: Boolean indicating whether the peer traffic encryption is enabled. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Boolean indicating whether the peer traffic encryption is enabled. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + class ManagedEnvironmentsCollection(_serialization.Model): """Collection of Environments. @@ -8582,31 +6640,19 @@ class ManagedEnvironmentStorageProperties(_serialization.Model): :ivar azure_file: Azure file properties. :vartype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties - :ivar nfs_azure_file: NFS Azure file properties. - :vartype nfs_azure_file: ~azure.mgmt.appcontainers.models.NfsAzureFileProperties """ _attribute_map = { "azure_file": {"key": "azureFile", "type": "AzureFileProperties"}, - "nfs_azure_file": {"key": "nfsAzureFile", "type": "NfsAzureFileProperties"}, } - def __init__( - self, - *, - azure_file: Optional["_models.AzureFileProperties"] = None, - nfs_azure_file: Optional["_models.NfsAzureFileProperties"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, azure_file: Optional["_models.AzureFileProperties"] = None, **kwargs: Any) -> None: """ :keyword azure_file: Azure file properties. :paramtype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties - :keyword nfs_azure_file: NFS Azure file properties. - :paramtype nfs_azure_file: ~azure.mgmt.appcontainers.models.NfsAzureFileProperties """ super().__init__(**kwargs) self.azure_file = azure_file - self.nfs_azure_file = nfs_azure_file class ManagedEnvironmentStoragesCollection(_serialization.Model): @@ -8699,26 +6745,6 @@ def __init__( self.user_assigned_identities = user_assigned_identities -class MetricsConfiguration(_serialization.Model): - """Configuration of Open Telemetry metrics. - - :ivar destinations: Open telemetry metrics destinations. - :vartype destinations: list[str] - """ - - _attribute_map = { - "destinations": {"key": "destinations", "type": "[str]"}, - } - - def __init__(self, *, destinations: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword destinations: Open telemetry metrics destinations. - :paramtype destinations: list[str] - """ - super().__init__(**kwargs) - self.destinations = destinations - - class Mtls(_serialization.Model): """Configuration properties for mutual TLS authentication. @@ -8739,45 +6765,6 @@ def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: self.enabled = enabled -class NfsAzureFileProperties(_serialization.Model): - """NFS Azure File Properties. - - :ivar server: Server for NFS azure file. - :vartype server: str - :ivar access_mode: Access mode for storage. Known values are: "ReadOnly" and "ReadWrite". - :vartype access_mode: str or ~azure.mgmt.appcontainers.models.AccessMode - :ivar share_name: NFS Azure file share name. - :vartype share_name: str - """ - - _attribute_map = { - "server": {"key": "server", "type": "str"}, - "access_mode": {"key": "accessMode", "type": "str"}, - "share_name": {"key": "shareName", "type": "str"}, - } - - def __init__( - self, - *, - server: Optional[str] = None, - access_mode: Optional[Union[str, "_models.AccessMode"]] = None, - share_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword server: Server for NFS azure file. - :paramtype server: str - :keyword access_mode: Access mode for storage. Known values are: "ReadOnly" and "ReadWrite". - :paramtype access_mode: str or ~azure.mgmt.appcontainers.models.AccessMode - :keyword share_name: NFS Azure file share name. - :paramtype share_name: str - """ - super().__init__(**kwargs) - self.server = server - self.access_mode = access_mode - self.share_name = share_name - - class Nonce(_serialization.Model): """The configuration settings of the nonce used in the login flow. @@ -8972,53 +6959,6 @@ def __init__( self.open_id_connect_configuration = open_id_connect_configuration -class OpenTelemetryConfiguration(_serialization.Model): - """Configuration of Open Telemetry. - - :ivar destinations_configuration: Open telemetry destinations configuration. - :vartype destinations_configuration: ~azure.mgmt.appcontainers.models.DestinationsConfiguration - :ivar traces_configuration: Open telemetry trace configuration. - :vartype traces_configuration: ~azure.mgmt.appcontainers.models.TracesConfiguration - :ivar logs_configuration: Open telemetry logs configuration. - :vartype logs_configuration: ~azure.mgmt.appcontainers.models.LogsConfiguration - :ivar metrics_configuration: Open telemetry metrics configuration. - :vartype metrics_configuration: ~azure.mgmt.appcontainers.models.MetricsConfiguration - """ - - _attribute_map = { - "destinations_configuration": {"key": "destinationsConfiguration", "type": "DestinationsConfiguration"}, - "traces_configuration": {"key": "tracesConfiguration", "type": "TracesConfiguration"}, - "logs_configuration": {"key": "logsConfiguration", "type": "LogsConfiguration"}, - "metrics_configuration": {"key": "metricsConfiguration", "type": "MetricsConfiguration"}, - } - - def __init__( - self, - *, - destinations_configuration: Optional["_models.DestinationsConfiguration"] = None, - traces_configuration: Optional["_models.TracesConfiguration"] = None, - logs_configuration: Optional["_models.LogsConfiguration"] = None, - metrics_configuration: Optional["_models.MetricsConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword destinations_configuration: Open telemetry destinations configuration. - :paramtype destinations_configuration: - ~azure.mgmt.appcontainers.models.DestinationsConfiguration - :keyword traces_configuration: Open telemetry trace configuration. - :paramtype traces_configuration: ~azure.mgmt.appcontainers.models.TracesConfiguration - :keyword logs_configuration: Open telemetry logs configuration. - :paramtype logs_configuration: ~azure.mgmt.appcontainers.models.LogsConfiguration - :keyword metrics_configuration: Open telemetry metrics configuration. - :paramtype metrics_configuration: ~azure.mgmt.appcontainers.models.MetricsConfiguration - """ - super().__init__(**kwargs) - self.destinations_configuration = destinations_configuration - self.traces_configuration = traces_configuration - self.logs_configuration = logs_configuration - self.metrics_configuration = metrics_configuration - - class OperationDetail(_serialization.Model): """Operation detail payload. @@ -9111,91 +7051,6 @@ def __init__( self.description = description -class OtlpConfiguration(_serialization.Model): - """Configuration of otlp. - - :ivar name: The name of otlp configuration. - :vartype name: str - :ivar endpoint: The endpoint of otlp configuration. - :vartype endpoint: str - :ivar insecure: Boolean indicating if otlp configuration is insecure. - :vartype insecure: bool - :ivar headers: Headers of otlp configurations. - :vartype headers: list[~azure.mgmt.appcontainers.models.Header] - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "endpoint": {"key": "endpoint", "type": "str"}, - "insecure": {"key": "insecure", "type": "bool"}, - "headers": {"key": "headers", "type": "[Header]"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - endpoint: Optional[str] = None, - insecure: Optional[bool] = None, - headers: Optional[List["_models.Header"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The name of otlp configuration. - :paramtype name: str - :keyword endpoint: The endpoint of otlp configuration. - :paramtype endpoint: str - :keyword insecure: Boolean indicating if otlp configuration is insecure. - :paramtype insecure: bool - :keyword headers: Headers of otlp configurations. - :paramtype headers: list[~azure.mgmt.appcontainers.models.Header] - """ - super().__init__(**kwargs) - self.name = name - self.endpoint = endpoint - self.insecure = insecure - self.headers = headers - - -class PreBuildStep(_serialization.Model): - """Model representing a pre-build step. - - :ivar description: Description of the pre-build step. - :vartype description: str - :ivar scripts: List of custom commands to run. - :vartype scripts: list[str] - :ivar http_get: Http get request to send before the build. - :vartype http_get: ~azure.mgmt.appcontainers.models.HttpGet - """ - - _attribute_map = { - "description": {"key": "description", "type": "str"}, - "scripts": {"key": "scripts", "type": "[str]"}, - "http_get": {"key": "httpGet", "type": "HttpGet"}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - scripts: Optional[List[str]] = None, - http_get: Optional["_models.HttpGet"] = None, - **kwargs: Any - ) -> None: - """ - :keyword description: Description of the pre-build step. - :paramtype description: str - :keyword scripts: List of custom commands to run. - :paramtype scripts: list[str] - :keyword http_get: Http get request to send before the build. - :paramtype http_get: ~azure.mgmt.appcontainers.models.HttpGet - """ - super().__init__(**kwargs) - self.description = description - self.scripts = scripts - self.http_get = http_get - - class QueueScaleRule(_serialization.Model): """Container App container Azure Queue based scaling rule. @@ -9892,43 +7747,23 @@ class ServiceBind(_serialization.Model): :vartype service_id: str :ivar name: Name of the service bind. :vartype name: str - :ivar client_type: Type of the client to be used to connect to the service. - :vartype client_type: str - :ivar customized_keys: Customized keys for customizing injected values to the app. - :vartype customized_keys: dict[str, str] """ _attribute_map = { "service_id": {"key": "serviceId", "type": "str"}, "name": {"key": "name", "type": "str"}, - "client_type": {"key": "clientType", "type": "str"}, - "customized_keys": {"key": "customizedKeys", "type": "{str}"}, } - def __init__( - self, - *, - service_id: Optional[str] = None, - name: Optional[str] = None, - client_type: Optional[str] = None, - customized_keys: Optional[Dict[str, str]] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, service_id: Optional[str] = None, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword service_id: Resource id of the target service. :paramtype service_id: str :keyword name: Name of the service bind. :paramtype name: str - :keyword client_type: Type of the client to be used to connect to the service. - :paramtype client_type: str - :keyword customized_keys: Customized keys for customizing injected values to the app. - :paramtype customized_keys: dict[str, str] """ super().__init__(**kwargs) self.service_id = service_id self.name = name - self.client_type = client_type - self.customized_keys = customized_keys class SourceControl(ProxyResource): @@ -10108,46 +7943,6 @@ def __init__( self.last_modified_at = last_modified_at -class TcpConnectionPool(_serialization.Model): - """Defines parameters for tcp connection pooling. - - :ivar max_connections: Maximum number of tcp connections allowed. - :vartype max_connections: int - """ - - _attribute_map = { - "max_connections": {"key": "maxConnections", "type": "int"}, - } - - def __init__(self, *, max_connections: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword max_connections: Maximum number of tcp connections allowed. - :paramtype max_connections: int - """ - super().__init__(**kwargs) - self.max_connections = max_connections - - -class TcpRetryPolicy(_serialization.Model): - """Policy that defines tcp request retry conditions. - - :ivar max_connect_attempts: Maximum number of attempts to connect to the tcp service. - :vartype max_connect_attempts: int - """ - - _attribute_map = { - "max_connect_attempts": {"key": "maxConnectAttempts", "type": "int"}, - } - - def __init__(self, *, max_connect_attempts: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword max_connect_attempts: Maximum number of attempts to connect to the tcp service. - :paramtype max_connect_attempts: int - """ - super().__init__(**kwargs) - self.max_connect_attempts = max_connect_attempts - - class TcpScaleRule(_serialization.Model): """Container App container Tcp scaling rule. @@ -10257,40 +8052,6 @@ def __init__( self.service_binds = service_binds -class TimeoutPolicy(_serialization.Model): - """Policy to set request timeouts. - - :ivar response_timeout_in_seconds: Timeout, in seconds, for a request to respond. - :vartype response_timeout_in_seconds: int - :ivar connection_timeout_in_seconds: Timeout, in seconds, for a request to initiate a - connection. - :vartype connection_timeout_in_seconds: int - """ - - _attribute_map = { - "response_timeout_in_seconds": {"key": "responseTimeoutInSeconds", "type": "int"}, - "connection_timeout_in_seconds": {"key": "connectionTimeoutInSeconds", "type": "int"}, - } - - def __init__( - self, - *, - response_timeout_in_seconds: Optional[int] = None, - connection_timeout_in_seconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword response_timeout_in_seconds: Timeout, in seconds, for a request to respond. - :paramtype response_timeout_in_seconds: int - :keyword connection_timeout_in_seconds: Timeout, in seconds, for a request to initiate a - connection. - :paramtype connection_timeout_in_seconds: int - """ - super().__init__(**kwargs) - self.response_timeout_in_seconds = response_timeout_in_seconds - self.connection_timeout_in_seconds = connection_timeout_in_seconds - - class TokenStore(_serialization.Model): """The configuration settings of the token store. @@ -10340,26 +8101,6 @@ def __init__( self.azure_blob_storage = azure_blob_storage -class TracesConfiguration(_serialization.Model): - """Configuration of Open Telemetry traces. - - :ivar destinations: Open telemetry traces destinations. - :vartype destinations: list[str] - """ - - _attribute_map = { - "destinations": {"key": "destinations", "type": "[str]"}, - } - - def __init__(self, *, destinations: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword destinations: Open telemetry traces destinations. - :paramtype destinations: list[str] - """ - super().__init__(**kwargs) - self.destinations = destinations - - class TrafficWeight(_serialization.Model): """Traffic weight assigned to a revision. @@ -10653,15 +8394,15 @@ class Volume(_serialization.Model): :ivar name: Volume name. :vartype name: str :ivar storage_type: Storage type for the volume. If not provided, use EmptyDir. Known values - are: "AzureFile", "EmptyDir", "Secret", and "NfsAzureFile". + are: "AzureFile", "EmptyDir", and "Secret". :vartype storage_type: str or ~azure.mgmt.appcontainers.models.StorageType :ivar storage_name: Name of storage resource. No need to provide for EmptyDir and Secret. :vartype storage_name: str :ivar secrets: List of secrets to be added in volume. If no secrets are provided, all secrets in collection will be added to volume. :vartype secrets: list[~azure.mgmt.appcontainers.models.SecretVolumeItem] - :ivar mount_options: Mount options used while mounting the Azure file share or NFS Azure file - share. Must be a comma-separated string. + :ivar mount_options: Mount options used while mounting the AzureFile. Must be a comma-separated + string. :vartype mount_options: str """ @@ -10687,15 +8428,15 @@ def __init__( :keyword name: Volume name. :paramtype name: str :keyword storage_type: Storage type for the volume. If not provided, use EmptyDir. Known values - are: "AzureFile", "EmptyDir", "Secret", and "NfsAzureFile". + are: "AzureFile", "EmptyDir", and "Secret". :paramtype storage_type: str or ~azure.mgmt.appcontainers.models.StorageType :keyword storage_name: Name of storage resource. No need to provide for EmptyDir and Secret. :paramtype storage_name: str :keyword secrets: List of secrets to be added in volume. If no secrets are provided, all secrets in collection will be added to volume. :paramtype secrets: list[~azure.mgmt.appcontainers.models.SecretVolumeItem] - :keyword mount_options: Mount options used while mounting the Azure file share or NFS Azure - file share. Must be a comma-separated string. + :keyword mount_options: Mount options used while mounting the AzureFile. Must be a + comma-separated string. :paramtype mount_options: str """ super().__init__(**kwargs) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py index 27819202ef8e..1d1af7c18205 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py @@ -6,14 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._app_resiliency_operations import AppResiliencyOperations from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations from ._billing_meters_operations import BillingMetersOperations -from ._builders_operations import BuildersOperations -from ._builds_by_builder_resource_operations import BuildsByBuilderResourceOperations -from ._builds_operations import BuildsOperations -from ._build_auth_token_operations import BuildAuthTokenOperations from ._connected_environments_operations import ConnectedEnvironmentsOperations from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations @@ -32,29 +27,20 @@ from ._certificates_operations import CertificatesOperations from ._managed_certificates_operations import ManagedCertificatesOperations from ._namespaces_operations import NamespacesOperations -from ._dapr_component_resiliency_policies_operations import DaprComponentResiliencyPoliciesOperations from ._dapr_components_operations import DaprComponentsOperations -from ._dapr_subscriptions_operations import DaprSubscriptionsOperations from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations from ._usages_operations import UsagesOperations from ._managed_environment_usages_operations import ManagedEnvironmentUsagesOperations -from ._java_components_operations import JavaComponentsOperations -from ._dot_net_components_operations import DotNetComponentsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ - "AppResiliencyOperations", "ContainerAppsAuthConfigsOperations", "AvailableWorkloadProfilesOperations", "BillingMetersOperations", - "BuildersOperations", - "BuildsByBuilderResourceOperations", - "BuildsOperations", - "BuildAuthTokenOperations", "ConnectedEnvironmentsOperations", "ConnectedEnvironmentsCertificatesOperations", "ConnectedEnvironmentsDaprComponentsOperations", @@ -73,15 +59,11 @@ "CertificatesOperations", "ManagedCertificatesOperations", "NamespacesOperations", - "DaprComponentResiliencyPoliciesOperations", "DaprComponentsOperations", - "DaprSubscriptionsOperations", "ManagedEnvironmentsStoragesOperations", "ContainerAppsSourceControlsOperations", "UsagesOperations", "ManagedEnvironmentUsagesOperations", - "JavaComponentsOperations", - "DotNetComponentsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_app_resiliency_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_app_resiliency_operations.py deleted file mode 100644 index 335c0f80f99e..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_app_resiliency_operations.py +++ /dev/null @@ -1,738 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, app_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "appName": _SERIALIZER.url("app_name", app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_update_request( - resource_group_name: str, app_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "appName": _SERIALIZER.url("app_name", app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_delete_request( - resource_group_name: str, app_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "appName": _SERIALIZER.url("app_name", app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, app_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "appName": _SERIALIZER.url("app_name", app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_list_request(resource_group_name: str, app_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "appName": _SERIALIZER.url("app_name", app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class AppResiliencyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`app_resiliency` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: _models.AppResiliency, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Required. - :type resiliency_envelope: 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: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: Union[_models.AppResiliency, IO[bytes]], - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Is either a - AppResiliency type or a IO[bytes] type. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency or IO[bytes] - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resiliency_envelope, (IOBase, bytes)): - _content = resiliency_envelope - else: - _json = self._serialize.body(resiliency_envelope, "AppResiliency") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("AppResiliency", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("AppResiliency", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: _models.AppResiliency, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Required. - :type resiliency_envelope: 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: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: Union[_models.AppResiliency, IO[bytes]], - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Is either a AppResiliency type or - a IO[bytes] type. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency or IO[bytes] - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resiliency_envelope, (IOBase, bytes)): - _content = resiliency_envelope - else: - _json = self._serialize.body(resiliency_envelope, "AppResiliency") - - _request = build_update_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AppResiliency", pipeline_response) - - 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, app_name: str, name: str, **kwargs: Any - ) -> None: - """Delete an application's resiliency policy. - - Delete container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, app_name: str, name: str, **kwargs: Any) -> _models.AppResiliency: - """Get an application's resiliency policy. - - Get container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AppResiliency", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, app_name: str, **kwargs: Any) -> Iterable["_models.AppResiliency"]: - """List an application's resiliency policies. - - List container app resiliency policies. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :return: An iterator like instance of either AppResiliency or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.AppResiliency] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AppResiliencyCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - app_name=app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AppResiliencyCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py index b5b3325841ae..ff534041a61d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py @@ -40,7 +40,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -49,7 +49,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/availableManagedEnvironmentsWorkloadProfileTypes", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str", min_length=1), } diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py index cc656256a0da..fd90bdf373d4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py @@ -38,7 +38,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -46,7 +46,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/billingMeters" ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str", min_length=1), } diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_build_auth_token_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_build_auth_token_operations.py deleted file mode 100644 index 03f255159915..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_build_auth_token_operations.py +++ /dev/null @@ -1,152 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, builder_name: str, build_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}/listAuthToken", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - "buildName": _SERIALIZER.url( - "build_name", build_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class BuildAuthTokenOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`build_auth_token` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any) -> _models.BuildToken: - """Gets the token used to connect to the endpoint where source code can be uploaded for a build. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: BuildToken or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuildToken - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildToken] = kwargs.pop("cls", None) - - _request = build_list_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BuildToken", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builders_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builders_operations.py deleted file mode 100644 index 2ee9ea5294f4..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builders_operations.py +++ /dev/null @@ -1,968 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/builders") - 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_list_by_resource_group_request(resource_group_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _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_get_request(resource_group_name: str, builder_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _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_create_or_update_request( - resource_group_name: str, builder_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _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_update_request( - resource_group_name: str, builder_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _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_delete_request( - resource_group_name: str, builder_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class BuildersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`builders` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.BuilderResource"]: - """List BuilderResource resources by subscription ID. - - :return: An iterator like instance of either BuilderResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BuilderCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.BuilderResource"]: - """List BuilderResource resources by 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 either BuilderResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BuilderCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> _models.BuilderResource: - """Get a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: BuilderResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuilderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BuilderResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResource, IO[bytes]], - **kwargs: Any - ) -> _models.BuilderResource: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(builder_envelope, (IOBase, bytes)): - _content = builder_envelope - else: - _json = self._serialize.body(builder_envelope, "BuilderResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("BuilderResource", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("BuilderResource", pipeline_response) - - 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, - builder_name: str, - builder_envelope: _models.BuilderResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResource - :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 either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Required. - :type builder_envelope: 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 either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Is either a BuilderResource type or a - IO[bytes] type. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResource or IO[bytes] - :return: An instance of LROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuilderResource] = 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, - builder_name=builder_name, - builder_envelope=builder_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuilderResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.BuilderResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BuilderResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResourceUpdate, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.BuilderResource]: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.BuilderResource]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(builder_envelope, (IOBase, bytes)): - _content = builder_envelope - else: - _json = self._serialize.body(builder_envelope, "BuilderResourceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("BuilderResource", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: _models.BuilderResourceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResourceUpdate - :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 either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Required. - :type builder_envelope: 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 either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResourceUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Is either a - BuilderResourceUpdate type or a IO[bytes] type. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResourceUpdate or IO[bytes] - :return: An instance of LROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuilderResource] = 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, - builder_name=builder_name, - builder_envelope=builder_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuilderResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.BuilderResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BuilderResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, builder_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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( # type: ignore - resource_group_name=resource_group_name, - builder_name=builder_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - 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 - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **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 diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_by_builder_resource_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_by_builder_resource_operations.py deleted file mode 100644 index b1a3d7ef324f..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_by_builder_resource_operations.py +++ /dev/null @@ -1,173 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(resource_group_name: str, builder_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class BuildsByBuilderResourceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`builds_by_builder_resource` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> Iterable["_models.BuildResource"]: - """List BuildResource resources by BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: An iterator like instance of either BuildResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BuildCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_operations.py deleted file mode 100644 index 8007534cc4ae..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_operations.py +++ /dev/null @@ -1,552 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, builder_name: str, build_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - "buildName": _SERIALIZER.url( - "build_name", build_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _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_create_or_update_request( - resource_group_name: str, builder_name: str, build_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - "buildName": _SERIALIZER.url( - "build_name", build_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _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_delete_request( - resource_group_name: str, builder_name: str, build_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - "buildName": _SERIALIZER.url( - "build_name", build_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class BuildsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`builds` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any) -> _models.BuildResource: - """Get a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: BuildResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuildResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BuildResource", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: Union[_models.BuildResource, IO[bytes]], - **kwargs: Any - ) -> _models.BuildResource: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuildResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(build_envelope, (IOBase, bytes)): - _content = build_envelope - else: - _json = self._serialize.body(build_envelope, "BuildResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("BuildResource", pipeline_response) - - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("BuildResource", pipeline_response) - - 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, - builder_name: str, - build_name: str, - build_envelope: _models.BuildResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Required. - :type build_envelope: ~azure.mgmt.appcontainers.models.BuildResource - :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 either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Required. - :type build_envelope: 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 either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: Union[_models.BuildResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Is either a BuildResource type or - a IO[bytes] type. Required. - :type build_envelope: ~azure.mgmt.appcontainers.models.BuildResource or IO[bytes] - :return: An instance of LROPoller that returns either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuildResource] = 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, - builder_name=builder_name, - build_name=build_name, - build_envelope=build_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuildResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.BuildResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BuildResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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( # type: ignore - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - 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 - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **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 diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py index 2739382988f7..26b8dcacd72b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py @@ -43,7 +43,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +52,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -76,7 +76,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -110,7 +110,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +120,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -147,7 +147,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -156,7 +156,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -181,7 +181,7 @@ def build_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -191,7 +191,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py index e06b5f9cbd78..4b7c1117a82c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py @@ -43,7 +43,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +52,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -80,7 +80,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -118,7 +118,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -128,7 +128,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -159,7 +159,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +168,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -197,7 +197,7 @@ def build_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -207,7 +207,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py index db1d06c8ffd3..5dde746abb33 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py @@ -43,7 +43,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +52,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -76,7 +76,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -110,7 +110,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +120,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -147,7 +147,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -156,7 +156,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -181,7 +181,7 @@ def build_list_secrets_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,7 +190,7 @@ def build_list_secrets_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}/listSecrets", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py index 8bc2e4540fbc..03163792fe40 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py @@ -43,13 +43,13 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/connectedEnvironments") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -67,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -99,7 +99,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -132,7 +132,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -142,7 +142,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -168,7 +168,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +177,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -201,7 +201,7 @@ def build_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +210,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -234,7 +234,7 @@ def build_check_name_availability_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -244,7 +244,7 @@ def build_check_name_availability_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/checkNameAvailability", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py index 084b50d04075..fadcf712b794 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py @@ -41,7 +41,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -50,7 +50,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -74,7 +74,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -108,7 +108,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -118,7 +118,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -145,7 +145,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +154,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py index b959732eef68..d1dce920b09e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py @@ -40,7 +40,7 @@ def build_job_execution_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -49,7 +49,7 @@ def build_job_execution_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -76,7 +76,7 @@ def build_get_custom_domain_verification_id_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -84,7 +84,7 @@ def build_get_custom_domain_verification_id_request( # pylint: disable=name-too "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/getCustomDomainVerificationId" ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py index 6d16ff0bbc57..aa86c252c560 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py @@ -43,7 +43,7 @@ def build_list_by_container_app_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +52,7 @@ def build_list_by_container_app_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -76,7 +76,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -110,7 +110,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +120,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -147,7 +147,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -156,7 +156,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py index 5014cf298b1b..f6b92cd9a86b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py @@ -42,7 +42,7 @@ def build_list_detectors_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +51,7 @@ def build_list_detectors_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -75,7 +75,7 @@ def build_get_detector_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -84,7 +84,7 @@ def build_get_detector_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors/{detectorName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -114,7 +114,7 @@ def build_list_revisions_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +123,7 @@ def build_list_revisions_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -149,7 +149,7 @@ def build_get_revision_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +158,7 @@ def build_get_revision_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/{revisionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -183,7 +183,7 @@ def build_get_root_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +192,7 @@ def build_get_root_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/rootApi/", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py index c4bec66f23ce..ca7e569e3acd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py @@ -43,13 +43,13 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/containerApps") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -67,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -99,7 +99,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -132,7 +132,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -142,7 +142,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -168,7 +168,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +177,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -201,7 +201,7 @@ def build_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -211,7 +211,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -242,7 +242,7 @@ def build_list_custom_host_name_analysis_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +251,7 @@ def build_list_custom_host_name_analysis_request( # pylint: disable=name-too-lo "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listCustomHostNameAnalysis", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -277,7 +277,7 @@ def build_list_secrets_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -286,7 +286,7 @@ def build_list_secrets_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listSecrets", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -310,7 +310,7 @@ def build_get_auth_token_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +319,7 @@ def build_get_auth_token_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/getAuthtoken", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -343,7 +343,7 @@ def build_start_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -352,7 +352,7 @@ def build_start_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -378,7 +378,7 @@ def build_stop_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -387,7 +387,7 @@ def build_stop_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py index 513cfd8687bd..40fdc5f8cfa4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py @@ -45,7 +45,7 @@ def build_get_replica_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_get_replica_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas/{replicaName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -80,7 +80,7 @@ def build_list_replicas_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_list_replicas_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py index dbb59afb6558..ae31bddefe7f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py @@ -47,7 +47,7 @@ def build_list_revisions_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_revisions_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -82,7 +82,7 @@ def build_get_revision_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +91,7 @@ def build_get_revision_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -116,7 +116,7 @@ def build_activate_revision_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +125,7 @@ def build_activate_revision_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/activate", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -150,7 +150,7 @@ def build_deactivate_revision_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -159,7 +159,7 @@ def build_deactivate_revision_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/deactivate", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -184,7 +184,7 @@ def build_restart_revision_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +193,7 @@ def build_restart_revision_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/restart", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py index 5c56850d64f3..00f0fc772812 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py @@ -45,7 +45,7 @@ def build_list_by_container_app_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_list_by_container_app_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -78,7 +78,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +87,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -112,7 +112,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -122,7 +122,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -149,7 +149,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +158,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_component_resiliency_policies_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_component_resiliency_policies_operations.py deleted file mode 100644 index 8651964a9c97..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_component_resiliency_policies_operations.py +++ /dev/null @@ -1,589 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, environment_name: str, component_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "componentName": _SERIALIZER.url("component_name", component_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_get_request( - resource_group_name: str, environment_name: str, component_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "componentName": _SERIALIZER.url("component_name", component_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", 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_create_or_update_request( - resource_group_name: str, environment_name: str, component_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "componentName": _SERIALIZER.url("component_name", component_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", 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_delete_request( - resource_group_name: str, environment_name: str, component_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "componentName": _SERIALIZER.url("component_name", component_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", 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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class DaprComponentResiliencyPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`dapr_component_resiliency_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, component_name: str, **kwargs: Any - ) -> Iterable["_models.DaprComponentResiliencyPolicy"]: - """Get the resiliency policies for a Dapr component. - - Get the resiliency policies for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :return: An iterator like instance of either DaprComponentResiliencyPolicy or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprComponentResiliencyPoliciesCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DaprComponentResiliencyPoliciesCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, environment_name: str, component_name: str, name: str, **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Get a Dapr component resiliency policy. - - Get a Dapr component resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprComponentResiliencyPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprComponentResiliencyPolicy", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: _models.DaprComponentResiliencyPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Required. - :type dapr_component_resiliency_policy_envelope: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Required. - :type dapr_component_resiliency_policy_envelope: 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: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: Union[_models.DaprComponentResiliencyPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Is either a DaprComponentResiliencyPolicy type or a IO[bytes] type. - Required. - :type dapr_component_resiliency_policy_envelope: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy or IO[bytes] - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DaprComponentResiliencyPolicy] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dapr_component_resiliency_policy_envelope, (IOBase, bytes)): - _content = dapr_component_resiliency_policy_envelope - else: - _json = self._serialize.body(dapr_component_resiliency_policy_envelope, "DaprComponentResiliencyPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DaprComponentResiliencyPolicy", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("DaprComponentResiliencyPolicy", pipeline_response) - - 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, environment_name: str, component_name: str, name: str, **kwargs: Any - ) -> None: - """Delete a Dapr component resiliency policy. - - Delete a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py index 6185be9c9fbe..54dc3d556f6b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py @@ -43,7 +43,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +52,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -76,7 +76,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -110,7 +110,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +120,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -147,7 +147,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -156,7 +156,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -181,7 +181,7 @@ def build_list_secrets_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,7 +190,7 @@ def build_list_secrets_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/listSecrets", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_subscriptions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_subscriptions_operations.py deleted file mode 100644 index 8b2488ce964a..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_subscriptions_operations.py +++ /dev/null @@ -1,560 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_get_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", 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_create_or_update_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", 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_delete_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", 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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class DaprSubscriptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`dapr_subscriptions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> Iterable["_models.DaprSubscription"]: - """Get the Dapr subscriptions for a managed environment. - - Get the Dapr subscriptions for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either DaprSubscription or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.DaprSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprSubscriptionsCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DaprSubscriptionsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> _models.DaprSubscription: - """Get a dapr subscription. - - Get a dapr subscription. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprSubscription] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprSubscription", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: _models.DaprSubscription, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Required. - :type dapr_subscription_envelope: ~azure.mgmt.appcontainers.models.DaprSubscription - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Required. - :type dapr_subscription_envelope: 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: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: Union[_models.DaprSubscription, IO[bytes]], - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Is either a - DaprSubscription type or a IO[bytes] type. Required. - :type dapr_subscription_envelope: ~azure.mgmt.appcontainers.models.DaprSubscription or - IO[bytes] - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DaprSubscription] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dapr_subscription_envelope, (IOBase, bytes)): - _content = dapr_subscription_envelope - else: - _json = self._serialize.body(dapr_subscription_envelope, "DaprSubscription") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DaprSubscription", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("DaprSubscription", pipeline_response) - - 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, environment_name: str, name: str, **kwargs: Any - ) -> None: - """Delete a Dapr subscription. - - Delete a Dapr subscription from a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dot_net_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dot_net_components_operations.py deleted file mode 100644 index eb95db3a3c78..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dot_net_components_operations.py +++ /dev/null @@ -1,917 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_get_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_create_or_update_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_update_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_delete_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class DotNetComponentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`dot_net_components` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> Iterable["_models.DotNetComponent"]: - """Get the .NET Components for a managed environment. - - Get the .NET Components for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either DotNetComponent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DotNetComponentsCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DotNetComponentsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any) -> _models.DotNetComponent: - """Get a .NET Component. - - Get a .NET Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :return: DotNetComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DotNetComponent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DotNetComponent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DotNetComponent", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> _models.DotNetComponent: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DotNetComponent] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dot_net_component_envelope, (IOBase, bytes)): - _content = dot_net_component_envelope - else: - _json = self._serialize.body(dot_net_component_envelope, "DotNetComponent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("DotNetComponent", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("DotNetComponent", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: _models.DotNetComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent - :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 either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: 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 either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Is either a - DotNetComponent type or a IO[bytes] type. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent or IO[bytes] - :return: An instance of LROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DotNetComponent] = 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, - environment_name=environment_name, - name=name, - dot_net_component_envelope=dot_net_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DotNetComponent", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DotNetComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DotNetComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.DotNetComponent]: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.DotNetComponent]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dot_net_component_envelope, (IOBase, bytes)): - _content = dot_net_component_envelope - else: - _json = self._serialize.body(dot_net_component_envelope, "DotNetComponent") - - _request = build_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("DotNetComponent", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: _models.DotNetComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent - :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 either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: 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 either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Is either a - DotNetComponent type or a IO[bytes] type. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent or IO[bytes] - :return: An instance of LROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DotNetComponent] = 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, - environment_name=environment_name, - name=name, - dot_net_component_envelope=dot_net_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DotNetComponent", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DotNetComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DotNetComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a .NET Component. - - Delete a .NET Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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( # type: ignore - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - 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 - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **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 diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_java_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_java_components_operations.py deleted file mode 100644 index 46f755fed0e0..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_java_components_operations.py +++ /dev/null @@ -1,915 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer -from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_get_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_create_or_update_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_update_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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_delete_request( - resource_group_name: str, environment_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", "2023-11-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class JavaComponentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`java_components` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> Iterable["_models.JavaComponent"]: - """Get the Java Components for a managed environment. - - Get the Java Components for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either JavaComponent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JavaComponentsCollection] = kwargs.pop("cls", None) - - error_map = { - 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_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - 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), params=_next_request_params - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JavaComponentsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any) -> _models.JavaComponent: - """Get a Java Component. - - Get a Java Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :return: JavaComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.JavaComponent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JavaComponent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JavaComponent", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> _models.JavaComponent: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JavaComponent] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(java_component_envelope, (IOBase, bytes)): - _content = java_component_envelope - else: - _json = self._serialize.body(java_component_envelope, "JavaComponent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("JavaComponent", pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize("JavaComponent", pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: _models.JavaComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent - :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 either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: 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 either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Is either a - JavaComponent type or a IO[bytes] type. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent or IO[bytes] - :return: An instance of LROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JavaComponent] = 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, - environment_name=environment_name, - name=name, - java_component_envelope=java_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JavaComponent", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.JavaComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JavaComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.JavaComponent]: - error_map = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.JavaComponent]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(java_component_envelope, (IOBase, bytes)): - _content = java_component_envelope - else: - _json = self._serialize.body(java_component_envelope, "JavaComponent") - - _request = build_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("JavaComponent", pipeline_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: _models.JavaComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent - :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 either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: 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 either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Is either a - JavaComponent type or a IO[bytes] type. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent or IO[bytes] - :return: An instance of LROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JavaComponent] = 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, - environment_name=environment_name, - name=name, - java_component_envelope=java_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JavaComponent", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.JavaComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JavaComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> None: - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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")) - - if cls: - return cls(pipeline_response, None, response_headers) # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a Java Component. - - Delete a Java Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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( # type: ignore - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - 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 - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **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 diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py index eee36884768a..3985b39dc269 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py @@ -42,7 +42,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +51,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py index 9ad72330b0e7..c5e1d3965228 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -45,7 +45,7 @@ def build_list_detectors_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_list_detectors_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -78,7 +78,7 @@ def build_get_detector_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +87,7 @@ def build_get_detector_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors/{detectorName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -107,13 +107,12 @@ def build_get_detector_request( def build_proxy_get_request( - resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any + resource_group_name: str, job_name: str, api_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_name: Literal["rootApi"] = kwargs.pop("api_name", "rootApi") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,12 +121,12 @@ def build_proxy_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectorProperties/{apiName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "apiName": _SERIALIZER.url("api_name", api_name, "str"), + "apiName": _SERIALIZER.url("api_name", api_name, "str", pattern=r"^[-\w\._]+$"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -145,13 +144,13 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/jobs") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -169,7 +168,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +177,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -199,7 +198,7 @@ def build_get_request(resource_group_name: str, job_name: str, subscription_id: _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +207,7 @@ def build_get_request(resource_group_name: str, job_name: str, subscription_id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -232,7 +231,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -242,7 +241,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -266,7 +265,7 @@ def build_delete_request(resource_group_name: str, job_name: str, subscription_i _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -275,7 +274,7 @@ def build_delete_request(resource_group_name: str, job_name: str, subscription_i "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -297,7 +296,7 @@ def build_update_request(resource_group_name: str, job_name: str, subscription_i _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -307,7 +306,7 @@ def build_update_request(resource_group_name: str, job_name: str, subscription_i "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -331,7 +330,7 @@ def build_start_request(resource_group_name: str, job_name: str, subscription_id _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -341,7 +340,7 @@ def build_start_request(resource_group_name: str, job_name: str, subscription_id "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/start", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -367,7 +366,7 @@ def build_stop_execution_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +375,7 @@ def build_stop_execution_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}/stop", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -403,7 +402,7 @@ def build_stop_multiple_executions_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -412,7 +411,7 @@ def build_stop_multiple_executions_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -436,7 +435,7 @@ def build_list_secrets_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -445,7 +444,7 @@ def build_list_secrets_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/listSecrets", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -483,7 +482,7 @@ def __init__(self, *args, **kwargs): self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_detectors(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models.DiagnosticsCollection: + def list_detectors(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterable["_models.Diagnostics"]: """Get the list of diagnostics for a given Container App Job. Get the list of diagnostics for a Container App Job. @@ -493,10 +492,16 @@ def list_detectors(self, resource_group_name: str, job_name: str, **kwargs: Any) :type resource_group_name: str :param job_name: Job Name. Required. :type job_name: str - :return: DiagnosticsCollection or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DiagnosticsCollection + :return: An iterator like instance of either Diagnostics or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.Diagnostics] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DiagnosticsCollection] = kwargs.pop("cls", None) + error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -505,41 +510,62 @@ def list_detectors(self, resource_group_name: str, job_name: str, **kwargs: Any) } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DiagnosticsCollection] = kwargs.pop("cls", None) + _request = build_list_detectors_request( + resource_group_name=resource_group_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) - _request = build_list_detectors_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request = _convert_request(_request) - _request.url = self._client.format_url(_request.url) + 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), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def extract_data(pipeline_response): + deserialized = self._deserialize("DiagnosticsCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link 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 [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - deserialized = self._deserialize("DiagnosticsCollection", pipeline_response) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_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) @distributed_trace def get_detector( @@ -606,8 +632,8 @@ def get_detector( return deserialized # type: ignore @distributed_trace - def proxy_get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models.Job: - """Get the properties for a given Container App Job. + def proxy_get(self, resource_group_name: str, job_name: str, api_name: str, **kwargs: Any) -> _models.Job: + """Get the properties of a Container App Job. Get the properties of a Container App Job. @@ -616,6 +642,8 @@ def proxy_get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _ :type resource_group_name: str :param job_name: Job Name. Required. :type job_name: str + :param api_name: Proxy API Name for Container App Job. Required. + :type api_name: str :return: Job or the result of cls(response) :rtype: ~azure.mgmt.appcontainers.models.Job :raises ~azure.core.exceptions.HttpResponseError: @@ -631,15 +659,14 @@ def proxy_get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_name: Literal["rootApi"] = kwargs.pop("api_name", "rootApi") api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) _request = build_proxy_get_request( resource_group_name=resource_group_name, job_name=job_name, - subscription_id=self._config.subscription_id, api_name=api_name, + subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py index 1d0a9bdec49f..2d2af5c97783 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py @@ -45,7 +45,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -79,7 +79,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -89,7 +89,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -116,7 +116,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +125,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -150,7 +150,7 @@ def build_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -160,7 +160,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -187,7 +187,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -196,7 +196,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py index 36671189de6e..14cc618ae45a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py @@ -40,7 +40,7 @@ def build_list_detectors_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -49,7 +49,7 @@ def build_list_detectors_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -73,7 +73,7 @@ def build_get_detector_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +82,7 @@ def build_get_detector_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors/{detectorName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_usages_operations.py index 82dec27ebb0a..c7488c786068 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_usages_operations.py @@ -42,7 +42,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +51,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/usages", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py index 077dcd413feb..57b92032416a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py @@ -40,7 +40,7 @@ def build_get_root_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -49,7 +49,7 @@ def build_get_root_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectorProperties/rootApi/", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py index 4d29d04b1a48..5990036f94e3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py @@ -43,13 +43,13 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/managedEnvironments") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -67,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -99,7 +99,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -132,7 +132,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -142,7 +142,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -168,7 +168,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +177,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -201,7 +201,7 @@ def build_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -211,7 +211,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -237,7 +237,7 @@ def build_get_auth_token_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +246,7 @@ def build_get_auth_token_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/getAuthtoken", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -270,7 +270,7 @@ def build_list_workload_profile_states_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +279,7 @@ def build_list_workload_profile_states_request( # pylint: disable=name-too-long "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/workloadProfileStates", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py index efdd9a9c7d60..3aa5e2047d36 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py @@ -41,7 +41,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -50,7 +50,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -74,7 +74,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -108,7 +108,7 @@ def build_create_or_update_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -118,7 +118,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -145,7 +145,7 @@ def build_delete_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +154,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py index 56f460ad18ba..f285cc9759f8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py @@ -41,7 +41,7 @@ def build_check_name_availability_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -51,7 +51,7 @@ def build_check_name_availability_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/checkNameAvailability", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py index 1a05294e4428..5defbcc3f793 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py @@ -40,7 +40,7 @@ def build_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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_usages_operations.py index 03bc72d24244..d9b855baab9e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_usages_operations.py @@ -40,7 +40,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2023-11-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -49,7 +49,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht ) path_format_arguments = { "location": _SERIALIZER.url("location", location, "str", pattern=r"^[-\w\._]+$"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_create_or_update.py deleted file mode 100644 index e98b4e1f846b..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_create_or_update.py +++ /dev/null @@ -1,63 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python app_resiliency_create_or_update.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.app_resiliency.create_or_update( - resource_group_name="rg", - app_name="testcontainerApp0", - name="resiliency-policy-1", - resiliency_envelope={ - "properties": { - "circuitBreakerPolicy": {"consecutiveErrors": 5, "intervalInSeconds": 10, "maxEjectionPercent": 50}, - "httpConnectionPool": {"http1MaxPendingRequests": 1024, "http2MaxRequests": 1024}, - "httpRetryPolicy": { - "matches": { - "errors": ["5xx", "connect-failure", "reset", "retriable-headers", "retriable-status-codes"], - "headers": [{"header": "X-Content-Type", "match": {"prefixMatch": "GOATS"}}], - "httpStatusCodes": [502, 503], - }, - "maxRetries": 5, - "retryBackOff": {"initialDelayInMilliseconds": 1000, "maxIntervalInMilliseconds": 10000}, - }, - "tcpConnectionPool": {"maxConnections": 100}, - "tcpRetryPolicy": {"maxConnectAttempts": 3}, - "timeoutPolicy": {"connectionTimeoutInSeconds": 5, "responseTimeoutInSeconds": 15}, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_delete.py deleted file mode 100644 index fab04833c272..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_delete.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python app_resiliency_delete.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - client.app_resiliency.delete( - resource_group_name="rg", - app_name="testcontainerApp0", - name="resiliency-policy-1", - ) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_get.py deleted file mode 100644 index 26b4f027f9c5..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_get.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python app_resiliency_get.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.app_resiliency.get( - resource_group_name="rg", - app_name="testcontainerApp0", - name="resiliency-policy-1", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_list.py deleted file mode 100644 index 2ff4b5bb7403..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_list.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python app_resiliency_list.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.app_resiliency.list( - resource_group_name="rg", - app_name="testcontainerApp0", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_patch.py deleted file mode 100644 index e351bd2e4a3d..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_patch.py +++ /dev/null @@ -1,48 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python app_resiliency_patch.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.app_resiliency.update( - resource_group_name="rg", - app_name="testcontainerApp0", - name="resiliency-policy-1", - resiliency_envelope={ - "properties": {"timeoutPolicy": {"connectionTimeoutInSeconds": 40, "responseTimeoutInSeconds": 30}} - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Patch.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py index bbc6ec8fc9b3..624220b47933 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py index 6c96c3fdc91d..ba040bbd2aa2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py index 1095283b90d4..3938c1cbfe61 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py index 8edbbff4ffae..5e68fc393e08 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_ListByContainer.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AuthConfigs_ListByContainer.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py index 865e1cbbd4fb..983b5fa9ee20 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AvailableWorkloadProfiles_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/AvailableWorkloadProfiles_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py index dff89c99c439..a0d779a0e42b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/BillingMeters_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/BillingMeters_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_create_or_update.py deleted file mode 100644 index 0f6707c6de5b..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_create_or_update.py +++ /dev/null @@ -1,67 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_create_or_update.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builders.begin_create_or_update( - resource_group_name="rg", - builder_name="testBuilder", - builder_envelope={ - "identity": { - "type": "SystemAssigned,UserAssigned", - "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {} - }, - }, - "location": "eastus", - "properties": { - "containerRegistries": [ - { - "containerRegistryServer": "test.azurecr.io", - "identityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", - }, - { - "containerRegistryServer": "test2.azurecr.io", - "identityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", - }, - ], - "environmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv", - }, - "tags": {"company": "Microsoft"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_delete.py deleted file mode 100644 index f014b49a4339..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_delete.py +++ /dev/null @@ -1,41 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_delete.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.builders.begin_delete( - resource_group_name="rg", - builder_name="testBuilder", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_get.py deleted file mode 100644 index e48ce3a5ca80..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_get.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_get.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builders.get( - resource_group_name="rg", - builder_name="testBuilder", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_resource_group.py deleted file mode 100644 index 812800c9de41..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_resource_group.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_list_by_resource_group.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builders.list_by_resource_group( - resource_group_name="rg", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_ListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_subscription.py deleted file mode 100644 index 67032bc436ba..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_subscription.py +++ /dev/null @@ -1,40 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_list_by_subscription.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builders.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_ListBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_update.py deleted file mode 100644 index f5e123b1badb..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_update.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_update.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builders.begin_update( - resource_group_name="rg", - builder_name="testBuilder", - builder_envelope={"tags": {"mytag1": "myvalue1"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_create_or_update.py deleted file mode 100644 index 4fde89dd07ac..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_create_or_update.py +++ /dev/null @@ -1,72 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builds_create_or_update.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builds.begin_create_or_update( - resource_group_name="rg", - builder_name="testBuilder", - build_name="testBuild-123456789az", - build_envelope={ - "properties": { - "configuration": { - "baseOs": "DebianBullseye", - "environmentVariables": [{"name": "foo1", "value": "bar1"}, {"name": "foo2", "value": "bar2"}], - "platform": "dotnetcore", - "platformVersion": "7.0", - "preBuildSteps": [ - { - "description": "First pre build step.", - "httpGet": { - "fileName": "output.txt", - "headers": ["foo", "bar"], - "url": "https://microsoft.com", - }, - "scripts": ["echo 'hello'", "echo 'world'"], - }, - { - "description": "Second pre build step.", - "httpGet": {"fileName": "output.txt", "headers": ["foo"], "url": "https://microsoft.com"}, - "scripts": ["echo 'hello'", "echo 'again'"], - }, - ], - }, - "destinationContainerRegistry": {"image": "test.azurecr.io/repo:tag", "server": "test.azurecr.io"}, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_delete.py deleted file mode 100644 index 0cd6d19d5c57..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_delete.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builds_delete.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.builds.begin_delete( - resource_group_name="rg", - builder_name="testBuilder", - build_name="testBuild", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_get.py deleted file mode 100644 index 7c6dda4f0e38..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_get.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builds_get.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builds.get( - resource_group_name="rg", - builder_name="testBuilder", - build_name="testBuild", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_auth_token.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_auth_token.py deleted file mode 100644 index 0adf09f0fcc0..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_auth_token.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builds_list_auth_token.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.build_auth_token.list( - resource_group_name="rg", - builder_name="testBuilder", - build_name="testBuild", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_ListAuthToken.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_by_builder_resource.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_by_builder_resource.py deleted file mode 100644 index 804827d40261..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_by_builder_resource.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builds_list_by_builder_resource.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builds_by_builder_resource.list( - resource_group_name="rg", - builder_name="testBuilder", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_ListByBuilderResource.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py index 675eb5b8c480..dff91853c9ea 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update_from_key_vault.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update_from_key_vault.py deleted file mode 100644 index 68eda9fa1946..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update_from_key_vault.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python certificate_create_or_update_from_key_vault.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.certificates.create_or_update( - resource_group_name="examplerg", - environment_name="testcontainerenv", - certificate_name="certificate-firendly-name", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_CreateOrUpdate_FromKeyVault.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py index 2989b2951a35..90bd4a513ede 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py index 49eeaff2ccb1..5dcc3680dfa2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificate_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py index 92c3839cc465..54c16c926ef1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificates_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py index ec5a8b88a5e7..2cc236f9fce0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificates_ListByManagedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_ListByManagedEnvironment.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py index 4006011a62c5..d89bae1c7fdb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Certificates_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py index 24c5e8187dd4..cdca5d34c027 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py index eafde70f5640..00f1ab1a0b5e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificate_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py index f54e0c564dae..ace6d53f08b0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificate_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py index e7f072087734..f22d461dea7c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py index 06e06685241e..913aa57949a6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py index 49e23990fabf..84aa2d9796cb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsCertificates_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py index 6e8f8e7c6140..0d2ee04d43ae 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py index 30dc14394373..8e001608e83c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py @@ -49,13 +49,6 @@ def main(): ], "scopes": ["container-app-1", "container-app-2"], "secrets": [{"name": "masterkey", "value": "keyvalue"}], - "serviceComponentBind": [ - { - "metadata": {"name": "daprcomponentBind", "value": "redis-bind"}, - "name": "statestore", - "serviceId": "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", - } - ], "version": "v1", } }, @@ -63,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py index 14fe8bfd6a9f..929cc80cc978 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsDaprComponents_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py index 4fbf110564f2..d6f1966fd4bf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsDaprComponents_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py index f43c438ddde6..6a55a4e1d8a0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsDaprComponents_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py index 5c81a547ae0c..6df6c3e05174 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py index 7bca2f8f07cd..e73072b39b27 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py index 5d8f8bd24481..313b7128c547 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py index 52df79f1d713..ed8b13df7429 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py index 211eaa06ed11..ede57b26a655 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py index 860f287b5d10..5f8bdb48eaf5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironments_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py index adf5251229f1..d9472452801e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py index d4ba700860ea..9f302e2a539c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py index 2b2bf696fe9a..0385ae553809 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py index cec40e7e7126..5f3b4f472f24 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ConnectedEnvironmentsStorages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py index ce1cd05f4de8..6e2cdf2b61b5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py index 9f0444130090..22d752c240f7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py @@ -34,7 +34,7 @@ def main(): response = client.container_apps.begin_create_or_update( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", container_app_envelope={ "location": "East US", "properties": { @@ -91,7 +91,7 @@ def main(): ], "stickySessions": {"affinity": "sticky"}, "targetPort": 3000, - "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], + "traffic": [{"label": "production", "revisionName": "testcontainerapp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, "service": {"type": "redis"}, @@ -100,8 +100,8 @@ def main(): "template": { "containers": [ { - "image": "repo/testcontainerApp0:v1", - "name": "testcontainerApp0", + "image": "repo/testcontainerapp0:v1", + "name": "testcontainerapp0", "probes": [ { "httpGet": { @@ -114,19 +114,15 @@ def main(): "type": "Liveness", } ], - "volumeMounts": [ - {"mountPath": "/mnt/path1", "subPath": "subPath1", "volumeName": "azurefile"}, - {"mountPath": "/mnt/path2", "subPath": "subPath2", "volumeName": "nfsazurefile"}, - ], } ], "initContainers": [ { "args": ["-c", "while true; do echo hello; sleep 10;done"], "command": ["/bin/sh"], - "image": "repo/testcontainerApp0:v4", + "image": "repo/testcontainerapp0:v4", "name": "testinitcontainerApp0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, + "resources": {"cpu": 0.5, "memory": "1Gi"}, } ], "scale": { @@ -141,16 +137,10 @@ def main(): }, "serviceBinds": [ { - "clientType": "dotnet", - "customizedKeys": {"DesiredKey": "defaultKey"}, "name": "redisService", "serviceId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService", } ], - "volumes": [ - {"name": "azurefile", "storageName": "storage", "storageType": "AzureFile"}, - {"name": "nfsazurefile", "storageName": "nfsStorage", "storageType": "NfsAzureFile"}, - ], }, "workloadProfileName": "My-GP-01", }, @@ -159,6 +149,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update_connected_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update_connected_environment.py deleted file mode 100644 index 02be9846c6a6..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update_connected_environment.py +++ /dev/null @@ -1,150 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_create_or_update_connected_environment.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.container_apps.begin_create_or_update( - resource_group_name="rg", - container_app_name="testcontainerApp0", - container_app_envelope={ - "extendedLocation": { - "name": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation", - "type": "CustomLocation", - }, - "location": "East US", - "properties": { - "configuration": { - "dapr": { - "appPort": 3000, - "appProtocol": "http", - "enableApiLogging": True, - "enabled": True, - "httpMaxRequestSize": 10, - "httpReadBufferSize": 30, - "logLevel": "debug", - }, - "ingress": { - "additionalPortMappings": [ - {"external": True, "targetPort": 1234}, - {"exposedPort": 3456, "external": False, "targetPort": 2345}, - ], - "clientCertificateMode": "accept", - "corsPolicy": { - "allowCredentials": True, - "allowedHeaders": ["HEADER1", "HEADER2"], - "allowedMethods": ["GET", "POST"], - "allowedOrigins": ["https://a.test.com", "https://b.test.com"], - "exposeHeaders": ["HEADER3", "HEADER4"], - "maxAge": 1234, - }, - "customDomains": [ - { - "bindingType": "SniEnabled", - "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com", - "name": "www.my-name.com", - }, - { - "bindingType": "SniEnabled", - "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com", - "name": "www.my-other-name.com", - }, - ], - "external": True, - "ipSecurityRestrictions": [ - { - "action": "Allow", - "description": "Allowing all IP's within the subnet below to access containerapp", - "ipAddressRange": "192.168.1.1/32", - "name": "Allow work IP A subnet", - }, - { - "action": "Allow", - "description": "Allowing all IP's within the subnet below to access containerapp", - "ipAddressRange": "192.168.1.1/8", - "name": "Allow work IP B subnet", - }, - ], - "stickySessions": {"affinity": "sticky"}, - "targetPort": 3000, - "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], - }, - "maxInactiveRevisions": 10, - }, - "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube", - "template": { - "containers": [ - { - "image": "repo/testcontainerApp0:v1", - "name": "testcontainerApp0", - "probes": [ - { - "httpGet": { - "httpHeaders": [{"name": "Custom-Header", "value": "Awesome"}], - "path": "/health", - "port": 8080, - }, - "initialDelaySeconds": 3, - "periodSeconds": 3, - "type": "Liveness", - } - ], - } - ], - "initContainers": [ - { - "args": ["-c", "while true; do echo hello; sleep 10;done"], - "command": ["/bin/sh"], - "image": "repo/testcontainerApp0:v4", - "name": "testinitcontainerApp0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, - } - ], - "scale": { - "maxReplicas": 5, - "minReplicas": 1, - "rules": [ - { - "custom": {"metadata": {"concurrentRequests": "50"}, "type": "http"}, - "name": "httpscalingrule", - } - ], - }, - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_CreateOrUpdate_ConnectedEnvironment.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py index d4b0b91bd67d..5584e089d51f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py @@ -32,10 +32,10 @@ def main(): client.container_apps.begin_delete( resource_group_name="rg", - container_app_name="testWorkerApp0", + container_app_name="testworkerapp0", ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py index 0621e4623d72..d930996c61b2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerAppsDiagnostics_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerAppsDiagnostics_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py index 948e502bc334..76593271c57f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerAppsDiagnostics_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerAppsDiagnostics_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py index a8f09b0d5a5b..2dbd65e4358a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.get( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py index 97280c262a21..ccc19d0b27a3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.get_auth_token( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_GetAuthToken.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_GetAuthToken.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py index 3ddd12b249a7..046c42b04668 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py index 762384b44e69..0c3297623ffb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py index e39c06791164..658867e94928 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.list_custom_host_name_analysis( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListCustomHostNameAnalysis.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py index eb5fab29e6b8..2f46811b10e5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.list_secrets( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py index 5c90c8d56eac..3888d2106624 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py @@ -34,7 +34,7 @@ def main(): response = client.container_apps.begin_create_or_update( resource_group_name="rg", - container_app_name="testcontainerAppManagedBy", + container_app_name="testcontainerappmanagedby", container_app_envelope={ "location": "East US", "managedBy": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp", @@ -44,7 +44,7 @@ def main(): "exposedPort": 4000, "external": True, "targetPort": 3000, - "traffic": [{"revisionName": "testcontainerAppManagedBy-ab1234", "weight": 100}], + "traffic": [{"revisionName": "testcontainerappmanagedby-ab1234", "weight": 100}], "transport": "tcp", } }, @@ -52,8 +52,8 @@ def main(): "template": { "containers": [ { - "image": "repo/testcontainerAppManagedBy:v1", - "name": "testcontainerAppManagedBy", + "image": "repo/testcontainerappmanagedby:v1", + "name": "testcontainerappmanagedby", "probes": [ { "initialDelaySeconds": 3, @@ -76,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ManagedBy_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_ManagedBy_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py index e0ebd96a01a5..8e098ca5d753 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py @@ -34,7 +34,7 @@ def main(): response = client.container_apps.begin_update( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", container_app_envelope={ "location": "East US", "properties": { @@ -78,7 +78,7 @@ def main(): ], "stickySessions": {"affinity": "sticky"}, "targetPort": 3000, - "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], + "traffic": [{"label": "production", "revisionName": "testcontainerapp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, "service": {"type": "redis"}, @@ -86,8 +86,8 @@ def main(): "template": { "containers": [ { - "image": "repo/testcontainerApp0:v1", - "name": "testcontainerApp0", + "image": "repo/testcontainerapp0:v1", + "name": "testcontainerapp0", "probes": [ { "httpGet": { @@ -104,9 +104,9 @@ def main(): ], "initContainers": [ { - "image": "repo/testcontainerApp0:v4", + "image": "repo/testcontainerapp0:v4", "name": "testinitcontainerApp0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, + "resources": {"cpu": 0.5, "memory": "1Gi"}, } ], "scale": { @@ -121,8 +121,6 @@ def main(): }, "serviceBinds": [ { - "clientType": "dotnet", - "customizedKeys": {"DesiredKey": "defaultKey"}, "name": "service", "serviceId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service", } @@ -135,6 +133,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py index 9125f2d8182a..4b0f2b9068d6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.begin_start( resource_group_name="rg", - container_app_name="testWorkerApp0", + container_app_name="testworkerapp0", ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Start.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Start.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py index 0fc89828ced7..89a46875376b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.begin_stop( resource_group_name="rg", - container_app_name="testWorkerApp0", + container_app_name="testworkerApp0", ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Stop.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_Stop.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py index bd84fa656785..6a91c457e976 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py @@ -34,7 +34,7 @@ def main(): response = client.container_apps.begin_create_or_update( resource_group_name="rg", - container_app_name="testcontainerAppTcp", + container_app_name="testcontainerapptcp", container_app_envelope={ "location": "East US", "properties": { @@ -43,7 +43,7 @@ def main(): "exposedPort": 4000, "external": True, "targetPort": 3000, - "traffic": [{"revisionName": "testcontainerAppTcp-ab1234", "weight": 100}], + "traffic": [{"revisionName": "testcontainerapptcp-ab1234", "weight": 100}], "transport": "tcp", } }, @@ -51,8 +51,8 @@ def main(): "template": { "containers": [ { - "image": "repo/testcontainerAppTcp:v1", - "name": "testcontainerAppTcp", + "image": "repo/testcontainerapptcp:v1", + "name": "testcontainerapptcp", "probes": [ { "initialDelaySeconds": 3, @@ -75,6 +75,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ContainerApps_TcpApp_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_delete.py deleted file mode 100644 index eb3c02bb76d0..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_delete.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policies_delete.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - client.dapr_component_resiliency_policies.delete( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - name="myresiliencypolicy", - ) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicies_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_get.py deleted file mode 100644 index d3a007f91680..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_get.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policies_get.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_component_resiliency_policies.get( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - name="myresiliencypolicy", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicies_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_list.py deleted file mode 100644 index 1fc552c48b8b..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_list.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policies_list.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_component_resiliency_policies.list( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicies_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_all_options.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_all_options.py deleted file mode 100644 index 399c7ed65abf..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_all_options.py +++ /dev/null @@ -1,66 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policy_create_or_update_all_options.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_component_resiliency_policies.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - name="myresiliencypolicy", - dapr_component_resiliency_policy_envelope={ - "properties": { - "inboundPolicy": { - "circuitBreakerPolicy": {"consecutiveErrors": 5, "intervalInSeconds": 4, "timeoutInSeconds": 10}, - "httpRetryPolicy": { - "maxRetries": 15, - "retryBackOff": {"initialDelayInMilliseconds": 2000, "maxIntervalInMilliseconds": 5500}, - }, - "timeoutPolicy": {"responseTimeoutInSeconds": 30}, - }, - "outboundPolicy": { - "circuitBreakerPolicy": {"consecutiveErrors": 3, "intervalInSeconds": 60, "timeoutInSeconds": 20}, - "httpRetryPolicy": { - "maxRetries": 5, - "retryBackOff": {"initialDelayInMilliseconds": 100, "maxIntervalInMilliseconds": 30000}, - }, - "timeoutPolicy": {"responseTimeoutInSeconds": 12}, - }, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_AllOptions.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_outbound_only.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_outbound_only.py deleted file mode 100644 index f3b4323bad94..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_outbound_only.py +++ /dev/null @@ -1,58 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policy_create_or_update_outbound_only.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_component_resiliency_policies.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - name="myresiliencypolicy", - dapr_component_resiliency_policy_envelope={ - "properties": { - "outboundPolicy": { - "circuitBreakerPolicy": {"consecutiveErrors": 3, "intervalInSeconds": 60, "timeoutInSeconds": 20}, - "httpRetryPolicy": { - "maxRetries": 5, - "retryBackOff": {"initialDelayInMilliseconds": 100, "maxIntervalInMilliseconds": 30000}, - }, - "timeoutPolicy": {"responseTimeoutInSeconds": 12}, - } - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_OutboundOnly.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_sparse_options.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_sparse_options.py deleted file mode 100644 index 692e76e00cf4..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_sparse_options.py +++ /dev/null @@ -1,58 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policy_create_or_update_sparse_options.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_component_resiliency_policies.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - name="myresiliencypolicy", - dapr_component_resiliency_policy_envelope={ - "properties": { - "inboundPolicy": { - "circuitBreakerPolicy": {"consecutiveErrors": 3, "timeoutInSeconds": 20}, - "httpRetryPolicy": { - "maxRetries": 5, - "retryBackOff": {"initialDelayInMilliseconds": 2000, "maxIntervalInMilliseconds": 5500}, - }, - }, - "outboundPolicy": {"timeoutPolicy": {"responseTimeoutInSeconds": 12}}, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_SparseOptions.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py index 98d1b2f380e4..fe6d1a18e37d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py @@ -49,13 +49,6 @@ def main(): ], "scopes": ["container-app-1", "container-app-2"], "secretStoreComponent": "my-secret-store", - "serviceComponentBind": [ - { - "metadata": {"name": "daprcomponentBind", "value": "redis-bind"}, - "name": "statestore", - "serviceId": "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", - } - ], "version": "v1", } }, @@ -63,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py index adff70eea4af..5e087e9e1be1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py @@ -49,13 +49,6 @@ def main(): ], "scopes": ["container-app-1", "container-app-2"], "secrets": [{"name": "masterkey", "value": "keyvalue"}], - "serviceComponentBind": [ - { - "metadata": {"name": "daprcomponentBind", "value": "redis-bind"}, - "name": "statestore", - "serviceId": "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", - } - ], "version": "v1", } }, @@ -63,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_CreateOrUpdate_Secrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py index edfbdb28f867..b77e9e25a41b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py index ec4b1a935bb7..704a23da3223 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_Get_SecretStoreComponent.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_Get_SecretStoreComponent.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py index e797ea7a4c3b..6770615c84dc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_Get_Secrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_Get_Secrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py index 742c780dd094..94ea0da382ea 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py index 6071afa6717d..134ef9102bad 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/DaprComponents_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_bulk_subscribe_and_scopes.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_bulk_subscribe_and_scopes.py deleted file mode 100644 index c78a49eb395b..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_bulk_subscribe_and_scopes.py +++ /dev/null @@ -1,54 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_create_or_update_bulk_subscribe_and_scopes.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mysubscription", - dapr_subscription_envelope={ - "properties": { - "bulkSubscribe": {"enabled": True, "maxAwaitDurationMs": 500, "maxMessagesCount": 123}, - "pubsubName": "mypubsubcomponent", - "routes": {"default": "/products"}, - "scopes": ["warehouseapp", "customersupportapp"], - "topic": "inventory", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_CreateOrUpdate_BulkSubscribeAndScopes.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_default_route.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_default_route.py deleted file mode 100644 index 4756e5f0cf94..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_default_route.py +++ /dev/null @@ -1,48 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_create_or_update_default_route.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mysubscription", - dapr_subscription_envelope={ - "properties": {"pubsubName": "mypubsubcomponent", "routes": {"default": "/products"}, "topic": "inventory"} - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_CreateOrUpdate_DefaultRoute.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_route_rules_and_metadata.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_route_rules_and_metadata.py deleted file mode 100644 index 1005320a7c2a..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_route_rules_and_metadata.py +++ /dev/null @@ -1,59 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_create_or_update_route_rules_and_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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mysubscription", - dapr_subscription_envelope={ - "properties": { - "metadata": {"foo": "bar", "hello": "world"}, - "pubsubName": "mypubsubcomponent", - "routes": { - "default": "/products", - "rules": [ - {"match": "event.type == 'widget'", "path": "/widgets"}, - {"match": "event.type == 'gadget'", "path": "/gadgets"}, - ], - }, - "topic": "inventory", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_CreateOrUpdate_RouteRulesAndMetadata.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_delete.py deleted file mode 100644 index ba81e2ee5418..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_delete.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_delete.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - client.dapr_subscriptions.delete( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mysubscription", - ) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_bulk_subscribe_and_scopes.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_bulk_subscribe_and_scopes.py deleted file mode 100644 index 65b1aaafe2ec..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_bulk_subscribe_and_scopes.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_get_bulk_subscribe_and_scopes.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mypubsubcomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Get_BulkSubscribeAndScopes.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_default_route.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_default_route.py deleted file mode 100644 index 505a1dc57b79..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_default_route.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_get_default_route.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mypubsubcomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Get_DefaultRoute.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_route_rules_and_metadata.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_route_rules_and_metadata.py deleted file mode 100644 index 1b75ba87e155..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_route_rules_and_metadata.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_get_route_rules_and_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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mypubsubcomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Get_RouteRulesAndMetadata.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_list.py deleted file mode 100644 index 53d9fdff5473..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_list.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_list.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.list( - resource_group_name="examplerg", - environment_name="myenvironment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update.py deleted file mode 100644 index 083c21be5588..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update.py +++ /dev/null @@ -1,51 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_create_or_update.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.begin_create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - dot_net_component_envelope={ - "properties": { - "componentType": "AspireDashboard", - "configurations": [{"propertyName": "dashboard-theme", "value": "dark"}], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update_service_bind.py deleted file mode 100644 index 124f25f97468..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update_service_bind.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_create_or_update_service_bind.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.begin_create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - dot_net_component_envelope={ - "properties": { - "componentType": "AspireDashboard", - "configurations": [{"propertyName": "dashboard-theme", "value": "dark"}], - "serviceBinds": [ - { - "name": "yellowcat", - "serviceId": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat", - } - ], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_CreateOrUpdate_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_delete.py deleted file mode 100644 index 8f767c38f83f..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_delete.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_delete.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - client.dot_net_components.begin_delete( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get.py deleted file mode 100644 index 527ce8b43bcb..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_get.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get_service_bind.py deleted file mode 100644 index bffb648b2e74..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get_service_bind.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_get_service_bind.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Get_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list.py deleted file mode 100644 index 0505fb4bf395..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_list.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.list( - resource_group_name="examplerg", - environment_name="myenvironment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list_service_bind.py deleted file mode 100644 index fd153eb24c56..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list_service_bind.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_list_service_bind.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.list( - resource_group_name="examplerg", - environment_name="myenvironment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_List_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch.py deleted file mode 100644 index 6dd065b5ee1b..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch.py +++ /dev/null @@ -1,51 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_patch.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.begin_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - dot_net_component_envelope={ - "properties": { - "componentType": "AspireDashboard", - "configurations": [{"propertyName": "dashboard-theme", "value": "dark"}], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Patch.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch_service_bind.py deleted file mode 100644 index 7289c041a76c..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch_service_bind.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_patch_service_bind.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.begin_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - dot_net_component_envelope={ - "properties": { - "componentType": "AspireDashboard", - "configurations": [{"propertyName": "dashboard-theme", "value": "dark"}], - "serviceBinds": [ - { - "name": "yellowcat", - "serviceId": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat", - } - ], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Patch_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update.py deleted file mode 100644 index 703c852b6736..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update.py +++ /dev/null @@ -1,54 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_create_or_update.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.begin_create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - java_component_envelope={ - "properties": { - "componentType": "SpringBootAdmin", - "configurations": [ - {"propertyName": "spring.boot.admin.ui.enable-toasts", "value": "true"}, - {"propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms"}, - ], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update_service_bind.py deleted file mode 100644 index a7fd208f05a6..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update_service_bind.py +++ /dev/null @@ -1,60 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_create_or_update_service_bind.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.begin_create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - java_component_envelope={ - "properties": { - "componentType": "SpringBootAdmin", - "configurations": [ - {"propertyName": "spring.boot.admin.ui.enable-toasts", "value": "true"}, - {"propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms"}, - ], - "serviceBinds": [ - { - "name": "yellowcat", - "serviceId": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat", - } - ], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_CreateOrUpdate_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_delete.py deleted file mode 100644 index c90fd77d7b3d..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_delete.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_delete.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - client.java_components.begin_delete( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get.py deleted file mode 100644 index 957441f7e6b6..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_get.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get_service_bind.py deleted file mode 100644 index 51378453d799..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get_service_bind.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_get_service_bind.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Get_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list.py deleted file mode 100644 index 0fb2ce7d5a59..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_list.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.list( - resource_group_name="examplerg", - environment_name="myenvironment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list_service_bind.py deleted file mode 100644 index bfbbba681c61..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list_service_bind.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_list_service_bind.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.list( - resource_group_name="examplerg", - environment_name="myenvironment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_List_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch.py deleted file mode 100644 index 95689cb92c43..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch.py +++ /dev/null @@ -1,54 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_patch.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.begin_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - java_component_envelope={ - "properties": { - "componentType": "SpringBootAdmin", - "configurations": [ - {"propertyName": "spring.boot.admin.ui.enable-toasts", "value": "true"}, - {"propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms"}, - ], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Patch.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch_service_bind.py deleted file mode 100644 index 4c0daf6835f0..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch_service_bind.py +++ /dev/null @@ -1,60 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_patch_service_bind.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.begin_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - java_component_envelope={ - "properties": { - "componentType": "SpringBootAdmin", - "configurations": [ - {"propertyName": "spring.boot.admin.ui.enable-toasts", "value": "true"}, - {"propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms"}, - ], - "serviceBinds": [ - { - "name": "yellowcat", - "serviceId": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat", - } - ], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Patch_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update.py index 226e0f4c27dc..f3ddb4bcde78 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update.py @@ -34,7 +34,7 @@ def main(): response = client.jobs.begin_create_or_update( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", job_envelope={ "location": "East US", "properties": { @@ -48,8 +48,8 @@ def main(): "template": { "containers": [ { - "image": "repo/testcontainerAppsJob0:v1", - "name": "testcontainerAppsJob0", + "image": "repo/testcontainerappsjob0:v1", + "name": "testcontainerappsjob0", "probes": [ { "httpGet": { @@ -62,19 +62,15 @@ def main(): "type": "Liveness", } ], - "volumeMounts": [ - {"mountPath": "/mnt/path1", "subPath": "subPath1", "volumeName": "azurefile"}, - {"mountPath": "/mnt/path2", "subPath": "subPath2", "volumeName": "nfsazurefile"}, - ], } ], "initContainers": [ { "args": ["-c", "while true; do echo hello; sleep 10;done"], "command": ["/bin/sh"], - "image": "repo/testcontainerAppsJob0:v4", + "image": "repo/testcontainerappsjob0:v4", "name": "testinitcontainerAppsJob0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, + "resources": {"cpu": 0.5, "memory": "1Gi"}, } ], }, @@ -84,6 +80,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_CreateorUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_CreateorUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_connected_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_connected_environment.py deleted file mode 100644 index 3a34b6d23ba3..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_connected_environment.py +++ /dev/null @@ -1,89 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python job_createor_update_connected_environment.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.jobs.begin_create_or_update( - resource_group_name="rg", - job_name="testcontainerAppsJob0", - job_envelope={ - "extendedLocation": { - "name": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation", - "type": "CustomLocation", - }, - "location": "East US", - "properties": { - "configuration": { - "manualTriggerConfig": {"parallelism": 4, "replicaCompletionCount": 1}, - "replicaRetryLimit": 10, - "replicaTimeout": 10, - "triggerType": "Manual", - }, - "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube", - "template": { - "containers": [ - { - "image": "repo/testcontainerAppsJob0:v1", - "name": "testcontainerAppsJob0", - "probes": [ - { - "httpGet": { - "httpHeaders": [{"name": "Custom-Header", "value": "Awesome"}], - "path": "/health", - "port": 8080, - }, - "initialDelaySeconds": 5, - "periodSeconds": 3, - "type": "Liveness", - } - ], - } - ], - "initContainers": [ - { - "args": ["-c", "while true; do echo hello; sleep 10;done"], - "command": ["/bin/sh"], - "image": "repo/testcontainerAppsJob0:v4", - "name": "testinitcontainerAppsJob0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, - } - ], - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_CreateorUpdate_ConnectedEnvironment.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_event_trigger.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_event_trigger.py index 76642c7b3be0..5e948fcbfd82 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_event_trigger.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_event_trigger.py @@ -34,7 +34,7 @@ def main(): response = client.jobs.begin_create_or_update( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", job_envelope={ "location": "East US", "properties": { @@ -61,14 +61,14 @@ def main(): }, "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", "template": { - "containers": [{"image": "repo/testcontainerAppsJob0:v1", "name": "testcontainerAppsJob0"}], + "containers": [{"image": "repo/testcontainerappsjob0:v1", "name": "testcontainerappsjob0"}], "initContainers": [ { "args": ["-c", "while true; do echo hello; sleep 10;done"], "command": ["/bin/sh"], - "image": "repo/testcontainerAppsJob0:v4", + "image": "repo/testcontainerappsjob0:v4", "name": "testinitcontainerAppsJob0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, + "resources": {"cpu": 0.5, "memory": "1Gi"}, } ], }, @@ -78,6 +78,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_CreateorUpdate_EventTrigger.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_CreateorUpdate_EventTrigger.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py index 707d5be599a9..6b06c167dcf1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py @@ -32,10 +32,10 @@ def main(): client.jobs.begin_delete( resource_group_name="rg", - job_name="testWorkerContainerAppsJob0", + job_name="testworkercontainerappsjob0", ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py index 71e6f219196e..2f3c4ab1467c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py @@ -32,12 +32,12 @@ def main(): response = client.job_execution( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", job_execution_name="jobExecution1", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Execution_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Execution_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py index 5c42446c93b7..ef8f87ed75b2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py @@ -32,12 +32,12 @@ def main(): response = client.jobs_executions.list( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", ) for item in response: print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Executions_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Executions_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py index 13df12d0d25a..7e30b8cdc1d2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py @@ -32,11 +32,11 @@ def main(): response = client.jobs.get( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get_detector.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get_detector.py index 34492b40251e..babc393e6e1c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get_detector.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get_detector.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_GetDetector.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_GetDetector.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_detectors.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_detectors.py index 43aa91b84e69..ecd35bee287b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_detectors.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_detectors.py @@ -34,9 +34,10 @@ def main(): resource_group_name="mikono-workerapp-test-rg", job_name="mikonojob1", ) - print(response) + for item in response: + print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_ListDetectors.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_ListDetectors.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py index a00a65ae0774..d8e658773abe 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py @@ -32,11 +32,11 @@ def main(): response = client.jobs.list_secrets( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_patch.py index fdd90a62cd4d..a923c994dd36 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_patch.py @@ -34,7 +34,7 @@ def main(): response = client.jobs.begin_update( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", job_envelope={ "properties": { "configuration": { @@ -46,8 +46,8 @@ def main(): "template": { "containers": [ { - "image": "repo/testcontainerAppsJob0:v1", - "name": "testcontainerAppsJob0", + "image": "repo/testcontainerappsjob0:v1", + "name": "testcontainerappsjob0", "probes": [ { "httpGet": { @@ -66,9 +66,9 @@ def main(): { "args": ["-c", "while true; do echo hello; sleep 10;done"], "command": ["/bin/sh"], - "image": "repo/testcontainerAppsJob0:v4", + "image": "repo/testcontainerappsjob0:v4", "name": "testinitcontainerAppsJob0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, + "resources": {"cpu": 0.5, "memory": "1Gi"}, } ], }, @@ -78,6 +78,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_proxy_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_proxy_get.py index cb08ef600bde..2df4d15dc8db 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_proxy_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_proxy_get.py @@ -32,11 +32,12 @@ def main(): response = client.jobs.proxy_get( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", + api_name="rootApi", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_ProxyGet.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_ProxyGet.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py index 9c45dd9143a2..883c1318f5c0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py @@ -32,11 +32,11 @@ def main(): response = client.jobs.begin_start( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Start.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Start.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py index a35dbe1fdb88..09a27e753cf6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py @@ -32,11 +32,11 @@ def main(): client.jobs.begin_stop_execution( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", job_execution_name="jobExecution1", ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Stop_Execution.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Stop_Execution.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py index fc6afaa7d9e4..e9587c0e5e85 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py @@ -32,11 +32,11 @@ def main(): response = client.jobs.begin_stop_multiple_executions( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Stop_Multiple.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Job_Stop_Multiple.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py index bb74c063d810..650ce4e217b8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Jobs_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Jobs_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py index 417ccd48b7b5..043b2a59bb3a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Jobs_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Jobs_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py index f82b4b92f33e..ddfc5f4f71b9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificate_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py index d81ae7f29fbe..7cd14a089046 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificate_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py index fcf0c6f806e7..a7ccc42102b2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificate_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py index 7d3485b3dc42..4941f24b8a2f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificates_ListByManagedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificates_ListByManagedEnvironment.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py index 3d48fd683378..a1ee2af5d93a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedCertificates_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py index 9654c3282d2c..9c5737f1cd68 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentDiagnostics_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentDiagnostics_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py index 5869e15ea3a5..60b3bed0ac13 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentDiagnostics_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentDiagnostics_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_usages_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_usages_list.py index 49df9cba2d41..16677f20f1e6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_usages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_usages_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentUsages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentUsages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py index d14f9aa12b11..1ceb49120e57 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py @@ -36,47 +36,17 @@ def main(): resource_group_name="examplerg", environment_name="testcontainerenv", environment_envelope={ - "identity": { - "type": "SystemAssigned, UserAssigned", - "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {} - }, - }, "location": "East US", "properties": { - "appInsightsConfiguration": { - "connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/" - }, - "appLogsConfiguration": { - "logAnalyticsConfiguration": { - "customerId": "string", - "dynamicJsonColumns": True, - "sharedKey": "string", - } - }, + "appLogsConfiguration": {"logAnalyticsConfiguration": {"customerId": "string", "sharedKey": "string"}}, "customDomainConfiguration": { "certificatePassword": "1234", "certificateValue": "Y2VydA==", "dnsSuffix": "www.my-name.com", }, "daprAIConnectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/", - "openTelemetryConfiguration": { - "destinationsConfiguration": { - "dataDogConfiguration": {"key": "000000000000000000000000", "site": "string"}, - "otlpConfigurations": [ - { - "endpoint": "dashboard.k8s.region.azurecontainerapps.io:80", - "headers": [{"key": "api-key", "value": "xxxxxxxxxxx"}], - "insecure": True, - "name": "dashboard", - } - ], - }, - "logsConfiguration": {"destinations": ["appInsights"]}, - "metricsConfiguration": {"destinations": ["dataDog"]}, - "tracesConfiguration": {"destinations": ["appInsights"]}, - }, "peerAuthentication": {"mtls": {"enabled": True}}, + "peerTrafficConfiguration": {"encryption": {"enabled": True}}, "vnetConfiguration": { "infrastructureSubnetId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1" }, @@ -108,6 +78,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py index bf8b11e1fa3d..75aab76e8862 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py @@ -77,6 +77,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py index 75019f367c6c..69b97651992a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py index 0f70c08f3366..9b16d4364cfa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py index e2020d33fdc3..3a452548c78a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_GetAuthToken.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_GetAuthToken.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py index 6a42e68a13fb..529bada3b593 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py index 157f4e41569a..934110969aaf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py index 7fbce5c40111..fad3cedf2a2d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_ListWorkloadProfileStates.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py index 6c8a286e29f8..7a89e7285d6f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironments_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py index e1b2ea86cf93..85711c657610 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update_nfs_azure_file.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update_nfs_azure_file.py deleted file mode 100644 index 41af4163e581..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update_nfs_azure_file.py +++ /dev/null @@ -1,48 +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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, IO, Union - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python managed_environments_storages_create_or_update_nfs_azure_file.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.managed_environments_storages.create_or_update( - resource_group_name="examplerg", - environment_name="managedEnv", - storage_name="jlaw-demo1", - storage_envelope={ - "properties": {"nfsAzureFile": {"accessMode": "ReadOnly", "server": "server1", "shareName": "share1"}} - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py index 2998b568b579..a942a596aaf2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentsStorages_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py index 0d0955564cd3..6d47c9f474d1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentsStorages_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get_nfs_azure_file.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get_nfs_azure_file.py deleted file mode 100644 index e61419aaacb1..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get_nfs_azure_file.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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python managed_environments_storages_get_nfs_azure_file.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 = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.managed_environments_storages.get( - resource_group_name="examplerg", - environment_name="managedEnv", - storage_name="jlaw-demo1", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py index eed274629609..3fa7a7d4b11a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/ManagedEnvironmentsStorages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py index 119af87df18c..8b3049de3638 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Operations_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py index f1e6923b9510..f90a1ec8bc8a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Replicas_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Replicas_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py index ced67bc69945..d6bda773f347 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Replicas_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Replicas_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py index 16bf6566e1a4..7b0ed29bf13e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Activate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Activate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py index 12cf26fe99f8..e26fdd3716c8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Deactivate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Deactivate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py index dd0b6278c92e..5b9262251ff7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py index c9bde6a3e2c6..4368222a22b9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py index 3e581135da72..faafa805c696 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Restart.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Revisions_Restart.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py index b2a93c97a1fa..ce791ab93ee0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py @@ -46,7 +46,6 @@ def main(): "kind": "feaderated", "tenantId": "", }, - "buildEnvironmentVariables": [{"name": "foo1", "value": "bar1"}, {"name": "foo2", "value": "bar2"}], "contextPath": "./", "githubPersonalAccessToken": "test", "image": "image/tag", @@ -63,6 +62,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/SourceControls_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py index ca22d4352d20..6d0b6b962576 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/SourceControls_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py index 9276b931e314..2b0cc9cb70cd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/SourceControls_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py index 3d8e2b44f018..1351c607e646 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/SourceControls_ListByContainer.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/SourceControls_ListByContainer.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/subscriptions_get_custom_domain_verification_id.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/subscriptions_get_custom_domain_verification_id.py index cea7244da098..10e891b6f3b8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/subscriptions_get_custom_domain_verification_id.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/subscriptions_get_custom_domain_verification_id.py @@ -34,6 +34,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Subscriptions_GetCustomDomainVerificationId.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Subscriptions_GetCustomDomainVerificationId.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/usages_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/usages_list.py index c3633f4f65d5..e40fedb4050e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/usages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/usages_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Usages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2024-03-01/examples/Usages_List.json if __name__ == "__main__": main()