diff --git a/sdk/app/azure-mgmt-app/_meta.json b/sdk/app/azure-mgmt-app/_meta.json index b635d5601ca5..bf693963199f 100644 --- a/sdk/app/azure-mgmt-app/_meta.json +++ b/sdk/app/azure-mgmt-app/_meta.json @@ -4,8 +4,8 @@ "@autorest/python@5.12.0", "@autorest/modelerfour@4.19.3" ], - "commit": "4ac6be1b22f88bfbb6ca3e294e73538bcac90b49", + "commit": "664dde5b970a83a63407c1be3efe4bec7e50db45", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/app/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "autorest_command": "autorest specification/app/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/app/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/_configuration.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/_configuration.py index 90b7231faf5c..92ee73922f3e 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/_configuration.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2022-01-01-preview" + self.api_version = "2022-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-app/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/_container_apps_api_client.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/_container_apps_api_client.py index 714c5d778be9..58dbcaeeb7ed 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/_container_apps_api_client.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/_container_apps_api_client.py @@ -15,7 +15,7 @@ from . import models from ._configuration import ContainerAppsAPIClientConfiguration -from .operations import CertificatesOperations, ContainerAppsAuthConfigsOperations, ContainerAppsOperations, ContainerAppsRevisionReplicasOperations, ContainerAppsRevisionsOperations, ContainerAppsSourceControlsOperations, DaprComponentsOperations, ManagedEnvironmentsOperations, ManagedEnvironmentsStoragesOperations, Operations +from .operations import CertificatesOperations, ContainerAppsAuthConfigsOperations, ContainerAppsOperations, ContainerAppsRevisionReplicasOperations, ContainerAppsRevisionsOperations, ContainerAppsSourceControlsOperations, DaprComponentsOperations, ManagedEnvironmentsOperations, ManagedEnvironmentsStoragesOperations, NamespacesOperations, Operations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,6 +24,9 @@ class ContainerAppsAPIClient: """ContainerAppsAPIClient. + :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations + :vartype container_apps_auth_configs: + container_apps_api_client.operations.ContainerAppsAuthConfigsOperations :ivar container_apps: ContainerAppsOperations operations :vartype container_apps: container_apps_api_client.operations.ContainerAppsOperations :ivar container_apps_revisions: ContainerAppsRevisionsOperations operations @@ -32,24 +35,23 @@ class ContainerAppsAPIClient: :ivar container_apps_revision_replicas: ContainerAppsRevisionReplicasOperations operations :vartype container_apps_revision_replicas: container_apps_api_client.operations.ContainerAppsRevisionReplicasOperations + :ivar dapr_components: DaprComponentsOperations operations + :vartype dapr_components: container_apps_api_client.operations.DaprComponentsOperations + :ivar operations: Operations operations + :vartype operations: container_apps_api_client.operations.Operations :ivar managed_environments: ManagedEnvironmentsOperations operations :vartype managed_environments: container_apps_api_client.operations.ManagedEnvironmentsOperations :ivar certificates: CertificatesOperations operations :vartype certificates: container_apps_api_client.operations.CertificatesOperations - :ivar operations: Operations operations - :vartype operations: container_apps_api_client.operations.Operations - :ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations - :vartype container_apps_source_controls: - container_apps_api_client.operations.ContainerAppsSourceControlsOperations - :ivar dapr_components: DaprComponentsOperations operations - :vartype dapr_components: container_apps_api_client.operations.DaprComponentsOperations - :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations - :vartype container_apps_auth_configs: - container_apps_api_client.operations.ContainerAppsAuthConfigsOperations + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: container_apps_api_client.operations.NamespacesOperations :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations :vartype managed_environments_storages: container_apps_api_client.operations.ManagedEnvironmentsStoragesOperations + :ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations + :vartype container_apps_source_controls: + container_apps_api_client.operations.ContainerAppsSourceControlsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. @@ -74,16 +76,17 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False + self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_revisions = ContainerAppsRevisionsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_revision_replicas = ContainerAppsRevisionReplicasOperations(self._client, self._config, self._serialize, self._deserialize) + self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.managed_environments = ManagedEnvironmentsOperations(self._client, self._config, self._serialize, self._deserialize) self.certificates = CertificatesOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.container_apps_source_controls = ContainerAppsSourceControlsOperations(self._client, self._config, self._serialize, self._deserialize) - self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations(self._client, self._config, self._serialize, self._deserialize) + self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_environments_storages = ManagedEnvironmentsStoragesOperations(self._client, self._config, self._serialize, self._deserialize) + self.container_apps_source_controls = ContainerAppsSourceControlsOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/_metadata.json b/sdk/app/azure-mgmt-app/azure/mgmt/app/_metadata.json index eeb87a80b677..c4db26bdd055 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/_metadata.json +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2022-01-01-preview", - "total_api_version_list": ["2022-01-01-preview"], + "chosen_version": "2022-03-01", + "total_api_version_list": ["2022-03-01"], "client": { "name": "ContainerAppsAPIClient", "filename": "_container_apps_api_client", @@ -97,15 +97,16 @@ "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { + "container_apps_auth_configs": "ContainerAppsAuthConfigsOperations", "container_apps": "ContainerAppsOperations", "container_apps_revisions": "ContainerAppsRevisionsOperations", "container_apps_revision_replicas": "ContainerAppsRevisionReplicasOperations", + "dapr_components": "DaprComponentsOperations", + "operations": "Operations", "managed_environments": "ManagedEnvironmentsOperations", "certificates": "CertificatesOperations", - "operations": "Operations", - "container_apps_source_controls": "ContainerAppsSourceControlsOperations", - "dapr_components": "DaprComponentsOperations", - "container_apps_auth_configs": "ContainerAppsAuthConfigsOperations", - "managed_environments_storages": "ManagedEnvironmentsStoragesOperations" + "namespaces": "NamespacesOperations", + "managed_environments_storages": "ManagedEnvironmentsStoragesOperations", + "container_apps_source_controls": "ContainerAppsSourceControlsOperations" } } \ No newline at end of file diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/_configuration.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/_configuration.py index ed19909a70d5..0a4b8fe89ba6 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/_configuration.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2022-01-01-preview" + self.api_version = "2022-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-app/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/_container_apps_api_client.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/_container_apps_api_client.py index f49b67610af1..66950254de80 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/_container_apps_api_client.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/_container_apps_api_client.py @@ -15,7 +15,7 @@ from .. import models from ._configuration import ContainerAppsAPIClientConfiguration -from .operations import CertificatesOperations, ContainerAppsAuthConfigsOperations, ContainerAppsOperations, ContainerAppsRevisionReplicasOperations, ContainerAppsRevisionsOperations, ContainerAppsSourceControlsOperations, DaprComponentsOperations, ManagedEnvironmentsOperations, ManagedEnvironmentsStoragesOperations, Operations +from .operations import CertificatesOperations, ContainerAppsAuthConfigsOperations, ContainerAppsOperations, ContainerAppsRevisionReplicasOperations, ContainerAppsRevisionsOperations, ContainerAppsSourceControlsOperations, DaprComponentsOperations, ManagedEnvironmentsOperations, ManagedEnvironmentsStoragesOperations, NamespacesOperations, Operations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -24,6 +24,9 @@ class ContainerAppsAPIClient: """ContainerAppsAPIClient. + :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations + :vartype container_apps_auth_configs: + container_apps_api_client.aio.operations.ContainerAppsAuthConfigsOperations :ivar container_apps: ContainerAppsOperations operations :vartype container_apps: container_apps_api_client.aio.operations.ContainerAppsOperations :ivar container_apps_revisions: ContainerAppsRevisionsOperations operations @@ -32,24 +35,23 @@ class ContainerAppsAPIClient: :ivar container_apps_revision_replicas: ContainerAppsRevisionReplicasOperations operations :vartype container_apps_revision_replicas: container_apps_api_client.aio.operations.ContainerAppsRevisionReplicasOperations + :ivar dapr_components: DaprComponentsOperations operations + :vartype dapr_components: container_apps_api_client.aio.operations.DaprComponentsOperations + :ivar operations: Operations operations + :vartype operations: container_apps_api_client.aio.operations.Operations :ivar managed_environments: ManagedEnvironmentsOperations operations :vartype managed_environments: container_apps_api_client.aio.operations.ManagedEnvironmentsOperations :ivar certificates: CertificatesOperations operations :vartype certificates: container_apps_api_client.aio.operations.CertificatesOperations - :ivar operations: Operations operations - :vartype operations: container_apps_api_client.aio.operations.Operations - :ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations - :vartype container_apps_source_controls: - container_apps_api_client.aio.operations.ContainerAppsSourceControlsOperations - :ivar dapr_components: DaprComponentsOperations operations - :vartype dapr_components: container_apps_api_client.aio.operations.DaprComponentsOperations - :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations - :vartype container_apps_auth_configs: - container_apps_api_client.aio.operations.ContainerAppsAuthConfigsOperations + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: container_apps_api_client.aio.operations.NamespacesOperations :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations :vartype managed_environments_storages: container_apps_api_client.aio.operations.ManagedEnvironmentsStoragesOperations + :ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations + :vartype container_apps_source_controls: + container_apps_api_client.aio.operations.ContainerAppsSourceControlsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. @@ -74,16 +76,17 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False + self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_revisions = ContainerAppsRevisionsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_revision_replicas = ContainerAppsRevisionReplicasOperations(self._client, self._config, self._serialize, self._deserialize) + self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.managed_environments = ManagedEnvironmentsOperations(self._client, self._config, self._serialize, self._deserialize) self.certificates = CertificatesOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.container_apps_source_controls = ContainerAppsSourceControlsOperations(self._client, self._config, self._serialize, self._deserialize) - self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations(self._client, self._config, self._serialize, self._deserialize) + self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_environments_storages = ManagedEnvironmentsStoragesOperations(self._client, self._config, self._serialize, self._deserialize) + self.container_apps_source_controls = ContainerAppsSourceControlsOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/operations/__init__.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/operations/__init__.py index 021cee48b4be..505be253220b 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/operations/__init__.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/operations/__init__.py @@ -6,26 +6,28 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations from ._container_apps_operations import ContainerAppsOperations from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations +from ._dapr_components_operations import DaprComponentsOperations +from ._operations import Operations from ._managed_environments_operations import ManagedEnvironmentsOperations from ._certificates_operations import CertificatesOperations -from ._operations import Operations -from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations -from ._dapr_components_operations import DaprComponentsOperations -from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations +from ._namespaces_operations import NamespacesOperations from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations +from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations __all__ = [ + 'ContainerAppsAuthConfigsOperations', 'ContainerAppsOperations', 'ContainerAppsRevisionsOperations', 'ContainerAppsRevisionReplicasOperations', + 'DaprComponentsOperations', + 'Operations', 'ManagedEnvironmentsOperations', 'CertificatesOperations', - 'Operations', - 'ContainerAppsSourceControlsOperations', - 'DaprComponentsOperations', - 'ContainerAppsAuthConfigsOperations', + 'NamespacesOperations', 'ManagedEnvironmentsStoragesOperations', + 'ContainerAppsSourceControlsOperations', ] diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/operations/_namespaces_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/operations/_namespaces_operations.py new file mode 100644 index 000000000000..03e496ab00c4 --- /dev/null +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/aio/operations/_namespaces_operations.py @@ -0,0 +1,108 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._namespaces_operations import build_check_name_availability_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NamespacesOperations: + """NamespacesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~container_apps_api_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def check_name_availability( + self, + resource_group_name: str, + managed_environment_name: str, + check_name_availability_request: "_models.CheckNameAvailabilityRequest", + **kwargs: Any + ) -> "_models.CheckNameAvailabilityResponse": + """Checks the resource name availability. + + Checks if resource name is available. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param managed_environment_name: Name of the Managed Environment. + :type managed_environment_name: str + :param check_name_availability_request: The check name availability request. + :type check_name_availability_request: + ~container_apps_api_client.models.CheckNameAvailabilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResponse, or the result of cls(response) + :rtype: ~container_apps_api_client.models.CheckNameAvailabilityResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(check_name_availability_request, 'CheckNameAvailabilityRequest') + + request = build_check_name_availability_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_environment_name=managed_environment_name, + content_type=content_type, + json=_json, + template_url=self.check_name_availability.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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('CheckNameAvailabilityResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName}/checkNameAvailability'} # type: ignore + diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/models/__init__.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/models/__init__.py index 97ddbb90753e..a1308a0b3c16 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/models/__init__.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/models/__init__.py @@ -28,6 +28,8 @@ from ._models_py3 import CertificateCollection from ._models_py3 import CertificatePatch from ._models_py3 import CertificateProperties +from ._models_py3 import CheckNameAvailabilityRequest +from ._models_py3 import CheckNameAvailabilityResponse from ._models_py3 import ClientRegistration from ._models_py3 import Configuration from ._models_py3 import Container @@ -119,6 +121,7 @@ AppProtocol, BindingType, CertificateProvisioningState, + CheckNameAvailabilityReason, ContainerAppProvisioningState, CookieExpirationConvention, CreatedByType, @@ -158,6 +161,8 @@ 'CertificateCollection', 'CertificatePatch', 'CertificateProperties', + 'CheckNameAvailabilityRequest', + 'CheckNameAvailabilityResponse', 'ClientRegistration', 'Configuration', 'Container', @@ -246,6 +251,7 @@ 'AppProtocol', 'BindingType', 'CertificateProvisioningState', + 'CheckNameAvailabilityReason', 'ContainerAppProvisioningState', 'CookieExpirationConvention', 'CreatedByType', diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/models/_container_apps_api_client_enums.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/models/_container_apps_api_client_enums.py index dfd7bb186bd7..cb84c380e8aa 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/models/_container_apps_api_client_enums.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/models/_container_apps_api_client_enums.py @@ -57,6 +57,13 @@ class CertificateProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, DELETE_FAILED = "DeleteFailed" PENDING = "Pending" +class CheckNameAvailabilityReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The reason why the given name is not available. + """ + + INVALID = "Invalid" + ALREADY_EXISTS = "AlreadyExists" + class ContainerAppProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Provisioning state of the Container App. """ diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/models/_models_py3.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/models/_models_py3.py index 56167390e75d..7700e43b3e09 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/models/_models_py3.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/models/_models_py3.py @@ -1162,6 +1162,79 @@ def __init__( self.public_key_hash = None +class CheckNameAvailabilityRequest(msrest.serialization.Model): + """The check availability request body. + + :ivar name: The name of the resource for which availability needs to be checked. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + """ + :keyword name: The name of the resource for which availability needs to be checked. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + """ + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CheckNameAvailabilityResponse(msrest.serialization.Model): + """The check availability result. + + :ivar name_available: Indicates if the resource name is available. + :vartype name_available: bool + :ivar reason: The reason why the given name is not available. Possible values include: + "Invalid", "AlreadyExists". + :vartype reason: str or ~container_apps_api_client.models.CheckNameAvailabilityReason + :ivar message: Detailed reason why the given name is available. + :vartype message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + name_available: Optional[bool] = None, + reason: Optional[Union[str, "CheckNameAvailabilityReason"]] = None, + message: Optional[str] = None, + **kwargs + ): + """ + :keyword name_available: Indicates if the resource name is available. + :paramtype name_available: bool + :keyword reason: The reason why the given name is not available. Possible values include: + "Invalid", "AlreadyExists". + :paramtype reason: str or ~container_apps_api_client.models.CheckNameAvailabilityReason + :keyword message: Detailed reason why the given name is available. + :paramtype message: str + """ + super(CheckNameAvailabilityResponse, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + class ClientRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have client ids and client secrets. @@ -4713,12 +4786,15 @@ class TrafficWeight(msrest.serialization.Model): :vartype weight: int :ivar latest_revision: Indicates that the traffic weight belongs to a latest stable revision. :vartype latest_revision: bool + :ivar label: Associates a traffic label with a revision. + :vartype label: str """ _attribute_map = { 'revision_name': {'key': 'revisionName', 'type': 'str'}, 'weight': {'key': 'weight', 'type': 'int'}, 'latest_revision': {'key': 'latestRevision', 'type': 'bool'}, + 'label': {'key': 'label', 'type': 'str'}, } def __init__( @@ -4727,6 +4803,7 @@ def __init__( revision_name: Optional[str] = None, weight: Optional[int] = None, latest_revision: Optional[bool] = False, + label: Optional[str] = None, **kwargs ): """ @@ -4737,11 +4814,14 @@ def __init__( :keyword latest_revision: Indicates that the traffic weight belongs to a latest stable revision. :paramtype latest_revision: bool + :keyword label: Associates a traffic label with a revision. + :paramtype label: str """ super(TrafficWeight, self).__init__(**kwargs) self.revision_name = revision_name self.weight = weight self.latest_revision = latest_revision + self.label = label class Twitter(msrest.serialization.Model): diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/__init__.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/__init__.py index 021cee48b4be..505be253220b 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/__init__.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/__init__.py @@ -6,26 +6,28 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations from ._container_apps_operations import ContainerAppsOperations from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations +from ._dapr_components_operations import DaprComponentsOperations +from ._operations import Operations from ._managed_environments_operations import ManagedEnvironmentsOperations from ._certificates_operations import CertificatesOperations -from ._operations import Operations -from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations -from ._dapr_components_operations import DaprComponentsOperations -from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations +from ._namespaces_operations import NamespacesOperations from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations +from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations __all__ = [ + 'ContainerAppsAuthConfigsOperations', 'ContainerAppsOperations', 'ContainerAppsRevisionsOperations', 'ContainerAppsRevisionReplicasOperations', + 'DaprComponentsOperations', + 'Operations', 'ManagedEnvironmentsOperations', 'CertificatesOperations', - 'Operations', - 'ContainerAppsSourceControlsOperations', - 'DaprComponentsOperations', - 'ContainerAppsAuthConfigsOperations', + 'NamespacesOperations', 'ManagedEnvironmentsStoragesOperations', + 'ContainerAppsSourceControlsOperations', ] diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_certificates_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_certificates_operations.py index a0d95b39d63c..9827b8b0ada6 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_certificates_operations.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_certificates_operations.py @@ -33,7 +33,7 @@ def build_list_request( managed_environment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName}/certificates') @@ -69,7 +69,7 @@ def build_get_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName}/certificates/{name}') @@ -111,7 +111,7 @@ def build_create_or_update_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName}/certificates/{name}') @@ -152,7 +152,7 @@ def build_delete_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName}/certificates/{name}') @@ -194,7 +194,7 @@ def build_update_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName}/certificates/{name}') diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_auth_configs_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_auth_configs_operations.py index 5cf790e91218..da9d516fa104 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_auth_configs_operations.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_auth_configs_operations.py @@ -33,7 +33,7 @@ def build_list_by_container_app_request( container_app_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs') @@ -69,7 +69,7 @@ def build_get_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{name}') @@ -111,7 +111,7 @@ def build_create_or_update_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{name}') @@ -152,7 +152,7 @@ def build_delete_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{name}') diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_operations.py index 84b483c37f78..d19efb2c57c1 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_operations.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_operations.py @@ -33,7 +33,7 @@ def build_list_by_subscription_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.App/containerApps') @@ -65,7 +65,7 @@ def build_list_by_resource_group_request( resource_group_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps') @@ -99,7 +99,7 @@ def build_get_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{name}') @@ -139,7 +139,7 @@ def build_create_or_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{name}') @@ -178,7 +178,7 @@ def build_delete_request_initial( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{name}') @@ -218,7 +218,7 @@ def build_update_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{name}') @@ -259,7 +259,7 @@ def build_list_custom_host_name_analysis_request( custom_hostname: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listCustomHostNameAnalysis') @@ -296,7 +296,7 @@ def build_list_secrets_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{name}/listSecrets') diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_revision_replicas_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_revision_replicas_operations.py index 7ed14ea71456..da9ada2f03e2 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_revision_replicas_operations.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_revision_replicas_operations.py @@ -33,7 +33,7 @@ def build_get_replica_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas/{name}') @@ -71,7 +71,7 @@ def build_list_replicas_request( revision_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas') diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_revisions_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_revisions_operations.py index 55acb0f3d9c7..d13e9f94eb1f 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_revisions_operations.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_revisions_operations.py @@ -32,7 +32,7 @@ def build_list_revisions_request( container_app_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions') @@ -68,7 +68,7 @@ def build_get_revision_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{name}') @@ -105,7 +105,7 @@ def build_activate_revision_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{name}/activate') @@ -142,7 +142,7 @@ def build_deactivate_revision_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{name}/deactivate') @@ -179,7 +179,7 @@ def build_restart_revision_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{name}/restart') diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_source_controls_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_source_controls_operations.py index 840a4c9f6839..b7e14c79378e 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_source_controls_operations.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_container_apps_source_controls_operations.py @@ -35,7 +35,7 @@ def build_list_by_container_app_request( container_app_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols') @@ -71,7 +71,7 @@ def build_get_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{name}') @@ -113,7 +113,7 @@ def build_create_or_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{name}') @@ -154,7 +154,7 @@ def build_delete_request_initial( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{name}') diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_dapr_components_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_dapr_components_operations.py index a61679d7fa61..b160f0d72e1b 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_dapr_components_operations.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_dapr_components_operations.py @@ -33,7 +33,7 @@ def build_list_request( environment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents') @@ -69,7 +69,7 @@ def build_get_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{name}') @@ -111,7 +111,7 @@ def build_create_or_update_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{name}') @@ -152,7 +152,7 @@ def build_delete_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{name}') diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_managed_environments_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_managed_environments_operations.py index e9846a028b32..046555825459 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_managed_environments_operations.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_managed_environments_operations.py @@ -33,7 +33,7 @@ def build_list_by_subscription_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.App/managedEnvironments') @@ -65,7 +65,7 @@ def build_list_by_resource_group_request( resource_group_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments') @@ -99,7 +99,7 @@ def build_get_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{name}') @@ -139,7 +139,7 @@ def build_create_or_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{name}') @@ -178,7 +178,7 @@ def build_delete_request_initial( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{name}') @@ -218,7 +218,7 @@ def build_update_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{name}') diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_managed_environments_storages_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_managed_environments_storages_operations.py index 065193077a23..4337975bffc1 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_managed_environments_storages_operations.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_managed_environments_storages_operations.py @@ -32,7 +32,7 @@ def build_list_request( env_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{envName}/storages') @@ -68,7 +68,7 @@ def build_get_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{envName}/storages/{name}') @@ -110,7 +110,7 @@ def build_create_or_update_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{envName}/storages/{name}') @@ -151,7 +151,7 @@ def build_delete_request( name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{envName}/storages/{name}') diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_namespaces_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_namespaces_operations.py new file mode 100644 index 000000000000..df5ec12d5d49 --- /dev/null +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_namespaces_operations.py @@ -0,0 +1,155 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_check_name_availability_request( + subscription_id: str, + resource_group_name: str, + managed_environment_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-03-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName}/checkNameAvailability') + path_format_arguments = { + "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), + "managedEnvironmentName": _SERIALIZER.url("managed_environment_name", managed_environment_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + +class NamespacesOperations(object): + """NamespacesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~container_apps_api_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def check_name_availability( + self, + resource_group_name: str, + managed_environment_name: str, + check_name_availability_request: "_models.CheckNameAvailabilityRequest", + **kwargs: Any + ) -> "_models.CheckNameAvailabilityResponse": + """Checks the resource name availability. + + Checks if resource name is available. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param managed_environment_name: Name of the Managed Environment. + :type managed_environment_name: str + :param check_name_availability_request: The check name availability request. + :type check_name_availability_request: + ~container_apps_api_client.models.CheckNameAvailabilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResponse, or the result of cls(response) + :rtype: ~container_apps_api_client.models.CheckNameAvailabilityResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(check_name_availability_request, 'CheckNameAvailabilityRequest') + + request = build_check_name_availability_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + managed_environment_name=managed_environment_name, + content_type=content_type, + json=_json, + template_url=self.check_name_availability.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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('CheckNameAvailabilityResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName}/checkNameAvailability'} # type: ignore + diff --git a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_operations.py b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_operations.py index a998d5f98846..cad0f7b8389f 100644 --- a/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_operations.py +++ b/sdk/app/azure-mgmt-app/azure/mgmt/app/operations/_operations.py @@ -29,7 +29,7 @@ def build_list_request( **kwargs: Any ) -> HttpRequest: - api_version = "2022-01-01-preview" + api_version = "2022-03-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/providers/Microsoft.App/operations')