diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/CHANGELOG.md b/sdk/appcontainers/azure-mgmt-appcontainers/CHANGELOG.md index 64f26aa77557..80183bb8b453 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/CHANGELOG.md +++ b/sdk/appcontainers/azure-mgmt-appcontainers/CHANGELOG.md @@ -1,5 +1,106 @@ # Release History +## 3.2.0b2 (2025-04-16) + +### Features Added + + - Client `ContainerAppsAPIClient` added operation group `container_apps_label_history` + - Client `ContainerAppsAPIClient` added operation group `http_route_config` + - Client `ContainerAppsAPIClient` added operation group `maintenance_configurations` + - Enum `ActiveRevisionsMode` added member `LABELS` + - Model `AzureFileProperties` added property `account_key_vault_properties` + - Enum `BindingType` added member `AUTO` + - Model `BlobStorageTokenStore` added property `blob_container_uri` + - Model `BlobStorageTokenStore` added property `client_id` + - Model `BlobStorageTokenStore` added property `managed_identity_resource_id` + - Model `CertificateProperties` added property `deployment_errors` + - Enum `CertificateProvisioningState` added member `DELETING` + - Model `Configuration` added property `target_label` + - Model `Configuration` added property `revision_transition_threshold` + - Model `ConnectedEnvironmentStorageProperties` added property `provisioning_state` + - Model `ConnectedEnvironmentStorageProperties` added property `deployment_errors` + - Model `ContainerApp` added property `running_status` + - Model `ContainerResources` added property `gpu` + - Model `Dapr` added property `app_health` + - Model `Dapr` added property `max_concurrency` + - Model `ManagedEnvironment` added property `private_link_default_domain` + - Model `ManagedEnvironment` added property `availability_zones` + - Model `ManagedEnvironment` added property `ingress_configuration` + - Model `Revision` added property `labels` + - Model `SessionPool` added property `identity` + - Model `SessionPool` added property `managed_identity_settings` + - Model `SessionPoolUpdatableProperties` added property `identity` + - Added model `ConnectedEnvironmentDaprComponent` + - Added model `ConnectedEnvironmentDaprComponentProperties` + - Added enum `ConnectedEnvironmentDaprComponentProvisioningState` + - Added model `ConnectedEnvironmentDaprComponentsCollection` + - Added model `ConnectedEnvironmentPatchResource` + - Added enum `ConnectedEnvironmentStorageProvisioningState` + - Added enum `ContainerAppRunningStatus` + - Added model `DaprAppHealth` + - Added model `DaprComponentProperties` + - Added model `HttpRoute` + - Added model `HttpRouteAction` + - Added model `HttpRouteConfig` + - Added model `HttpRouteConfigCollection` + - Added model `HttpRouteConfigProperties` + - Added model `HttpRouteMatch` + - Added model `HttpRouteProvisioningErrors` + - Added enum `HttpRouteProvisioningState` + - Added model `HttpRouteRule` + - Added model `HttpRouteTarget` + - Added model `IngressConfiguration` + - Added model `IngressConfigurationScale` + - Added model `LabelHistory` + - Added model `LabelHistoryCollection` + - Added model `LabelHistoryProperties` + - Added model `LabelHistoryRecordItem` + - Added model `MaintenanceConfigurationCollection` + - Added model `MaintenanceConfigurationResource` + - Added model `ManagedIdentitySetting` + - Added model `ResourceTags` + - Added model `ScheduledEntry` + - Added model `SecretKeyVaultProperties` + - Added enum `Status` + - Added enum `WeekDay` + - Model `ConnectedEnvironmentsCertificatesOperations` added method `begin_create_or_update` + - Model `ConnectedEnvironmentsCertificatesOperations` added method `begin_delete` + - Model `ConnectedEnvironmentsCertificatesOperations` added method `begin_update` + - Model `ConnectedEnvironmentsDaprComponentsOperations` added method `begin_create_or_update` + - Model `ConnectedEnvironmentsDaprComponentsOperations` added method `begin_delete` + - Model `ConnectedEnvironmentsStoragesOperations` added method `begin_create_or_update` + - Model `ConnectedEnvironmentsStoragesOperations` added method `begin_delete` + - Added model `ContainerAppsLabelHistoryOperations` + - Added model `HttpRouteConfigOperations` + - Added model `MaintenanceConfigurationsOperations` + - Method `ConnectedEnvironmentsCertificatesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, connected_environment_name: str, certificate_name: str, certificate_envelope: Optional[Certificate], content_type: str)` + - Method `ConnectedEnvironmentsCertificatesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, connected_environment_name: str, certificate_name: str, certificate_envelope: Optional[IO[bytes]], content_type: str)` + - Method `ConnectedEnvironmentsCertificatesOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, connected_environment_name: str, certificate_name: str, certificate_envelope: CertificatePatch, content_type: str)` + - Method `ConnectedEnvironmentsCertificatesOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, connected_environment_name: str, certificate_name: str, certificate_envelope: IO[bytes], content_type: str)` + - Method `ConnectedEnvironmentsDaprComponentsOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, connected_environment_name: str, component_name: str, dapr_component_envelope: ConnectedEnvironmentDaprComponent, content_type: str)` + - Method `ConnectedEnvironmentsDaprComponentsOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, connected_environment_name: str, component_name: str, dapr_component_envelope: IO[bytes], content_type: str)` + - Method `ConnectedEnvironmentsOperations.update` has a new overload `def update(self: None, resource_group_name: str, connected_environment_name: str, environment_envelope: Optional[ConnectedEnvironmentPatchResource], content_type: str)` + - Method `ConnectedEnvironmentsOperations.update` has a new overload `def update(self: None, resource_group_name: str, connected_environment_name: str, environment_envelope: Optional[IO[bytes]], content_type: str)` + - Method `ConnectedEnvironmentsStoragesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, connected_environment_name: str, storage_name: str, storage_envelope: ConnectedEnvironmentStorage, content_type: str)` + - Method `ConnectedEnvironmentsStoragesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, connected_environment_name: str, storage_name: str, storage_envelope: IO[bytes], content_type: str)` + - Method `HttpRouteConfigOperations.create_or_update` has a new overload `def create_or_update(self: None, resource_group_name: str, environment_name: str, http_route_name: str, http_route_config_envelope: Optional[HttpRouteConfig], content_type: str)` + - Method `HttpRouteConfigOperations.create_or_update` has a new overload `def create_or_update(self: None, resource_group_name: str, environment_name: str, http_route_name: str, http_route_config_envelope: Optional[IO[bytes]], content_type: str)` + - Method `HttpRouteConfigOperations.update` has a new overload `def update(self: None, resource_group_name: str, environment_name: str, http_route_name: str, http_route_config_envelope: HttpRouteConfig, content_type: str)` + - Method `HttpRouteConfigOperations.update` has a new overload `def update(self: None, resource_group_name: str, environment_name: str, http_route_name: str, http_route_config_envelope: IO[bytes], content_type: str)` + - Method `MaintenanceConfigurationsOperations.create_or_update` has a new overload `def create_or_update(self: None, resource_group_name: str, environment_name: str, config_name: str, maintenance_configuration_envelope: MaintenanceConfigurationResource, content_type: str)` + - Method `MaintenanceConfigurationsOperations.create_or_update` has a new overload `def create_or_update(self: None, resource_group_name: str, environment_name: str, config_name: str, maintenance_configuration_envelope: IO[bytes], content_type: str)` + +### Breaking Changes + + - Method `IdentitySettings.__init__` parameter `lifecycle` changed default value from `str` to `none` + - Deleted or renamed method `ConnectedEnvironmentsCertificatesOperations.create_or_update` + - Deleted or renamed method `ConnectedEnvironmentsCertificatesOperations.delete` + - Deleted or renamed method `ConnectedEnvironmentsCertificatesOperations.update` + - Deleted or renamed method `ConnectedEnvironmentsDaprComponentsOperations.create_or_update` + - Deleted or renamed method `ConnectedEnvironmentsDaprComponentsOperations.delete` + - Deleted or renamed method `ConnectedEnvironmentsStoragesOperations.create_or_update` + - Deleted or renamed method `ConnectedEnvironmentsStoragesOperations.delete` + ## 3.2.0b1 (2024-10-28) ### Features Added diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/README.md b/sdk/appcontainers/azure-mgmt-appcontainers/README.md index 2fa72cb90b2b..7cef05198e74 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/README.md +++ b/sdk/appcontainers/azure-mgmt-appcontainers/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Appcontainers Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.9+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.9+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json index cc1c882ac2c4..36b71ea98f08 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json +++ b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json @@ -1,11 +1,11 @@ { - "commit": "c3f246bece34c122def67e59945e634490f205fe", + "commit": "2364f10d58c6f03df3ac1d52a788af5ea9685ace", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.19.0", + "@autorest/python@6.32.3", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --generate-test=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.32.3 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --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/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py index 4b355a70ac13..70129350215c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._container_apps_api_client import ContainerAppsAPIClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._container_apps_api_client import ContainerAppsAPIClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "ContainerAppsAPIClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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 af2e666061c1..9dfadbf55077 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py @@ -14,11 +14,10 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for ContainerAppsAPIClient. Note that all parameters used to create this instance are saved as instance @@ -28,13 +27,13 @@ class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-08-02-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-02-preview". 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", "2024-08-02-preview") + api_version: str = kwargs.pop("api_version", "2025-02-02-preview") 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 c9c41bc93026..37a02f56aa0b 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 @@ -36,6 +36,7 @@ ContainerAppsBuildsByContainerAppOperations, ContainerAppsBuildsOperations, ContainerAppsDiagnosticsOperations, + ContainerAppsLabelHistoryOperations, ContainerAppsOperations, ContainerAppsPatchesOperations, ContainerAppsRevisionReplicasOperations, @@ -47,10 +48,12 @@ DaprSubscriptionsOperations, DotNetComponentsOperations, FunctionsExtensionOperations, + HttpRouteConfigOperations, JavaComponentsOperations, JobsExecutionsOperations, JobsOperations, LogicAppsOperations, + MaintenanceConfigurationsOperations, ManagedCertificatesOperations, ManagedEnvironmentDiagnosticsOperations, ManagedEnvironmentPrivateEndpointConnectionsOperations, @@ -65,13 +68,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ContainerAppsAPIClient( - ContainerAppsAPIClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class ContainerAppsAPIClient(ContainerAppsAPIClientOperationsMixin): # pylint: disable=too-many-instance-attributes """Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions extension resource. @@ -118,6 +118,9 @@ class ContainerAppsAPIClient( :ivar container_apps_builds: ContainerAppsBuildsOperations operations :vartype container_apps_builds: azure.mgmt.appcontainers.operations.ContainerAppsBuildsOperations + :ivar container_apps_label_history: ContainerAppsLabelHistoryOperations operations + :vartype container_apps_label_history: + azure.mgmt.appcontainers.operations.ContainerAppsLabelHistoryOperations :ivar container_apps_patches: ContainerAppsPatchesOperations operations :vartype container_apps_patches: azure.mgmt.appcontainers.operations.ContainerAppsPatchesOperations @@ -175,6 +178,11 @@ class ContainerAppsAPIClient( :vartype dapr_components: azure.mgmt.appcontainers.operations.DaprComponentsOperations :ivar dapr_subscriptions: DaprSubscriptionsOperations operations :vartype dapr_subscriptions: azure.mgmt.appcontainers.operations.DaprSubscriptionsOperations + :ivar http_route_config: HttpRouteConfigOperations operations + :vartype http_route_config: azure.mgmt.appcontainers.operations.HttpRouteConfigOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.appcontainers.operations.MaintenanceConfigurationsOperations :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations :vartype managed_environments_storages: azure.mgmt.appcontainers.operations.ManagedEnvironmentsStoragesOperations @@ -195,7 +203,7 @@ class ContainerAppsAPIClient( :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 "2024-08-02-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-02-preview". 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 @@ -269,6 +277,9 @@ def __init__( self.container_apps_builds = ContainerAppsBuildsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.container_apps_label_history = ContainerAppsLabelHistoryOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.container_apps_patches = ContainerAppsPatchesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -319,6 +330,12 @@ def __init__( self.dapr_subscriptions = DaprSubscriptionsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.http_route_config = HttpRouteConfigOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_environments_storages = ManagedEnvironmentsStoragesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py index 8139854b97bb..f5187701d7be 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py @@ -1,30 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# 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. # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -48,11 +30,8 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, - Mapping, ) try: @@ -62,13 +41,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -91,6 +70,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :param data: Input, could be bytes or stream (will be decoded with UTF8) or text :type data: str or bytes or IO :param str content_type: The content type. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +93,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -155,6 +136,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -179,80 +165,31 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0.""" - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation.""" - return "Z" - - def dst(self, dt): - """No daylight saving for UTC.""" - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? None: self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) elif k in self._validation and self._validation[k].get("readonly", False): @@ -300,13 +244,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -326,7 +280,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -346,7 +304,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, @@ -380,12 +340,15 @@ def my_key_transformer(key, attr_desc, value): If you want XML serialization, you can pass the kwargs is_xml=True. + :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -395,30 +358,31 @@ def _infer_class_models(cls): client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") - except Exception: + except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -426,9 +390,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -448,21 +414,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -501,11 +471,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -540,7 +512,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -560,13 +532,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -592,12 +567,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": @@ -633,7 +610,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace @@ -664,17 +642,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -703,7 +681,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -712,11 +690,13 @@ def body(self, data, data_type, **kwargs): def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. - :param data: The data to be serialized. + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -728,21 +708,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. - :param data: The data to be serialized. + :param str name: The name of the query parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :keyword bool skip_quote: Whether to skip quote the serialized result. - Defaults to False. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -759,19 +738,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. - :param data: The data to be serialized. + :param str name: The name of the header. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -780,21 +760,20 @@ def header(self, name, data, data_type, **kwargs): output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -805,7 +784,7 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class @@ -821,11 +800,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -841,23 +819,26 @@ def serialize_basic(cls, data, data_type, **kwargs): - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers - :param data: Object to be serialized. + :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec + return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. - :param data: Object to be serialized. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -871,8 +852,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -882,15 +862,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML - :param list attr: Object to be serialized. + :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. - :keyword bool do_quote: Whether to quote the serialized result of each iterable element. Defaults to False. :rtype: list, str + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -945,9 +923,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. :rtype: dict + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -971,7 +948,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be @@ -979,6 +956,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1003,7 +981,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1034,56 +1012,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1091,11 +1074,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1105,30 +1089,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. + :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1141,12 +1127,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1172,13 +1159,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1186,11 +1174,11 @@ def serialize_unix(attr, **kwargs): if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument key = attr_desc["key"] working_data = data @@ -1211,7 +1199,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1232,17 +1222,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): return attribute_key_case_insensitive_extractor(key, None, working_data) -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1279,7 +1281,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1331,22 +1333,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name ) - return list(children[0]) # Might be empty list and that's ok. + ) + return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: @@ -1354,7 +1355,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1363,9 +1364,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1401,27 +1402,29 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: - for attr, mapconfig in data._attribute_map.items(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1440,13 +1443,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1476,9 +1479,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: @@ -1505,6 +1507,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1516,7 +1520,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1531,10 +1535,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1552,10 +1558,12 @@ def _unpack_content(raw_data, content_type=None): If raw_data is something else, bypass all logic and return it directly. - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1579,24 +1587,35 @@ def _unpack_content(raw_data, content_type=None): def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. - :param response: The response model class. - :param d_attrs: The deserialized response attributes. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1605,15 +1624,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1627,7 +1647,11 @@ def deserialize_data(self, data, data_type): if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) @@ -1647,14 +1671,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1671,6 +1695,7 @@ def deserialize_dict(self, attr, dict_type): :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1681,13 +1706,14 @@ def deserialize_dict(self, attr, dict_type): attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - def deserialize_object(self, attr, **kwargs): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1720,11 +1746,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as @@ -1732,8 +1757,9 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1743,24 +1769,23 @@ def deserialize_basic(self, attr, data_type): if data_type == "str": # None or '', node is empty string. return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec + return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): @@ -1768,6 +1793,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1781,8 +1807,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1794,6 +1819,7 @@ def deserialize_enum(data, enum_obj): :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1804,9 +1830,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1822,8 +1848,9 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1834,8 +1861,9 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1849,8 +1877,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal - :raises: DeserializationError if string format invalid. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1865,8 +1894,9 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1877,8 +1907,9 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1887,16 +1918,16 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1910,8 +1941,9 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1924,31 +1956,32 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1976,8 +2009,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1985,8 +2017,9 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore @@ -1996,5 +2029,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py index 869b8cac8a5e..9835aee9cecc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py @@ -11,7 +11,6 @@ from ._configuration import ContainerAppsAPIClientConfiguration if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core import PipelineClient from ._serialization import Deserializer, Serializer 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 e46fe87dc038..934b3800ca1f 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.2.0b1" +VERSION = "3.2.0b2" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py index 50b245b83bea..a56355c91250 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._container_apps_api_client import ContainerAppsAPIClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._container_apps_api_client import ContainerAppsAPIClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "ContainerAppsAPIClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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 8cae65231135..47f5edc35d1e 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 @@ -14,11 +14,10 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for ContainerAppsAPIClient. Note that all parameters used to create this instance are saved as instance @@ -28,13 +27,13 @@ class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance- :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-08-02-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-02-preview". 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", "2024-08-02-preview") + api_version: str = kwargs.pop("api_version", "2025-02-02-preview") 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 3bec301c96c4..1a66caa6ba76 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 @@ -36,6 +36,7 @@ ContainerAppsBuildsByContainerAppOperations, ContainerAppsBuildsOperations, ContainerAppsDiagnosticsOperations, + ContainerAppsLabelHistoryOperations, ContainerAppsOperations, ContainerAppsPatchesOperations, ContainerAppsRevisionReplicasOperations, @@ -47,10 +48,12 @@ DaprSubscriptionsOperations, DotNetComponentsOperations, FunctionsExtensionOperations, + HttpRouteConfigOperations, JavaComponentsOperations, JobsExecutionsOperations, JobsOperations, LogicAppsOperations, + MaintenanceConfigurationsOperations, ManagedCertificatesOperations, ManagedEnvironmentDiagnosticsOperations, ManagedEnvironmentPrivateEndpointConnectionsOperations, @@ -65,13 +68,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ContainerAppsAPIClient( - ContainerAppsAPIClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class ContainerAppsAPIClient(ContainerAppsAPIClientOperationsMixin): # pylint: disable=too-many-instance-attributes """Functions is an extension resource to revisions and the api listed is used to proxy the call from Web RP to the function app's host process, this api is not exposed to users and only Web RP is allowed to invoke functions extension resource. @@ -118,6 +118,9 @@ class ContainerAppsAPIClient( :ivar container_apps_builds: ContainerAppsBuildsOperations operations :vartype container_apps_builds: azure.mgmt.appcontainers.aio.operations.ContainerAppsBuildsOperations + :ivar container_apps_label_history: ContainerAppsLabelHistoryOperations operations + :vartype container_apps_label_history: + azure.mgmt.appcontainers.aio.operations.ContainerAppsLabelHistoryOperations :ivar container_apps_patches: ContainerAppsPatchesOperations operations :vartype container_apps_patches: azure.mgmt.appcontainers.aio.operations.ContainerAppsPatchesOperations @@ -177,6 +180,11 @@ class ContainerAppsAPIClient( :ivar dapr_subscriptions: DaprSubscriptionsOperations operations :vartype dapr_subscriptions: azure.mgmt.appcontainers.aio.operations.DaprSubscriptionsOperations + :ivar http_route_config: HttpRouteConfigOperations operations + :vartype http_route_config: azure.mgmt.appcontainers.aio.operations.HttpRouteConfigOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.appcontainers.aio.operations.MaintenanceConfigurationsOperations :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations :vartype managed_environments_storages: azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsStoragesOperations @@ -197,7 +205,7 @@ class ContainerAppsAPIClient( :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 "2024-08-02-preview". Note that overriding + :keyword api_version: Api Version. Default value is "2025-02-02-preview". 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 @@ -271,6 +279,9 @@ def __init__( self.container_apps_builds = ContainerAppsBuildsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.container_apps_label_history = ContainerAppsLabelHistoryOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.container_apps_patches = ContainerAppsPatchesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -321,6 +332,12 @@ def __init__( self.dapr_subscriptions = DaprSubscriptionsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.http_route_config = HttpRouteConfigOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_environments_storages = ManagedEnvironmentsStoragesOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py index 4345e924ce42..e77fe7aa38a5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py @@ -11,7 +11,6 @@ from ._configuration import ContainerAppsAPIClientConfiguration if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core import AsyncPipelineClient from .._serialization import Deserializer, Serializer 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 f105aaf0a686..7ae6a62ff715 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,55 +6,62 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -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 -from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations -from ._container_apps_operations import ContainerAppsOperations -from ._container_apps_builds_by_container_app_operations import ContainerAppsBuildsByContainerAppOperations -from ._container_apps_builds_operations import ContainerAppsBuildsOperations -from ._container_apps_patches_operations import ContainerAppsPatchesOperations -from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations -from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations -from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations -from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations -from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations -from ._jobs_operations import JobsOperations -from ._dot_net_components_operations import DotNetComponentsOperations -from ._functions_extension_operations import FunctionsExtensionOperations -from ._operations import Operations -from ._java_components_operations import JavaComponentsOperations -from ._jobs_executions_operations import JobsExecutionsOperations -from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin -from ._logic_apps_operations import LogicAppsOperations -from ._managed_environments_operations import ManagedEnvironmentsOperations -from ._certificates_operations import CertificatesOperations -from ._managed_certificates_operations import ManagedCertificatesOperations -from ._namespaces_operations import NamespacesOperations -from ._managed_environment_private_endpoint_connections_operations import ( - ManagedEnvironmentPrivateEndpointConnectionsOperations, -) -from ._managed_environment_private_link_resources_operations import ManagedEnvironmentPrivateLinkResourcesOperations -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_session_pools_operations import ContainerAppsSessionPoolsOperations -from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations -from ._usages_operations import UsagesOperations -from ._managed_environment_usages_operations import ManagedEnvironmentUsagesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._app_resiliency_operations import AppResiliencyOperations # type: ignore +from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations # type: ignore +from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations # type: ignore +from ._billing_meters_operations import BillingMetersOperations # type: ignore +from ._builders_operations import BuildersOperations # type: ignore +from ._builds_by_builder_resource_operations import BuildsByBuilderResourceOperations # type: ignore +from ._builds_operations import BuildsOperations # type: ignore +from ._build_auth_token_operations import BuildAuthTokenOperations # type: ignore +from ._connected_environments_operations import ConnectedEnvironmentsOperations # type: ignore +from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations # type: ignore +from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations # type: ignore +from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations # type: ignore +from ._container_apps_operations import ContainerAppsOperations # type: ignore +from ._container_apps_builds_by_container_app_operations import ContainerAppsBuildsByContainerAppOperations # type: ignore +from ._container_apps_builds_operations import ContainerAppsBuildsOperations # type: ignore +from ._container_apps_label_history_operations import ContainerAppsLabelHistoryOperations # type: ignore +from ._container_apps_patches_operations import ContainerAppsPatchesOperations # type: ignore +from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations # type: ignore +from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations # type: ignore +from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations # type: ignore +from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations # type: ignore +from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations # type: ignore +from ._jobs_operations import JobsOperations # type: ignore +from ._dot_net_components_operations import DotNetComponentsOperations # type: ignore +from ._functions_extension_operations import FunctionsExtensionOperations # type: ignore +from ._operations import Operations # type: ignore +from ._java_components_operations import JavaComponentsOperations # type: ignore +from ._jobs_executions_operations import JobsExecutionsOperations # type: ignore +from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin # type: ignore +from ._logic_apps_operations import LogicAppsOperations # type: ignore +from ._managed_environments_operations import ManagedEnvironmentsOperations # type: ignore +from ._certificates_operations import CertificatesOperations # type: ignore +from ._managed_certificates_operations import ManagedCertificatesOperations # type: ignore +from ._namespaces_operations import NamespacesOperations # type: ignore +from ._managed_environment_private_endpoint_connections_operations import ManagedEnvironmentPrivateEndpointConnectionsOperations # type: ignore +from ._managed_environment_private_link_resources_operations import ManagedEnvironmentPrivateLinkResourcesOperations # type: ignore +from ._dapr_component_resiliency_policies_operations import DaprComponentResiliencyPoliciesOperations # type: ignore +from ._dapr_components_operations import DaprComponentsOperations # type: ignore +from ._dapr_subscriptions_operations import DaprSubscriptionsOperations # type: ignore +from ._http_route_config_operations import HttpRouteConfigOperations # type: ignore +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations # type: ignore +from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations # type: ignore +from ._container_apps_session_pools_operations import ContainerAppsSessionPoolsOperations # type: ignore +from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations # type: ignore +from ._usages_operations import UsagesOperations # type: ignore +from ._managed_environment_usages_operations import ManagedEnvironmentUsagesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -72,6 +80,7 @@ "ContainerAppsOperations", "ContainerAppsBuildsByContainerAppOperations", "ContainerAppsBuildsOperations", + "ContainerAppsLabelHistoryOperations", "ContainerAppsPatchesOperations", "ContainerAppsRevisionsOperations", "ContainerAppsRevisionReplicasOperations", @@ -95,11 +104,13 @@ "DaprComponentResiliencyPoliciesOperations", "DaprComponentsOperations", "DaprSubscriptionsOperations", + "HttpRouteConfigOperations", + "MaintenanceConfigurationsOperations", "ManagedEnvironmentsStoragesOperations", "ContainerAppsSessionPoolsOperations", "ContainerAppsSourceControlsOperations", "UsagesOperations", "ManagedEnvironmentUsagesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _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 index 4ca3515c3463..2c618098c4b1 100644 --- 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._app_resiliency_operations import ( build_create_or_update_request, build_delete_request, @@ -35,11 +36,8 @@ build_list_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -58,10 +56,10 @@ class AppResiliencyOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload async def create_or_update( @@ -154,7 +152,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.AppResiliency :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +299,7 @@ async def update( :rtype: ~azure.mgmt.appcontainers.models.AppResiliency :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -358,9 +356,7 @@ async def update( 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: + async def delete(self, resource_group_name: str, app_name: str, name: str, **kwargs: Any) -> None: """Delete an application's resiliency policy. Delete container app resiliency policy. @@ -376,7 +372,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +429,7 @@ async def get(self, resource_group_name: str, app_name: str, name: str, **kwargs :rtype: ~azure.mgmt.appcontainers.models.AppResiliency :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -498,7 +494,7 @@ def list(self, resource_group_name: str, app_name: str, **kwargs: Any) -> AsyncI 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py index 007b7f9e95dc..a00637f4dd1c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._available_workload_profiles_operations import build_get_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,10 +48,10 @@ class AvailableWorkloadProfilesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AvailableWorkloadProfile"]: @@ -75,7 +73,7 @@ def get(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AvailableW api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AvailableWorkloadProfilesCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py index 11596186fb1a..b19e6363b1d8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +24,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._billing_meters_operations import build_get_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,10 +46,10 @@ class BillingMetersOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get(self, location: str, **kwargs: Any) -> _models.BillingMeterCollection: @@ -65,7 +63,7 @@ async def get(self, location: str, **kwargs: Any) -> _models.BillingMeterCollect :rtype: ~azure.mgmt.appcontainers.models.BillingMeterCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index a875471941c0..a388bef3d460 100644 --- 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +24,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._build_auth_token_operations import build_list_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,10 +46,10 @@ class BuildAuthTokenOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def list( @@ -70,7 +68,7 @@ async def list( :rtype: ~azure.mgmt.appcontainers.models.BuildToken :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index 5d01584d4431..af66c3f284bc 100644 --- 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._builders_operations import ( build_create_or_update_request, build_delete_request, @@ -40,11 +41,8 @@ build_list_by_subscription_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,10 +61,10 @@ class BuildersOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.BuilderResource"]: @@ -83,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.BuilderR 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +162,7 @@ def list_by_resource_group( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +237,7 @@ async def get(self, resource_group_name: str, builder_name: str, **kwargs: Any) :rtype: ~azure.mgmt.appcontainers.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -289,7 +287,7 @@ async def _create_or_update_initial( builder_envelope: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -491,7 +489,7 @@ async def _update_initial( builder_envelope: Union[_models.BuilderResourceUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +682,7 @@ def get_long_running_output(pipeline_response): ) async def _delete_initial(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index 56a53acdbbfb..19d0b8649b8d 100644 --- 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._builds_by_builder_resource_operations import build_list_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,10 +48,10 @@ class BuildsByBuilderResourceOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -76,7 +74,7 @@ def list( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index 72103545763f..7a93cd21df1d 100644 --- 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -29,12 +29,10 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._builds_operations import build_create_or_update_request, build_delete_request, build_get_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,10 +51,10 @@ class BuildsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get( @@ -75,7 +73,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.BuildResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -127,7 +125,7 @@ async def _create_or_update_initial( build_envelope: Union[_models.BuildResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +334,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py index bada5159b51f..998cc3cadb8f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._certificates_operations import ( build_create_or_update_request, build_delete_request, @@ -35,11 +36,8 @@ build_list_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -58,10 +56,10 @@ class CertificatesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -86,7 +84,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +301,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +361,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, environment_name: str, certificate_name: str, **kwargs: Any ) -> None: """Deletes the specified Certificate. @@ -381,7 +379,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +510,7 @@ async def update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py index 963c94331810..c99f356228c0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,16 +18,21 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, 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 ..._serialization import Deserializer, Serializer from ...operations._connected_environments_certificates_operations import ( build_create_or_update_request, build_delete_request, @@ -35,11 +40,8 @@ build_list_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -58,10 +60,10 @@ class ConnectedEnvironmentsCertificatesOperations: # pylint: disable=name-too-l 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -86,7 +88,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +170,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -212,8 +214,80 @@ async def get( return deserialized # type: ignore + async def _create_or_update_initial( + self, + resource_group_name: str, + connected_environment_name: str, + certificate_name: str, + certificate_envelope: Optional[Union[_models.Certificate, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(certificate_envelope, (IOBase, bytes)): + _content = certificate_envelope + else: + if certificate_envelope is not None: + _json = self._serialize.body(certificate_envelope, "Certificate") + else: + _json = None + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, @@ -222,7 +296,7 @@ async def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Certificate: + ) -> AsyncLROPoller[_models.Certificate]: """Create or Update a Certificate. Create or Update a Certificate. @@ -239,13 +313,14 @@ async def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of AsyncLROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, @@ -254,7 +329,7 @@ async def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Certificate: + ) -> AsyncLROPoller[_models.Certificate]: """Create or Update a Certificate. Create or Update a Certificate. @@ -271,20 +346,21 @@ async def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of AsyncLROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, certificate_name: str, certificate_envelope: Optional[Union[_models.Certificate, IO[bytes]]] = None, **kwargs: Any - ) -> _models.Certificate: + ) -> AsyncLROPoller[_models.Certificate]: """Create or Update a Certificate. Create or Update a Certificate. @@ -299,11 +375,66 @@ async def create_or_update( :param certificate_envelope: Certificate to be created or updated. Is either a Certificate type or a IO[bytes] type. Default value is None. :type certificate_envelope: ~azure.mgmt.appcontainers.models.Certificate or IO[bytes] - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of AsyncLROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[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.Certificate] = 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, + connected_environment_name=connected_environment_name, + certificate_name=certificate_name, + certificate_envelope=certificate_envelope, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Certificate", pipeline_response.http_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.Certificate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Certificate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, connected_environment_name: str, certificate_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,61 +442,55 @@ async def create_or_update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = 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.Certificate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(certificate_envelope, (IOBase, bytes)): - _content = certificate_envelope - else: - if certificate_envelope is not None: - _json = self._serialize.body(certificate_envelope, "Certificate") - else: - _json = None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_create_or_update_request( + _request = build_delete_request( resource_group_name=resource_group_name, connected_environment_name=connected_environment_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("Certificate", pipeline_response.http_response) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def begin_delete( self, resource_group_name: str, connected_environment_name: str, certificate_name: str, **kwargs: Any - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes the specified Certificate. Deletes the specified Certificate. @@ -377,11 +502,62 @@ async def delete( # pylint: disable=inconsistent-return-statements :type connected_environment_name: str :param certificate_name: Name of the Certificate. Required. :type certificate_name: str - :return: None or the result of cls(response) - :rtype: None + :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: """ - error_map: MutableMapping[int, Type[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( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + certificate_name=certificate_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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 + + async def _update_initial( + self, + resource_group_name: str, + connected_environment_name: str, + certificate_name: str, + certificate_envelope: Union[_models.CertificatePatch, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,40 +565,65 @@ async def delete( # pylint: disable=inconsistent-return-statements } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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)) - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_delete_request( + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(certificate_envelope, (IOBase, bytes)): + _content = certificate_envelope + else: + _json = self._serialize.body(certificate_envelope, "CertificatePatch") + + _request = build_update_request( resource_group_name=resource_group_name, connected_environment_name=connected_environment_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + 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")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @overload - async def update( + async def begin_update( self, resource_group_name: str, connected_environment_name: str, @@ -431,7 +632,7 @@ async def update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Certificate: + ) -> AsyncLROPoller[_models.Certificate]: """Update properties of a certificate. Patches a certificate. Currently only patching of tags is supported. @@ -448,13 +649,14 @@ async def update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of AsyncLROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def update( + async def begin_update( self, resource_group_name: str, connected_environment_name: str, @@ -463,7 +665,7 @@ async def update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Certificate: + ) -> AsyncLROPoller[_models.Certificate]: """Update properties of a certificate. Patches a certificate. Currently only patching of tags is supported. @@ -480,20 +682,21 @@ async def update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of AsyncLROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def update( + async def begin_update( self, resource_group_name: str, connected_environment_name: str, certificate_name: str, certificate_envelope: Union[_models.CertificatePatch, IO[bytes]], **kwargs: Any - ) -> _models.Certificate: + ) -> AsyncLROPoller[_models.Certificate]: """Update properties of a certificate. Patches a certificate. Currently only patching of tags is supported. @@ -508,62 +711,57 @@ async def update( :param certificate_envelope: Properties of a certificate that need to be updated. Is either a CertificatePatch type or a IO[bytes] type. Required. :type certificate_envelope: ~azure.mgmt.appcontainers.models.CertificatePatch or IO[bytes] - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of AsyncLROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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.Certificate] = 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, + connected_environment_name=connected_environment_name, + certificate_name=certificate_name, + certificate_envelope=certificate_envelope, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(certificate_envelope, (IOBase, bytes)): - _content = certificate_envelope - else: - _json = self._serialize.body(certificate_envelope, "CertificatePatch") - - _request = build_update_request( - resource_group_name=resource_group_name, - connected_environment_name=connected_environment_name, - certificate_name=certificate_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Certificate", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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.Certificate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Certificate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - 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("Certificate", pipeline_response.http_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/_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py index d892729a6bac..86ac9606d95c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -18,16 +18,21 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, 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 ..._serialization import Deserializer, Serializer from ...operations._connected_environments_dapr_components_operations import ( build_create_or_update_request, build_delete_request, @@ -35,11 +40,8 @@ build_list_request, build_list_secrets_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -58,15 +60,15 @@ class ConnectedEnvironmentsDaprComponentsOperations: # pylint: disable=name-too 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( self, resource_group_name: str, connected_environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DaprComponent"]: + ) -> AsyncIterable["_models.ConnectedEnvironmentDaprComponent"]: """Get the Dapr Components for a connected environment. Get the Dapr Components for a connected environment. @@ -76,17 +78,19 @@ def list( :type resource_group_name: str :param connected_environment_name: Name of the connected environment. Required. :type connected_environment_name: str - :return: An iterator like instance of either DaprComponent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.DaprComponent] + :return: An iterator like instance of either ConnectedEnvironmentDaprComponent or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent] :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.DaprComponentsCollection] = kwargs.pop("cls", None) + cls: ClsType[_models.ConnectedEnvironmentDaprComponentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -125,7 +129,7 @@ def prepare_request(next_link=None): return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("DaprComponentsCollection", pipeline_response) + deserialized = self._deserialize("ConnectedEnvironmentDaprComponentsCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -152,7 +156,7 @@ async def get_next(next_link=None): @distributed_trace_async async def get( self, resource_group_name: str, connected_environment_name: str, component_name: str, **kwargs: Any - ) -> _models.DaprComponent: + ) -> _models.ConnectedEnvironmentDaprComponent: """Get a dapr component. Get a dapr component. @@ -164,11 +168,11 @@ async def get( :type connected_environment_name: str :param component_name: Name of the Dapr Component. Required. :type component_name: str - :return: DaprComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponent + :return: ConnectedEnvironmentDaprComponent or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -180,7 +184,7 @@ async def get( _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.DaprComponent] = kwargs.pop("cls", None) + cls: ClsType[_models.ConnectedEnvironmentDaprComponent] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, @@ -205,7 +209,76 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DaprComponent", pipeline_response.http_response) + deserialized = self._deserialize("ConnectedEnvironmentDaprComponent", pipeline_response.http_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, + connected_environment_name: str, + component_name: str, + dapr_component_envelope: Union[_models.ConnectedEnvironmentDaprComponent, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(dapr_component_envelope, (IOBase, bytes)): + _content = dapr_component_envelope + else: + _json = self._serialize.body(dapr_component_envelope, "ConnectedEnvironmentDaprComponent") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + component_name=component_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -213,16 +286,16 @@ async def get( return deserialized # type: ignore @overload - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, component_name: str, - dapr_component_envelope: _models.DaprComponent, + dapr_component_envelope: _models.ConnectedEnvironmentDaprComponent, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DaprComponent: + ) -> AsyncLROPoller[_models.ConnectedEnvironmentDaprComponent]: """Creates or updates a Dapr Component. Creates or updates a Dapr Component in a connected environment. @@ -235,17 +308,20 @@ async def create_or_update( :param component_name: Name of the Dapr Component. Required. :type component_name: str :param dapr_component_envelope: Configuration details of the Dapr Component. Required. - :type dapr_component_envelope: ~azure.mgmt.appcontainers.models.DaprComponent + :type dapr_component_envelope: + ~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DaprComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponent + :return: An instance of AsyncLROPoller that returns either ConnectedEnvironmentDaprComponent or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, @@ -254,7 +330,7 @@ async def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DaprComponent: + ) -> AsyncLROPoller[_models.ConnectedEnvironmentDaprComponent]: """Creates or updates a Dapr Component. Creates or updates a Dapr Component in a connected environment. @@ -271,20 +347,22 @@ async def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: DaprComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponent + :return: An instance of AsyncLROPoller that returns either ConnectedEnvironmentDaprComponent or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, component_name: str, - dapr_component_envelope: Union[_models.DaprComponent, IO[bytes]], + dapr_component_envelope: Union[_models.ConnectedEnvironmentDaprComponent, IO[bytes]], **kwargs: Any - ) -> _models.DaprComponent: + ) -> AsyncLROPoller[_models.ConnectedEnvironmentDaprComponent]: """Creates or updates a Dapr Component. Creates or updates a Dapr Component in a connected environment. @@ -297,13 +375,70 @@ async def create_or_update( :param component_name: Name of the Dapr Component. Required. :type component_name: str :param dapr_component_envelope: Configuration details of the Dapr Component. Is either a - DaprComponent type or a IO[bytes] type. Required. - :type dapr_component_envelope: ~azure.mgmt.appcontainers.models.DaprComponent or IO[bytes] - :return: DaprComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponent + ConnectedEnvironmentDaprComponent type or a IO[bytes] type. Required. + :type dapr_component_envelope: + ~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ConnectedEnvironmentDaprComponent or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[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.ConnectedEnvironmentDaprComponent] = 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, + connected_environment_name=connected_environment_name, + component_name=component_name, + dapr_component_envelope=dapr_component_envelope, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectedEnvironmentDaprComponent", pipeline_response.http_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.ConnectedEnvironmentDaprComponent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectedEnvironmentDaprComponent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, connected_environment_name: str, component_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,58 +446,55 @@ async def create_or_update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = 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.DaprComponent] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dapr_component_envelope, (IOBase, bytes)): - _content = dapr_component_envelope - else: - _json = self._serialize.body(dapr_component_envelope, "DaprComponent") - - _request = build_create_or_update_request( + _request = build_delete_request( resource_group_name=resource_group_name, connected_environment_name=connected_environment_name, component_name=component_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DaprComponent", pipeline_response.http_response) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def begin_delete( self, resource_group_name: str, connected_environment_name: str, component_name: str, **kwargs: Any - ) -> None: + ) -> AsyncLROPoller[None]: """Delete a Dapr Component. Delete a Dapr Component from a connected environment. @@ -374,49 +506,52 @@ async def delete( # pylint: disable=inconsistent-return-statements :type connected_environment_name: str :param component_name: Name of the Dapr Component. Required. :type component_name: str - :return: None or the result of cls(response) - :rtype: None + :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: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + component_name=component_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - _request = build_delete_request( - resource_group_name=resource_group_name, - connected_environment_name=connected_environment_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - if cls: - return cls(pipeline_response, 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 @distributed_trace_async async def list_secrets( @@ -437,7 +572,7 @@ async def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.DaprSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py index 921acd30a914..1313c88425fa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._connected_environments_operations import ( build_check_name_availability_request, build_create_or_update_request, @@ -41,11 +42,8 @@ build_list_by_subscription_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -64,10 +62,10 @@ class ConnectedEnvironmentsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ConnectedEnvironment"]: @@ -87,7 +85,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Connecte api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConnectedEnvironmentCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +167,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConnectedEnvironmentCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +244,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +294,7 @@ async def _create_or_update_initial( environment_envelope: Union[_models.ConnectedEnvironment, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -491,7 +489,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, connected_environment_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,9 +600,73 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + @overload + async def update( + self, + resource_group_name: str, + connected_environment_name: str, + environment_envelope: Optional[_models.ConnectedEnvironmentPatchResource] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectedEnvironment: + """Update connected Environment's properties. + + Patches a Managed Environment. Only patching of tags is supported currently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connected_environment_name: Name of the connectedEnvironment. Required. + :type connected_environment_name: str + :param environment_envelope: Configuration details of the connectedEnvironment. Default value + is None. + :type environment_envelope: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentPatchResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectedEnvironment or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + connected_environment_name: str, + environment_envelope: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectedEnvironment: + """Update connected Environment's properties. + + Patches a Managed Environment. Only patching of tags is supported currently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connected_environment_name: Name of the connectedEnvironment. Required. + :type connected_environment_name: str + :param environment_envelope: Configuration details of the connectedEnvironment. Default value + is None. + :type environment_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: ConnectedEnvironment or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async async def update( - self, resource_group_name: str, connected_environment_name: str, **kwargs: Any + self, + resource_group_name: str, + connected_environment_name: str, + environment_envelope: Optional[Union[_models.ConnectedEnvironmentPatchResource, IO[bytes]]] = None, + **kwargs: Any ) -> _models.ConnectedEnvironment: """Update connected Environment's properties. @@ -615,11 +677,15 @@ async def update( :type resource_group_name: str :param connected_environment_name: Name of the connectedEnvironment. Required. :type connected_environment_name: str + :param environment_envelope: Configuration details of the connectedEnvironment. Is either a + ConnectedEnvironmentPatchResource type or a IO[bytes] type. Default value is None. + :type environment_envelope: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentPatchResource + or IO[bytes] :return: ConnectedEnvironment or the result of cls(response) :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -627,17 +693,32 @@ async def update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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.ConnectedEnvironment] = kwargs.pop("cls", None) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(environment_envelope, (IOBase, bytes)): + _content = environment_envelope + else: + if environment_envelope is not None: + _json = self._serialize.body(environment_envelope, "ConnectedEnvironmentPatchResource") + else: + _json = None + _request = build_update_request( resource_group_name=resource_group_name, connected_environment_name=connected_environment_name, subscription_id=self._config.subscription_id, api_version=api_version, + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -748,7 +829,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.appcontainers.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py index 00be8a0cd8f8..b7edcbb671cf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,36 +5,39 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, 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 ..._serialization import Deserializer, Serializer from ...operations._connected_environments_storages_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -54,10 +56,10 @@ class ConnectedEnvironmentsStoragesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def list( @@ -76,7 +78,7 @@ async def list( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStoragesCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +140,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,8 +184,77 @@ async def get( return deserialized # type: ignore + async def _create_or_update_initial( + self, + resource_group_name: str, + connected_environment_name: str, + storage_name: str, + storage_envelope: Union[_models.ConnectedEnvironmentStorage, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(storage_envelope, (IOBase, bytes)): + _content = storage_envelope + else: + _json = self._serialize.body(storage_envelope, "ConnectedEnvironmentStorage") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + storage_name=storage_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, @@ -192,7 +263,7 @@ async def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ConnectedEnvironmentStorage: + ) -> AsyncLROPoller[_models.ConnectedEnvironmentStorage]: """Create or update storage for a connectedEnvironment. Create or update storage for a connectedEnvironment. @@ -209,13 +280,15 @@ async def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: ConnectedEnvironmentStorage or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage + :return: An instance of AsyncLROPoller that returns either ConnectedEnvironmentStorage or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, @@ -224,7 +297,7 @@ async def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ConnectedEnvironmentStorage: + ) -> AsyncLROPoller[_models.ConnectedEnvironmentStorage]: """Create or update storage for a connectedEnvironment. Create or update storage for a connectedEnvironment. @@ -241,20 +314,22 @@ async def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: ConnectedEnvironmentStorage or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage + :return: An instance of AsyncLROPoller that returns either ConnectedEnvironmentStorage or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, storage_name: str, storage_envelope: Union[_models.ConnectedEnvironmentStorage, IO[bytes]], **kwargs: Any - ) -> _models.ConnectedEnvironmentStorage: + ) -> AsyncLROPoller[_models.ConnectedEnvironmentStorage]: """Create or update storage for a connectedEnvironment. Create or update storage for a connectedEnvironment. @@ -270,11 +345,67 @@ async def create_or_update( ConnectedEnvironmentStorage type or a IO[bytes] type. Required. :type storage_envelope: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage or IO[bytes] - :return: ConnectedEnvironmentStorage or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage + :return: An instance of AsyncLROPoller that returns either ConnectedEnvironmentStorage or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[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.ConnectedEnvironmentStorage] = 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, + connected_environment_name=connected_environment_name, + storage_name=storage_name, + storage_envelope=storage_envelope, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectedEnvironmentStorage", pipeline_response.http_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.ConnectedEnvironmentStorage].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ConnectedEnvironmentStorage]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, connected_environment_name: str, storage_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,58 +413,55 @@ async def create_or_update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = 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.ConnectedEnvironmentStorage] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(storage_envelope, (IOBase, bytes)): - _content = storage_envelope - else: - _json = self._serialize.body(storage_envelope, "ConnectedEnvironmentStorage") - - _request = build_create_or_update_request( + _request = build_delete_request( resource_group_name=resource_group_name, connected_environment_name=connected_environment_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("ConnectedEnvironmentStorage", pipeline_response.http_response) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def begin_delete( self, resource_group_name: str, connected_environment_name: str, storage_name: str, **kwargs: Any - ) -> None: + ) -> AsyncLROPoller[None]: """Delete storage for a connectedEnvironment. Delete storage for a connectedEnvironment. @@ -345,46 +473,49 @@ async def delete( # pylint: disable=inconsistent-return-statements :type connected_environment_name: str :param storage_name: Name of the storage. Required. :type storage_name: str - :return: None or the result of cls(response) - :rtype: None + :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: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - connected_environment_name=connected_environment_name, - storage_name=storage_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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 + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + storage_name=storage_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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/_container_apps_api_client_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py index 20b35af8390f..477c3b567a66 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,10 +30,6 @@ ) from .._vendor import ContainerAppsAPIClientMixinABC -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -59,7 +55,7 @@ async def job_execution( :rtype: ~azure.mgmt.appcontainers.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -111,7 +107,7 @@ async def get_custom_domain_verification_id(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py index 5f7d8adfd62e..0fdad2aa6c98 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,17 +28,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._container_apps_auth_configs_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_container_app_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +55,10 @@ class ContainerAppsAuthConfigsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_container_app( @@ -85,7 +83,7 @@ def list_by_container_app( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AuthConfigCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +165,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.AuthConfig :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +300,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.AuthConfig :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +357,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, container_app_name: str, auth_config_name: str, **kwargs: Any ) -> None: """Delete a Container App AuthConfig. @@ -377,7 +375,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_by_container_app_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_by_container_app_operations.py index 4a1965d111b0..ae9d9261ad7c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_by_container_app_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_by_container_app_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._container_apps_builds_by_container_app_operations import build_list_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,10 +48,10 @@ class ContainerAppsBuildsByContainerAppOperations: # pylint: disable=name-too-l 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -78,7 +76,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppsBuildCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_operations.py index c2caea4ecb4e..dfd169a96d20 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union, cast +from collections.abc import MutableMapping +from typing import Any, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -28,12 +28,10 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._container_apps_builds_operations import build_delete_request, build_get_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,10 +50,10 @@ class ContainerAppsBuildsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get( @@ -74,7 +72,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.ContainerAppsBuildResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -121,7 +119,7 @@ async def get( async def _delete_initial( self, resource_group_name: str, container_app_name: str, build_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py index 22cf063d8766..5da3148ed0d5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, cast +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +27,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._container_apps_diagnostics_operations import ( build_get_detector_request, build_get_revision_request, @@ -34,11 +35,8 @@ build_list_detectors_request, build_list_revisions_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +55,10 @@ class ContainerAppsDiagnosticsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_detectors( @@ -86,7 +84,7 @@ def list_detectors( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +166,7 @@ async def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +235,7 @@ def list_revisions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RevisionCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +318,7 @@ async def get_revision( :rtype: ~azure.mgmt.appcontainers.models.Revision :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,14 +377,11 @@ async def get_root(self, resource_group_name: str, container_app_name: str, **kw :rtype: ~azure.mgmt.appcontainers.models.ContainerApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -414,7 +409,7 @@ async def get_root(self, resource_group_name: str, container_app_name: str, **kw 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) # type: ignore + 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) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_label_history_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_label_history_operations.py new file mode 100644 index 000000000000..7f13c5058fa0 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_label_history_operations.py @@ -0,0 +1,270 @@ +# 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 collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core import AsyncPipelineClient +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.rest import AsyncHttpResponse, 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 ..._serialization import Deserializer, Serializer +from ...operations._container_apps_label_history_operations import ( + build_delete_label_history_request, + build_get_label_history_request, + build_list_label_history_request, +) +from .._configuration import ContainerAppsAPIClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ContainerAppsLabelHistoryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s + :attr:`container_apps_label_history` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_label_history( + self, resource_group_name: str, container_app_name: str, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.LabelHistory"]: + """Get the Label History for a given Container App. + + Get the Label History for a given Container App. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param container_app_name: Name of the Container App. Required. + :type container_app_name: str + :param filter: The filter to apply on the operation. Default value is None. + :type filter: str + :return: An iterator like instance of either LabelHistory or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.LabelHistory] + :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.LabelHistoryCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_label_history_request( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LabelHistoryCollection", 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_label_history( + self, resource_group_name: str, container_app_name: str, label_name: str, **kwargs: Any + ) -> _models.LabelHistory: + """Get the history of a label. + + Get the history of a label. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param container_app_name: Name of the Container App. Required. + :type container_app_name: str + :param label_name: Name of the Container App label. Required. + :type label_name: str + :return: LabelHistory or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.LabelHistory + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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.LabelHistory] = kwargs.pop("cls", None) + + _request = build_get_label_history_request( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + label_name=label_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("LabelHistory", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete_label_history( + self, resource_group_name: str, container_app_name: str, label_name: str, **kwargs: Any + ) -> None: + """Delete the history of a label. + + Delete the history of a label. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param container_app_name: Name of the Container App. Required. + :type container_app_name: str + :param label_name: Name of the Container App label. Required. + :type label_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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_label_history_request( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + label_name=label_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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/_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py index 7b5d63dcf798..a0b32c497aaa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._container_apps_operations import ( build_create_or_update_request, build_delete_request, @@ -45,11 +47,8 @@ build_stop_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,10 +67,10 @@ class ContainerAppsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ContainerApp"]: @@ -89,7 +88,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Containe api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +168,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,14 +245,11 @@ async def get(self, resource_group_name: str, container_app_name: str, **kwargs: :rtype: ~azure.mgmt.appcontainers.models.ContainerApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -281,7 +277,7 @@ async def get(self, resource_group_name: str, container_app_name: str, **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) # type: ignore + 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) @@ -299,7 +295,7 @@ async def _create_or_update_initial( container_app_envelope: Union[_models.ContainerApp, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +493,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, container_app_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -615,7 +611,7 @@ async def _update_initial( container_app_envelope: Union[_models.ContainerApp, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -830,7 +826,7 @@ async def list_custom_host_name_analysis( :rtype: ~azure.mgmt.appcontainers.models.CustomHostnameAnalysisResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -891,7 +887,7 @@ async def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.SecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -951,14 +947,11 @@ async def get_auth_token( :rtype: ~azure.mgmt.appcontainers.models.ContainerAppAuthToken :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -986,7 +979,7 @@ async def get_auth_token( 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) # type: ignore + 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) @@ -1000,7 +993,7 @@ async def get_auth_token( async def _start_initial( self, resource_group_name: str, container_app_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1112,7 @@ def get_long_running_output(pipeline_response): async def _stop_initial( self, resource_group_name: str, container_app_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_patches_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_patches_operations.py index 7860b774654c..2119afb0f720 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_patches_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_patches_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._container_apps_patches_operations import ( build_apply_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_by_container_app_request, build_skip_configure_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,10 +60,10 @@ class ContainerAppsPatchesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_container_app( @@ -93,7 +91,7 @@ def list_by_container_app( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PatchCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.ContainerAppsPatchResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +219,7 @@ async def get( async def _delete_initial( self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -342,7 +340,7 @@ async def _skip_configure_initial( patch_skip_config: Union[_models.PatchSkipConfig, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +538,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _apply_initial( self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py index 3b22ff21655a..28b50194143a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,15 +24,13 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._container_apps_revision_replicas_operations import ( build_get_replica_request, build_list_replicas_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -51,10 +49,10 @@ class ContainerAppsRevisionReplicasOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get_replica( @@ -77,7 +75,7 @@ async def get_replica( :rtype: ~azure.mgmt.appcontainers.models.Replica :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -141,7 +139,7 @@ async def list_replicas( :rtype: ~azure.mgmt.appcontainers.models.ReplicaCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py index 40a69d7b2126..389f9aa692d2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +27,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._container_apps_revisions_operations import ( build_activate_revision_request, build_deactivate_revision_request, @@ -34,11 +35,8 @@ build_list_revisions_request, build_restart_revision_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +55,10 @@ class ContainerAppsRevisionsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_revisions( @@ -87,7 +85,7 @@ def list_revisions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RevisionCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +168,7 @@ async def get_revision( :rtype: ~azure.mgmt.appcontainers.models.Revision :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +213,7 @@ async def get_revision( return deserialized # type: ignore @distributed_trace_async - async def activate_revision( # pylint: disable=inconsistent-return-statements + async def activate_revision( self, resource_group_name: str, container_app_name: str, revision_name: str, **kwargs: Any ) -> None: """Activates a revision for a Container App. @@ -233,7 +231,7 @@ async def activate_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +272,7 @@ async def activate_revision( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - async def deactivate_revision( # pylint: disable=inconsistent-return-statements + async def deactivate_revision( self, resource_group_name: str, container_app_name: str, revision_name: str, **kwargs: Any ) -> None: """Deactivates a revision for a Container App. @@ -292,7 +290,7 @@ async def deactivate_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +331,7 @@ async def deactivate_revision( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - async def restart_revision( # pylint: disable=inconsistent-return-statements + async def restart_revision( self, resource_group_name: str, container_app_name: str, revision_name: str, **kwargs: Any ) -> None: """Restarts a revision for a Container App. @@ -351,7 +349,7 @@ async def restart_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_session_pools_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_session_pools_operations.py index a5a3cec4ed59..0efa9ee59073 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_session_pools_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_session_pools_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._container_apps_session_pools_operations import ( build_create_or_update_request, build_delete_request, @@ -40,11 +41,8 @@ build_list_by_subscription_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,10 +61,10 @@ class ContainerAppsSessionPoolsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SessionPool"]: @@ -84,7 +82,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SessionP api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SessionPoolCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +162,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SessionPoolCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +239,7 @@ async def get(self, resource_group_name: str, session_pool_name: str, **kwargs: :rtype: ~azure.mgmt.appcontainers.models.SessionPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +289,7 @@ async def _create_or_update_initial( session_pool_envelope: Union[_models.SessionPool, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -493,7 +491,7 @@ async def _update_initial( session_pool_envelope: Union[_models.SessionPoolUpdatableProperties, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -696,7 +694,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, session_pool_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py index 8b1407ce04f5..334c6d7d5a0a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._container_apps_source_controls_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_by_container_app_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,10 +59,10 @@ class ContainerAppsSourceControlsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_container_app( @@ -89,7 +87,7 @@ def list_by_container_app( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SourceControlCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -171,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.SourceControl :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +222,7 @@ async def _create_or_update_initial( x_ms_github_auxiliary: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -453,7 +451,7 @@ async def _delete_initial( delete_workflow: Optional[bool] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index 83bef2cb2959..622812ee4ec4 100644 --- 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,17 +28,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._dapr_component_resiliency_policies_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +55,10 @@ class DaprComponentResiliencyPoliciesOperations: # pylint: disable=name-too-lon 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -89,7 +87,7 @@ def list( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -324,7 +322,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +380,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, environment_name: str, component_name: str, name: str, **kwargs: Any ) -> None: """Delete a Dapr component resiliency policy. @@ -402,7 +400,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py index 000354f1d838..059698d668ec 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._dapr_components_operations import ( build_create_or_update_request, build_delete_request, @@ -35,11 +36,8 @@ build_list_request, build_list_secrets_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -58,10 +56,10 @@ class DaprComponentsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -86,7 +84,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DaprComponentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +301,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -360,9 +358,7 @@ async def create_or_update( 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, **kwargs: Any - ) -> None: + async def delete(self, resource_group_name: str, environment_name: str, component_name: str, **kwargs: Any) -> None: """Delete a Dapr Component. Delete a Dapr Component from a Managed Environment. @@ -378,7 +374,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -437,7 +433,7 @@ async def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.DaprSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index 6f92d52e2b97..cbc353b48e0b 100644 --- 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,17 +28,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._dapr_subscriptions_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -57,10 +55,10 @@ class DaprSubscriptionsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -86,7 +84,7 @@ def list( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +302,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -361,9 +359,7 @@ async def create_or_update( 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: + async def delete(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. @@ -379,7 +375,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index cbf95800c59a..e00915704abb 100644 --- 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._dot_net_components_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,10 +60,10 @@ class DotNetComponentsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -91,7 +89,7 @@ def list( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.DotNetComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +223,7 @@ async def _create_or_update_initial( dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -439,7 +437,7 @@ async def _update_initial( dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -649,7 +647,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_functions_extension_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_functions_extension_operations.py index 5842f2f55257..c536ac0f8e38 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_functions_extension_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_functions_extension_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +24,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._functions_extension_operations import build_invoke_functions_host_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,10 +46,10 @@ class FunctionsExtensionOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def invoke_functions_host( @@ -79,7 +77,7 @@ async def invoke_functions_host( :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_http_route_config_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_http_route_config_operations.py new file mode 100644 index 000000000000..c17b12714635 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_http_route_config_operations.py @@ -0,0 +1,572 @@ +# 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 collections.abc import MutableMapping +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import urllib.parse + +from azure.core import AsyncPipelineClient +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.rest import AsyncHttpResponse, 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 ..._serialization import Deserializer, Serializer +from ...operations._http_route_config_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) +from .._configuration import ContainerAppsAPIClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class HttpRouteConfigOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s + :attr:`http_route_config` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, environment_name: str, http_route_name: str, **kwargs: Any + ) -> _models.HttpRouteConfig: + """Get the specified Managed Http Route Config. + + Get the specified Managed Http Route Config. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :return: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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.HttpRouteConfig] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + environment_name=environment_name, + http_route_name=http_route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("HttpRouteConfig", pipeline_response.http_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, + http_route_name: str, + http_route_config_envelope: Optional[_models.HttpRouteConfig] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Create or Update a Http Route Config. + + Create or Update a Http Route Config. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Http Route config to be created or updated. Default value is + None. + :type http_route_config_envelope: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + environment_name: str, + http_route_name: str, + http_route_config_envelope: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Create or Update a Http Route Config. + + Create or Update a Http Route Config. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Http Route config to be created or updated. Default value is + None. + :type http_route_config_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: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + environment_name: str, + http_route_name: str, + http_route_config_envelope: Optional[Union[_models.HttpRouteConfig, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Create or Update a Http Route Config. + + Create or Update a Http Route Config. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Http Route config to be created or updated. Is either a + HttpRouteConfig type or a IO[bytes] type. Default value is None. + :type http_route_config_envelope: ~azure.mgmt.appcontainers.models.HttpRouteConfig or IO[bytes] + :return: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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.HttpRouteConfig] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(http_route_config_envelope, (IOBase, bytes)): + _content = http_route_config_envelope + else: + if http_route_config_envelope is not None: + _json = self._serialize.body(http_route_config_envelope, "HttpRouteConfig") + else: + _json = None + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + environment_name=environment_name, + http_route_name=http_route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _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) + + deserialized = self._deserialize("HttpRouteConfig", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + environment_name: str, + http_route_name: str, + http_route_config_envelope: _models.HttpRouteConfig, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Update tags of a manged http route object. + + Patches an http route config resource. Only patching of tags is supported. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Properties of http route config that need to be updated. + Required. + :type http_route_config_envelope: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + environment_name: str, + http_route_name: str, + http_route_config_envelope: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Update tags of a manged http route object. + + Patches an http route config resource. Only patching of tags is supported. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Properties of http route config that need to be updated. + Required. + :type http_route_config_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: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + environment_name: str, + http_route_name: str, + http_route_config_envelope: Union[_models.HttpRouteConfig, IO[bytes]], + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Update tags of a manged http route object. + + Patches an http route config resource. Only patching of tags is supported. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Properties of http route config that need to be updated. Is + either a HttpRouteConfig type or a IO[bytes] type. Required. + :type http_route_config_envelope: ~azure.mgmt.appcontainers.models.HttpRouteConfig or IO[bytes] + :return: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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.HttpRouteConfig] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(http_route_config_envelope, (IOBase, bytes)): + _content = http_route_config_envelope + else: + _json = self._serialize.body(http_route_config_envelope, "HttpRouteConfig") + + _request = build_update_request( + resource_group_name=resource_group_name, + environment_name=environment_name, + http_route_name=http_route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _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("HttpRouteConfig", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, resource_group_name: str, environment_name: str, http_route_name: str, **kwargs: Any + ) -> None: + """Deletes the specified Managed Http Route. + + Deletes the specified Managed Http Route. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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, + http_route_name=http_route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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 + def list( + self, resource_group_name: str, environment_name: str, **kwargs: Any + ) -> AsyncIterable["_models.HttpRouteConfig"]: + """Get the Managed Http Routes in a given managed environment. + + Get the Managed Http Routes in a given 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 HttpRouteConfig or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.HttpRouteConfig] + :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.HttpRouteConfigCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_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.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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("HttpRouteConfigCollection", 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/_java_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_java_components_operations.py index ade6507b432b..5cf8e8afc0b1 100644 --- 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._java_components_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,10 +60,10 @@ class JavaComponentsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -90,7 +88,7 @@ def list( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +170,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.JavaComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +222,7 @@ async def _create_or_update_initial( java_component_envelope: Union[_models.JavaComponent, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +436,7 @@ async def _update_initial( java_component_envelope: Union[_models.JavaComponent, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -648,7 +646,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py index c261a646f9a7..a153bdf235e1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._jobs_executions_operations import build_list_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,10 +48,10 @@ class JobsExecutionsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -80,7 +78,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppJobExecutions] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 1a9c1c601aa5..72a75833f054 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._jobs_operations import ( build_create_or_update_request, build_delete_request, @@ -49,11 +51,8 @@ build_suspend_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,10 +71,10 @@ class JobsOperations: # pylint: disable=too-many-public-methods 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_detectors( @@ -100,7 +99,7 @@ def list_detectors( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,7 +181,7 @@ async def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +242,7 @@ async def proxy_get(self, resource_group_name: str, job_name: str, api_name: str :rtype: ~azure.mgmt.appcontainers.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +302,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Job"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +382,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -460,7 +459,7 @@ async def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _ :rtype: ~azure.mgmt.appcontainers.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -506,7 +505,7 @@ async def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _ async def _create_or_update_initial( self, resource_group_name: str, job_name: str, job_envelope: Union[_models.Job, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -695,7 +694,7 @@ def get_long_running_output(pipeline_response): ) async def _delete_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +810,7 @@ async def _update_initial( job_envelope: Union[_models.JobPatchProperties, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1011,7 +1010,7 @@ async def _start_initial( template: Optional[Union[_models.JobExecutionTemplate, IO[bytes]]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1215,7 +1214,7 @@ def get_long_running_output(pipeline_response): async def _stop_execution_initial( self, resource_group_name: str, job_name: str, job_execution_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1333,7 +1332,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_multiple_executions_initial( self, resource_group_name: str, job_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1467,7 +1466,7 @@ async def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.JobSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1511,7 +1510,7 @@ async def list_secrets( return deserialized # type: ignore async def _resume_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1629,7 +1628,7 @@ def get_long_running_output(pipeline_response): ) async def _suspend_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_logic_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_logic_apps_operations.py index cc823a950fa5..b3c4c8a4bfed 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_logic_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_logic_apps_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._logic_apps_operations import ( build_create_or_update_request, build_delete_request, @@ -38,12 +39,9 @@ build_list_workflows_connections_request, build_list_workflows_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,10 +60,10 @@ class LogicAppsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get( @@ -86,7 +84,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.LogicApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +213,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.LogicApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +270,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, container_app_name: str, logic_app_name: str, **kwargs: Any ) -> None: """Deletes a Logic App extension resource. @@ -288,7 +286,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -354,7 +352,7 @@ def list_workflows( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkflowEnvelopeCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -439,7 +437,7 @@ async def get_workflow( :rtype: ~azure.mgmt.appcontainers.models.WorkflowEnvelope :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -485,7 +483,7 @@ async def get_workflow( return deserialized # type: ignore @overload - async def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements + async def deploy_workflow_artifacts( self, resource_group_name: str, container_app_name: str, @@ -516,7 +514,7 @@ async def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-stat """ @overload - async def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements + async def deploy_workflow_artifacts( self, resource_group_name: str, container_app_name: str, @@ -547,7 +545,7 @@ async def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-stat """ @distributed_trace_async - async def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements + async def deploy_workflow_artifacts( self, resource_group_name: str, container_app_name: str, @@ -571,7 +569,7 @@ async def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-stat :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -645,7 +643,7 @@ async def list_workflows_connections( :rtype: ~azure.mgmt.appcontainers.models.WorkflowEnvelope :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -720,7 +718,7 @@ async def invoke( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_maintenance_configurations_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..1bac7f56ea65 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_maintenance_configurations_operations.py @@ -0,0 +1,409 @@ +# 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 collections.abc import MutableMapping +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import urllib.parse + +from azure.core import AsyncPipelineClient +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.rest import AsyncHttpResponse, 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 ..._serialization import Deserializer, Serializer +from ...operations._maintenance_configurations_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) +from .._configuration import ContainerAppsAPIClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class MaintenanceConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s + :attr:`maintenance_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, environment_name: str, **kwargs: Any + ) -> AsyncIterable["_models.MaintenanceConfigurationResource"]: + """Gets all maintenance configurations in the specified 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: The name of the Managed Environment. Required. + :type environment_name: str + :return: An iterator like instance of either MaintenanceConfigurationResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource] + :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.MaintenanceConfigurationCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_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.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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MaintenanceConfigurationCollection", 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) + + @overload + async def create_or_update( + self, + resource_group_name: str, + environment_name: str, + config_name: str, + maintenance_configuration_envelope: _models.MaintenanceConfigurationResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfigurationResource: + """Create or update the maintenance configuration for 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: The name of the Managed Environment. Required. + :type environment_name: str + :param config_name: The name of the maintenance configuration. Required. + :type config_name: str + :param maintenance_configuration_envelope: Parameters to set the maintenance configuration for + ManagedEnvironment . Required. + :type maintenance_configuration_envelope: + ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MaintenanceConfigurationResource or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + environment_name: str, + config_name: str, + maintenance_configuration_envelope: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfigurationResource: + """Create or update the maintenance configuration for 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: The name of the Managed Environment. Required. + :type environment_name: str + :param config_name: The name of the maintenance configuration. Required. + :type config_name: str + :param maintenance_configuration_envelope: Parameters to set the maintenance configuration for + ManagedEnvironment . Required. + :type maintenance_configuration_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: MaintenanceConfigurationResource or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + environment_name: str, + config_name: str, + maintenance_configuration_envelope: Union[_models.MaintenanceConfigurationResource, IO[bytes]], + **kwargs: Any + ) -> _models.MaintenanceConfigurationResource: + """Create or update the maintenance configuration for 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: The name of the Managed Environment. Required. + :type environment_name: str + :param config_name: The name of the maintenance configuration. Required. + :type config_name: str + :param maintenance_configuration_envelope: Parameters to set the maintenance configuration for + ManagedEnvironment . Is either a MaintenanceConfigurationResource type or a IO[bytes] type. + Required. + :type maintenance_configuration_envelope: + ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource or IO[bytes] + :return: MaintenanceConfigurationResource or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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.MaintenanceConfigurationResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(maintenance_configuration_envelope, (IOBase, bytes)): + _content = maintenance_configuration_envelope + else: + _json = self._serialize.body(maintenance_configuration_envelope, "MaintenanceConfigurationResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + environment_name=environment_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _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) + + deserialized = self._deserialize("MaintenanceConfigurationResource", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, resource_group_name: str, environment_name: str, config_name: str, **kwargs: Any) -> None: + """Deletes the maintenance configuration of a ManagedEnvironment . + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param environment_name: The name of the Managed Environment. Required. + :type environment_name: str + :param config_name: The name of the maintenance configuration. Required. + :type config_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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, environment_name: str, config_name: str, **kwargs: Any + ) -> _models.MaintenanceConfigurationResource: + """Gets the maintenance configuration of a ManagedEnvironment . + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param environment_name: The name of the Managed Environment. Required. + :type environment_name: str + :param config_name: The name of the maintenance configuration. Required. + :type config_name: str + :return: MaintenanceConfigurationResource or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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.MaintenanceConfigurationResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + environment_name=environment_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("MaintenanceConfigurationResource", pipeline_response.http_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/_managed_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py index 39cff80465ea..a2dd9f82fdd2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._managed_certificates_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,10 +60,10 @@ class ManagedCertificatesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get( @@ -86,7 +84,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.ManagedCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,15 +136,11 @@ async def _create_or_update_initial( managed_certificate_envelope: Optional[Union[_models.ManagedCertificate, IO[bytes]]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 400: cast( - Type[HttpResponseError], - lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -355,7 +349,7 @@ def get_long_running_output(pipeline_response): ) @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, environment_name: str, managed_certificate_name: str, **kwargs: Any ) -> None: """Deletes the specified Managed Certificate. @@ -373,7 +367,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -507,7 +501,7 @@ async def update( :rtype: ~azure.mgmt.appcontainers.models.ManagedCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -587,7 +581,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedCertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py index a2b62113b50a..940117c9a9c7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,15 +24,13 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._managed_environment_diagnostics_operations import ( build_get_detector_request, build_list_detectors_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -51,10 +49,10 @@ class ManagedEnvironmentDiagnosticsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def list_detectors( @@ -73,7 +71,7 @@ async def list_detectors( :rtype: ~azure.mgmt.appcontainers.models.DiagnosticsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -135,7 +133,7 @@ async def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_endpoint_connections_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_endpoint_connections_operations.py index c90077c27e4f..7c6e9f849404 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_endpoint_connections_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_endpoint_connections_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._managed_environment_private_endpoint_connections_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,10 +59,10 @@ class ManagedEnvironmentPrivateEndpointConnectionsOperations: # pylint: disable 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -91,7 +89,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +224,7 @@ async def _create_or_update_initial( private_endpoint_connection_envelope: Union[_models.PrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -442,7 +440,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, environment_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_link_resources_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_link_resources_operations.py index 59636be922d3..960f46e141d2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_link_resources_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_link_resources_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._managed_environment_private_link_resources_operations import build_list_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,10 +48,10 @@ class ManagedEnvironmentPrivateLinkResourcesOperations: # pylint: disable=name- 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -79,7 +77,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_usages_operations.py index f41521e7076b..9d03e5c2a899 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_usages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._managed_environment_usages_operations import build_list_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,10 +48,10 @@ class ManagedEnvironmentUsagesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: @@ -74,7 +72,7 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListUsagesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py index 913445a2aa38..b4691bd3b482 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +24,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._managed_environments_diagnostics_operations import build_get_root_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -48,10 +46,10 @@ class ManagedEnvironmentsDiagnosticsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get_root( @@ -70,7 +68,7 @@ async def get_root( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py index 58184362c225..772962abd4db 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._managed_environments_operations import ( build_create_or_update_request, build_delete_request, @@ -42,11 +43,8 @@ build_list_workload_profile_states_request, build_update_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,10 +63,10 @@ class ManagedEnvironmentsOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ManagedEnvironment"]: @@ -87,7 +85,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ManagedE api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedEnvironmentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +168,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedEnvironmentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +245,7 @@ async def get(self, resource_group_name: str, environment_name: str, **kwargs: A :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -297,7 +295,7 @@ async def _create_or_update_initial( environment_envelope: Union[_models.ManagedEnvironment, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -492,7 +490,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, environment_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +602,7 @@ async def _update_initial( environment_envelope: Union[_models.ManagedEnvironment, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -813,7 +811,7 @@ async def get_auth_token( :rtype: ~azure.mgmt.appcontainers.models.EnvironmentAuthToken :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -881,7 +879,7 @@ def list_workload_profile_states( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadProfileStatesCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py index 4df31389d777..8bc25311b3d3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,17 +25,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._managed_environments_storages_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -54,10 +52,10 @@ class ManagedEnvironmentsStoragesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def list( @@ -76,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStoragesCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +136,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -273,7 +271,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +315,7 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200]: + 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) @@ -330,9 +328,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, storage_name: str, **kwargs: Any - ) -> None: + async def delete(self, resource_group_name: str, environment_name: str, storage_name: str, **kwargs: Any) -> None: """Delete storage for a managedEnvironment. Delete storage for a managedEnvironment. @@ -348,7 +344,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py index 6c4b11ba1a03..e4ed779cdb76 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import AsyncPipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +25,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._namespaces_operations import build_check_name_availability_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -49,10 +47,10 @@ class NamespacesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload async def check_name_availability( @@ -138,7 +136,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.appcontainers.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py index 05240797532c..4cf7d28b5550 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._operations import build_list_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,10 +48,10 @@ class Operations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: @@ -70,7 +68,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AvailableOperations] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_usages_operations.py index 3cb70b68e447..fcec40feb41a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_usages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._usages_operations import build_list_request +from .._configuration import ContainerAppsAPIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,10 +48,10 @@ class UsagesOperations: 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: @@ -72,7 +70,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListUsagesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 d6a2ce622d06..3d34b5219871 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 @@ -5,371 +5,415 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -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 -from ._models_py3 import AuthConfigCollection -from ._models_py3 import AuthPlatform -from ._models_py3 import AvailableOperations -from ._models_py3 import AvailableWorkloadProfile -from ._models_py3 import AvailableWorkloadProfileProperties -from ._models_py3 import AvailableWorkloadProfilesCollection -from ._models_py3 import AzureActiveDirectory -from ._models_py3 import AzureActiveDirectoryLogin -from ._models_py3 import AzureActiveDirectoryRegistration -from ._models_py3 import AzureActiveDirectoryValidation -from ._models_py3 import AzureCredentials -from ._models_py3 import AzureFileProperties -from ._models_py3 import AzureStaticWebApps -from ._models_py3 import AzureStaticWebAppsRegistration -from ._models_py3 import BaseContainer -from ._models_py3 import BillingMeter -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 -from ._models_py3 import ConnectedEnvironmentCollection -from ._models_py3 import ConnectedEnvironmentStorage -from ._models_py3 import ConnectedEnvironmentStorageProperties -from ._models_py3 import ConnectedEnvironmentStoragesCollection -from ._models_py3 import Container -from ._models_py3 import ContainerApp -from ._models_py3 import ContainerAppAuthToken -from ._models_py3 import ContainerAppCollection -from ._models_py3 import ContainerAppJobExecutions -from ._models_py3 import ContainerAppProbe -from ._models_py3 import ContainerAppProbeHttpGet -from ._models_py3 import ContainerAppProbeHttpGetHttpHeadersItem -from ._models_py3 import ContainerAppProbeTcpSocket -from ._models_py3 import ContainerAppPropertiesPatchingConfiguration -from ._models_py3 import ContainerAppSecret -from ._models_py3 import ContainerAppsBuildCollection -from ._models_py3 import ContainerAppsBuildConfiguration -from ._models_py3 import ContainerAppsBuildResource -from ._models_py3 import ContainerAppsPatchResource -from ._models_py3 import ContainerExecutionStatus -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 -from ._models_py3 import CustomContainerTemplate -from ._models_py3 import CustomDomain -from ._models_py3 import CustomDomainConfiguration -from ._models_py3 import CustomHostnameAnalysisResult -from ._models_py3 import CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo -from ._models_py3 import CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem -from ._models_py3 import CustomOpenIdConnectProvider -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 -from ._models_py3 import DiagnosticDataTableResponseObject -from ._models_py3 import DiagnosticRendering -from ._models_py3 import DiagnosticSupportTopic -from ._models_py3 import Diagnostics -from ._models_py3 import DiagnosticsCollection -from ._models_py3 import DiagnosticsDataApiResponse -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 DynamicPoolConfiguration -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 ErrorEntity -from ._models_py3 import ErrorResponse -from ._models_py3 import ExecutionStatus -from ._models_py3 import ExtendedLocation -from ._models_py3 import Facebook -from ._models_py3 import ForwardProxy -from ._models_py3 import GitHub -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 -from ._models_py3 import IdentityProviders -from ._models_py3 import IdentitySettings -from ._models_py3 import Ingress -from ._models_py3 import IngressPortMapping -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 JavaComponentIngress -from ._models_py3 import JavaComponentProperties -from ._models_py3 import JavaComponentPropertiesScale -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 -from ._models_py3 import JobConfigurationManualTriggerConfig -from ._models_py3 import JobConfigurationScheduleTriggerConfig -from ._models_py3 import JobExecution -from ._models_py3 import JobExecutionBase -from ._models_py3 import JobExecutionContainer -from ._models_py3 import JobExecutionNamesCollection -from ._models_py3 import JobExecutionTemplate -from ._models_py3 import JobPatchProperties -from ._models_py3 import JobPatchPropertiesProperties -from ._models_py3 import JobScale -from ._models_py3 import JobScaleRule -from ._models_py3 import JobSecretsCollection -from ._models_py3 import JobTemplate -from ._models_py3 import JobsCollection -from ._models_py3 import JwtClaimChecks -from ._models_py3 import KedaConfiguration -from ._models_py3 import ListUsagesResult -from ._models_py3 import LogAnalyticsConfiguration -from ._models_py3 import LoggerSetting -from ._models_py3 import LogicApp -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 NacosComponent -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 PatchCollection -from ._models_py3 import PatchDetails -from ._models_py3 import PatchDetailsNewLayer -from ._models_py3 import PatchDetailsOldLayer -from ._models_py3 import PatchProperties -from ._models_py3 import PatchSkipConfig -from ._models_py3 import PreBuildStep -from ._models_py3 import PrivateEndpoint -from ._models_py3 import PrivateEndpointConnection -from ._models_py3 import PrivateEndpointConnectionListResult -from ._models_py3 import PrivateLinkResource -from ._models_py3 import PrivateLinkResourceListResult -from ._models_py3 import PrivateLinkServiceConnectionState -from ._models_py3 import ProxyResource -from ._models_py3 import QueueScaleRule -from ._models_py3 import RegistryCredentials -from ._models_py3 import RegistryInfo -from ._models_py3 import Replica -from ._models_py3 import ReplicaCollection -from ._models_py3 import ReplicaContainer -from ._models_py3 import ReplicaExecutionStatus -from ._models_py3 import Resource -from ._models_py3 import Revision -from ._models_py3 import RevisionCollection -from ._models_py3 import Runtime -from ._models_py3 import RuntimeDotnet -from ._models_py3 import RuntimeJava -from ._models_py3 import RuntimeJavaAgent -from ._models_py3 import RuntimeJavaAgentLogging -from ._models_py3 import Scale -from ._models_py3 import ScaleConfiguration -from ._models_py3 import ScaleRule -from ._models_py3 import ScaleRuleAuth -from ._models_py3 import ScgRoute -from ._models_py3 import Secret -from ._models_py3 import SecretVolumeItem -from ._models_py3 import SecretsCollection -from ._models_py3 import Service -from ._models_py3 import ServiceBind -from ._models_py3 import SessionContainer -from ._models_py3 import SessionContainerResources -from ._models_py3 import SessionIngress -from ._models_py3 import SessionNetworkConfiguration -from ._models_py3 import SessionPool -from ._models_py3 import SessionPoolCollection -from ._models_py3 import SessionPoolSecret -from ._models_py3 import SessionPoolUpdatableProperties -from ._models_py3 import SessionRegistryCredentials -from ._models_py3 import SmbStorage -from ._models_py3 import SourceControl -from ._models_py3 import SourceControlCollection -from ._models_py3 import SpringBootAdminComponent -from ._models_py3 import SpringCloudConfigComponent -from ._models_py3 import SpringCloudEurekaComponent -from ._models_py3 import SpringCloudGatewayComponent -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 -from ._models_py3 import TwitterRegistration -from ._models_py3 import Usage -from ._models_py3 import UsageName -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import VnetConfiguration -from ._models_py3 import Volume -from ._models_py3 import VolumeMount -from ._models_py3 import WorkflowArtifacts -from ._models_py3 import WorkflowEnvelope -from ._models_py3 import WorkflowEnvelopeCollection -from ._models_py3 import WorkflowEnvelopeProperties -from ._models_py3 import WorkflowHealth -from ._models_py3 import WorkloadProfile -from ._models_py3 import WorkloadProfileStates -from ._models_py3 import WorkloadProfileStatesCollection -from ._models_py3 import WorkloadProfileStatesProperties +from typing import TYPE_CHECKING -from ._container_apps_api_client_enums import AccessMode -from ._container_apps_api_client_enums import Action -from ._container_apps_api_client_enums import ActiveRevisionsMode -from ._container_apps_api_client_enums import Affinity -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 -from ._container_apps_api_client_enums import ContainerAppProvisioningState -from ._container_apps_api_client_enums import ContainerAppReplicaRunningState -from ._container_apps_api_client_enums import ContainerType -from ._container_apps_api_client_enums import CookieExpirationConvention -from ._container_apps_api_client_enums import CreatedByType -from ._container_apps_api_client_enums import DetectionStatus -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 ExecutionType -from ._container_apps_api_client_enums import ExtendedLocationTypes -from ._container_apps_api_client_enums import ForwardProxyConvention -from ._container_apps_api_client_enums import IdentitySettingsLifeCycle -from ._container_apps_api_client_enums import ImageType -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 JobRunningState -from ._container_apps_api_client_enums import Kind -from ._container_apps_api_client_enums import Level -from ._container_apps_api_client_enums import LogLevel -from ._container_apps_api_client_enums import LogicAppsProxyMethod -from ._container_apps_api_client_enums import ManagedCertificateDomainControlValidation -from ._container_apps_api_client_enums import ManagedServiceIdentityType -from ._container_apps_api_client_enums import PatchApplyStatus -from ._container_apps_api_client_enums import PatchType -from ._container_apps_api_client_enums import PatchingMode -from ._container_apps_api_client_enums import PoolManagementType -from ._container_apps_api_client_enums import PrivateEndpointConnectionProvisioningState -from ._container_apps_api_client_enums import PrivateEndpointServiceConnectionStatus -from ._container_apps_api_client_enums import PublicNetworkAccess -from ._container_apps_api_client_enums import RevisionHealthState -from ._container_apps_api_client_enums import RevisionProvisioningState -from ._container_apps_api_client_enums import RevisionRunningState -from ._container_apps_api_client_enums import Scheme -from ._container_apps_api_client_enums import SessionNetworkStatus -from ._container_apps_api_client_enums import SessionPoolProvisioningState -from ._container_apps_api_client_enums import SourceControlOperationState -from ._container_apps_api_client_enums import StorageType -from ._container_apps_api_client_enums import TriggerType -from ._container_apps_api_client_enums import Type -from ._container_apps_api_client_enums import UnauthenticatedClientActionV2 -from ._container_apps_api_client_enums import WorkflowHealthState -from ._container_apps_api_client_enums import WorkflowState +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models_py3 import ( # type: ignore + AllowedAudiencesValidation, + AllowedPrincipals, + AppInsightsConfiguration, + AppLogsConfiguration, + AppRegistration, + AppResiliency, + AppResiliencyCollection, + Apple, + AppleRegistration, + AuthConfig, + AuthConfigCollection, + AuthPlatform, + AvailableOperations, + AvailableWorkloadProfile, + AvailableWorkloadProfileProperties, + AvailableWorkloadProfilesCollection, + AzureActiveDirectory, + AzureActiveDirectoryLogin, + AzureActiveDirectoryRegistration, + AzureActiveDirectoryValidation, + AzureCredentials, + AzureFileProperties, + AzureStaticWebApps, + AzureStaticWebAppsRegistration, + BaseContainer, + BillingMeter, + BillingMeterCollection, + BillingMeterProperties, + BlobStorageTokenStore, + BuildCollection, + BuildConfiguration, + BuildResource, + BuildToken, + BuilderCollection, + BuilderResource, + BuilderResourceUpdate, + Certificate, + CertificateCollection, + CertificateKeyVaultProperties, + CertificatePatch, + CertificateProperties, + CheckNameAvailabilityRequest, + CheckNameAvailabilityResponse, + CircuitBreakerPolicy, + ClientRegistration, + Configuration, + ConnectedEnvironment, + ConnectedEnvironmentCollection, + ConnectedEnvironmentDaprComponent, + ConnectedEnvironmentDaprComponentProperties, + ConnectedEnvironmentDaprComponentsCollection, + ConnectedEnvironmentPatchResource, + ConnectedEnvironmentStorage, + ConnectedEnvironmentStorageProperties, + ConnectedEnvironmentStoragesCollection, + Container, + ContainerApp, + ContainerAppAuthToken, + ContainerAppCollection, + ContainerAppJobExecutions, + ContainerAppProbe, + ContainerAppProbeHttpGet, + ContainerAppProbeHttpGetHttpHeadersItem, + ContainerAppProbeTcpSocket, + ContainerAppPropertiesPatchingConfiguration, + ContainerAppSecret, + ContainerAppsBuildCollection, + ContainerAppsBuildConfiguration, + ContainerAppsBuildResource, + ContainerAppsPatchResource, + ContainerExecutionStatus, + ContainerRegistry, + ContainerRegistryWithCustomImage, + ContainerResources, + CookieExpiration, + CorsPolicy, + CustomContainerTemplate, + CustomDomain, + CustomDomainConfiguration, + CustomHostnameAnalysisResult, + CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo, + CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem, + CustomOpenIdConnectProvider, + CustomScaleRule, + Dapr, + DaprAppHealth, + DaprComponent, + DaprComponentProperties, + 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, + DiagnosticDataTableResponseObject, + DiagnosticRendering, + DiagnosticSupportTopic, + Diagnostics, + DiagnosticsCollection, + DiagnosticsDataApiResponse, + DiagnosticsDefinition, + DiagnosticsProperties, + DiagnosticsStatus, + DotNetComponent, + DotNetComponentConfigurationProperty, + DotNetComponentServiceBind, + DotNetComponentsCollection, + DynamicPoolConfiguration, + EncryptionSettings, + EnvironmentAuthToken, + EnvironmentVar, + EnvironmentVariable, + ErrorAdditionalInfo, + ErrorDetail, + ErrorEntity, + ErrorResponse, + ExecutionStatus, + ExtendedLocation, + Facebook, + ForwardProxy, + GitHub, + GithubActionConfiguration, + GlobalValidation, + Google, + Header, + HeaderMatch, + HttpConnectionPool, + HttpGet, + HttpRetryPolicy, + HttpRoute, + HttpRouteAction, + HttpRouteConfig, + HttpRouteConfigCollection, + HttpRouteConfigProperties, + HttpRouteMatch, + HttpRouteProvisioningErrors, + HttpRouteRule, + HttpRouteTarget, + HttpScaleRule, + HttpSettings, + HttpSettingsRoutes, + IdentityProviders, + IdentitySettings, + Ingress, + IngressConfiguration, + IngressConfigurationScale, + IngressPortMapping, + IngressStickySessions, + InitContainer, + IpSecurityRestrictionRule, + JavaComponent, + JavaComponentConfigurationProperty, + JavaComponentIngress, + JavaComponentProperties, + JavaComponentPropertiesScale, + JavaComponentServiceBind, + JavaComponentsCollection, + Job, + JobConfiguration, + JobConfigurationEventTriggerConfig, + JobConfigurationManualTriggerConfig, + JobConfigurationScheduleTriggerConfig, + JobExecution, + JobExecutionBase, + JobExecutionContainer, + JobExecutionNamesCollection, + JobExecutionTemplate, + JobPatchProperties, + JobPatchPropertiesProperties, + JobScale, + JobScaleRule, + JobSecretsCollection, + JobTemplate, + JobsCollection, + JwtClaimChecks, + KedaConfiguration, + LabelHistory, + LabelHistoryCollection, + LabelHistoryProperties, + LabelHistoryRecordItem, + ListUsagesResult, + LogAnalyticsConfiguration, + LoggerSetting, + LogicApp, + Login, + LoginRoutes, + LoginScopes, + LogsConfiguration, + MaintenanceConfigurationCollection, + MaintenanceConfigurationResource, + ManagedCertificate, + ManagedCertificateCollection, + ManagedCertificatePatch, + ManagedCertificateProperties, + ManagedEnvironment, + ManagedEnvironmentPropertiesPeerAuthentication, + ManagedEnvironmentPropertiesPeerTrafficConfiguration, + ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption, + ManagedEnvironmentStorage, + ManagedEnvironmentStorageProperties, + ManagedEnvironmentStoragesCollection, + ManagedEnvironmentsCollection, + ManagedIdentitySetting, + ManagedServiceIdentity, + MetricsConfiguration, + Mtls, + NacosComponent, + NfsAzureFileProperties, + Nonce, + OpenIdConnectClientCredential, + OpenIdConnectConfig, + OpenIdConnectLogin, + OpenIdConnectRegistration, + OpenTelemetryConfiguration, + OperationDetail, + OperationDisplay, + OtlpConfiguration, + PatchCollection, + PatchDetails, + PatchDetailsNewLayer, + PatchDetailsOldLayer, + PatchProperties, + PatchSkipConfig, + PreBuildStep, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionListResult, + PrivateLinkResource, + PrivateLinkResourceListResult, + PrivateLinkServiceConnectionState, + ProxyResource, + QueueScaleRule, + RegistryCredentials, + RegistryInfo, + Replica, + ReplicaCollection, + ReplicaContainer, + ReplicaExecutionStatus, + Resource, + ResourceTags, + Revision, + RevisionCollection, + Runtime, + RuntimeDotnet, + RuntimeJava, + RuntimeJavaAgent, + RuntimeJavaAgentLogging, + Scale, + ScaleConfiguration, + ScaleRule, + ScaleRuleAuth, + ScgRoute, + ScheduledEntry, + Secret, + SecretKeyVaultProperties, + SecretVolumeItem, + SecretsCollection, + Service, + ServiceBind, + SessionContainer, + SessionContainerResources, + SessionIngress, + SessionNetworkConfiguration, + SessionPool, + SessionPoolCollection, + SessionPoolSecret, + SessionPoolUpdatableProperties, + SessionRegistryCredentials, + SmbStorage, + SourceControl, + SourceControlCollection, + SpringBootAdminComponent, + SpringCloudConfigComponent, + SpringCloudEurekaComponent, + SpringCloudGatewayComponent, + SystemData, + TcpConnectionPool, + TcpRetryPolicy, + TcpScaleRule, + Template, + TimeoutPolicy, + TokenStore, + TracesConfiguration, + TrackedResource, + TrafficWeight, + Twitter, + TwitterRegistration, + Usage, + UsageName, + UserAssignedIdentity, + VnetConfiguration, + Volume, + VolumeMount, + WorkflowArtifacts, + WorkflowEnvelope, + WorkflowEnvelopeCollection, + WorkflowEnvelopeProperties, + WorkflowHealth, + WorkloadProfile, + WorkloadProfileStates, + WorkloadProfileStatesCollection, + WorkloadProfileStatesProperties, +) + +from ._container_apps_api_client_enums import ( # type: ignore + AccessMode, + Action, + ActiveRevisionsMode, + Affinity, + AppProtocol, + Applicability, + BindingType, + BuildProvisioningState, + BuildStatus, + BuilderProvisioningState, + CertificateProvisioningState, + CertificateType, + CheckNameAvailabilityReason, + ConnectedEnvironmentDaprComponentProvisioningState, + ConnectedEnvironmentProvisioningState, + ConnectedEnvironmentStorageProvisioningState, + ContainerAppContainerRunningState, + ContainerAppProvisioningState, + ContainerAppReplicaRunningState, + ContainerAppRunningStatus, + ContainerType, + CookieExpirationConvention, + CreatedByType, + DetectionStatus, + DnsVerificationTestResult, + DotNetComponentProvisioningState, + DotNetComponentType, + EnvironmentProvisioningState, + ExecutionType, + ExtendedLocationTypes, + ForwardProxyConvention, + HttpRouteProvisioningState, + IdentitySettingsLifeCycle, + ImageType, + IngressClientCertificateMode, + IngressTargetPortHttpScheme, + IngressTransportMethod, + JavaComponentProvisioningState, + JavaComponentType, + JobExecutionRunningState, + JobProvisioningState, + JobRunningState, + Kind, + Level, + LogLevel, + LogicAppsProxyMethod, + ManagedCertificateDomainControlValidation, + ManagedServiceIdentityType, + PatchApplyStatus, + PatchType, + PatchingMode, + PoolManagementType, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + PublicNetworkAccess, + RevisionHealthState, + RevisionProvisioningState, + RevisionRunningState, + Scheme, + SessionNetworkStatus, + SessionPoolProvisioningState, + SourceControlOperationState, + Status, + StorageType, + TriggerType, + Type, + UnauthenticatedClientActionV2, + WeekDay, + WorkflowHealthState, + WorkflowState, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -421,6 +465,10 @@ "Configuration", "ConnectedEnvironment", "ConnectedEnvironmentCollection", + "ConnectedEnvironmentDaprComponent", + "ConnectedEnvironmentDaprComponentProperties", + "ConnectedEnvironmentDaprComponentsCollection", + "ConnectedEnvironmentPatchResource", "ConnectedEnvironmentStorage", "ConnectedEnvironmentStorageProperties", "ConnectedEnvironmentStoragesCollection", @@ -454,7 +502,9 @@ "CustomOpenIdConnectProvider", "CustomScaleRule", "Dapr", + "DaprAppHealth", "DaprComponent", + "DaprComponentProperties", "DaprComponentResiliencyPoliciesCollection", "DaprComponentResiliencyPolicy", "DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration", @@ -518,12 +568,23 @@ "HttpConnectionPool", "HttpGet", "HttpRetryPolicy", + "HttpRoute", + "HttpRouteAction", + "HttpRouteConfig", + "HttpRouteConfigCollection", + "HttpRouteConfigProperties", + "HttpRouteMatch", + "HttpRouteProvisioningErrors", + "HttpRouteRule", + "HttpRouteTarget", "HttpScaleRule", "HttpSettings", "HttpSettingsRoutes", "IdentityProviders", "IdentitySettings", "Ingress", + "IngressConfiguration", + "IngressConfigurationScale", "IngressPortMapping", "IngressStickySessions", "InitContainer", @@ -554,6 +615,10 @@ "JobsCollection", "JwtClaimChecks", "KedaConfiguration", + "LabelHistory", + "LabelHistoryCollection", + "LabelHistoryProperties", + "LabelHistoryRecordItem", "ListUsagesResult", "LogAnalyticsConfiguration", "LoggerSetting", @@ -562,6 +627,8 @@ "LoginRoutes", "LoginScopes", "LogsConfiguration", + "MaintenanceConfigurationCollection", + "MaintenanceConfigurationResource", "ManagedCertificate", "ManagedCertificateCollection", "ManagedCertificatePatch", @@ -574,6 +641,7 @@ "ManagedEnvironmentStorageProperties", "ManagedEnvironmentStoragesCollection", "ManagedEnvironmentsCollection", + "ManagedIdentitySetting", "ManagedServiceIdentity", "MetricsConfiguration", "Mtls", @@ -610,6 +678,7 @@ "ReplicaContainer", "ReplicaExecutionStatus", "Resource", + "ResourceTags", "Revision", "RevisionCollection", "Runtime", @@ -622,7 +691,9 @@ "ScaleRule", "ScaleRuleAuth", "ScgRoute", + "ScheduledEntry", "Secret", + "SecretKeyVaultProperties", "SecretVolumeItem", "SecretsCollection", "Service", @@ -683,10 +754,13 @@ "CertificateProvisioningState", "CertificateType", "CheckNameAvailabilityReason", + "ConnectedEnvironmentDaprComponentProvisioningState", "ConnectedEnvironmentProvisioningState", + "ConnectedEnvironmentStorageProvisioningState", "ContainerAppContainerRunningState", "ContainerAppProvisioningState", "ContainerAppReplicaRunningState", + "ContainerAppRunningStatus", "ContainerType", "CookieExpirationConvention", "CreatedByType", @@ -698,6 +772,7 @@ "ExecutionType", "ExtendedLocationTypes", "ForwardProxyConvention", + "HttpRouteProvisioningState", "IdentitySettingsLifeCycle", "ImageType", "IngressClientCertificateMode", @@ -728,12 +803,14 @@ "SessionNetworkStatus", "SessionPoolProvisioningState", "SourceControlOperationState", + "Status", "StorageType", "TriggerType", "Type", "UnauthenticatedClientActionV2", + "WeekDay", "WorkflowHealthState", "WorkflowState", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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 5466c525adcb..a0a7abebe09c 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 @@ -32,13 +32,15 @@ class ActiveRevisionsMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): .. raw:: html - Multiple: multiple revisions can be active.Single: Only one - revision can be active at a time. Revision weights can not be used in this mode. If no value if - provided, this is the default.. + Single: Only one revision can be active at a time. Traffic weights cannot be + used. This is the default.Multiple: Multiple revisions can be active, including + optional traffic weights and labels.Labels: Only revisions with labels are active. + Traffic weights can be applied to labels.. """ MULTIPLE = "Multiple" SINGLE = "Single" + LABELS = "Labels" class Affinity(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -69,6 +71,7 @@ class BindingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLED = "Disabled" SNI_ENABLED = "SniEnabled" + AUTO = "Auto" class BuilderProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -111,6 +114,7 @@ class CertificateProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta) CANCELED = "Canceled" DELETE_FAILED = "DeleteFailed" PENDING = "Pending" + DELETING = "Deleting" class CertificateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -129,6 +133,16 @@ class CheckNameAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): ALREADY_EXISTS = "AlreadyExists" +class ConnectedEnvironmentDaprComponentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the Connected Environment Dapr Component.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + IN_PROGRESS = "InProgress" + DELETING = "Deleting" + + class ConnectedEnvironmentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of the Kubernetes Environment.""" @@ -142,6 +156,16 @@ class ConnectedEnvironmentProvisioningState(str, Enum, metaclass=CaseInsensitive SCHEDULED_FOR_DELETE = "ScheduledForDelete" +class ConnectedEnvironmentStorageProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the storage.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + IN_PROGRESS = "InProgress" + DELETING = "Deleting" + + class ContainerAppContainerRunningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Current running state of the container.""" @@ -168,6 +192,21 @@ class ContainerAppReplicaRunningState(str, Enum, metaclass=CaseInsensitiveEnumMe UNKNOWN = "Unknown" +class ContainerAppRunningStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Running status of the Container App.""" + + PROGRESSING = "Progressing" + """Container App is transitioning between Stopped and Running states.""" + RUNNING = "Running" + """Container App is in Running state.""" + STOPPED = "Stopped" + """Container App is in Stopped state.""" + SUSPENDED = "Suspended" + """Container App Job is in Suspended state.""" + READY = "Ready" + """Container App Job is in Ready state.""" + + class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The container type of the sessions.""" @@ -258,6 +297,18 @@ class ForwardProxyConvention(str, Enum, metaclass=CaseInsensitiveEnumMeta): CUSTOM = "Custom" +class HttpRouteProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + WAITING = "Waiting" + UPDATING = "Updating" + DELETING = "Deleting" + PENDING = "Pending" + + class IdentitySettingsLifeCycle(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Use to select the lifecycle stages of a Container App during which the Managed Identity should be available. @@ -544,6 +595,14 @@ class SourceControlOperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): CANCELED = "Canceled" +class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the label history record.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + STARTING = "Starting" + + class StorageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Storage type for the volume. If not provided, use EmptyDir.""" @@ -579,6 +638,18 @@ class UnauthenticatedClientActionV2(str, Enum, metaclass=CaseInsensitiveEnumMeta RETURN403 = "Return403" +class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Day of the week when a managed environment can be patched.""" + + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + SUNDAY = "Sunday" + + class WorkflowHealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Gets or sets the workflow health state.""" 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 fae7ddf612a3..16c707fecfaa 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 @@ -1,5 +1,5 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 -# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -7,21 +7,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping import datetime -import sys from typing import Any, Dict, List, Literal, Optional, TYPE_CHECKING, Union from .. import _serialization -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] class AllowedAudiencesValidation(_serialization.Model): @@ -234,7 +228,7 @@ class Resource(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -263,10 +257,10 @@ class Resource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.system_data: Optional["_models.SystemData"] = None class ProxyResource(Resource): @@ -276,7 +270,7 @@ class ProxyResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -295,7 +289,7 @@ class AppResiliency(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -403,7 +397,7 @@ def __init__(self, *, value: List["_models.AppResiliency"], **kwargs: Any) -> No """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class AuthConfig(ProxyResource): @@ -413,7 +407,7 @@ class AuthConfig(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -533,7 +527,7 @@ def __init__(self, *, value: List["_models.AuthConfig"], **kwargs: Any) -> None: """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class AuthPlatform(_serialization.Model): @@ -607,7 +601,7 @@ class AvailableWorkloadProfile(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -749,7 +743,7 @@ def __init__(self, *, value: List["_models.AvailableWorkloadProfile"], **kwargs: """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class AzureActiveDirectory(_serialization.Model): @@ -1062,6 +1056,9 @@ class AzureFileProperties(_serialization.Model): :vartype account_name: str :ivar account_key: Storage account key for azure file. :vartype account_key: str + :ivar account_key_vault_properties: Storage account key stored as an Azure Key Vault secret. + :vartype account_key_vault_properties: + ~azure.mgmt.appcontainers.models.SecretKeyVaultProperties :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: Azure file share name. @@ -1071,6 +1068,7 @@ class AzureFileProperties(_serialization.Model): _attribute_map = { "account_name": {"key": "accountName", "type": "str"}, "account_key": {"key": "accountKey", "type": "str"}, + "account_key_vault_properties": {"key": "accountKeyVaultProperties", "type": "SecretKeyVaultProperties"}, "access_mode": {"key": "accessMode", "type": "str"}, "share_name": {"key": "shareName", "type": "str"}, } @@ -1080,6 +1078,7 @@ def __init__( *, account_name: Optional[str] = None, account_key: Optional[str] = None, + account_key_vault_properties: Optional["_models.SecretKeyVaultProperties"] = None, access_mode: Optional[Union[str, "_models.AccessMode"]] = None, share_name: Optional[str] = None, **kwargs: Any @@ -1089,6 +1088,9 @@ def __init__( :paramtype account_name: str :keyword account_key: Storage account key for azure file. :paramtype account_key: str + :keyword account_key_vault_properties: Storage account key stored as an Azure Key Vault secret. + :paramtype account_key_vault_properties: + ~azure.mgmt.appcontainers.models.SecretKeyVaultProperties :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: Azure file share name. @@ -1097,6 +1099,7 @@ def __init__( super().__init__(**kwargs) self.account_name = account_name self.account_key = account_key + self.account_key_vault_properties = account_key_vault_properties self.access_mode = access_mode self.share_name = share_name @@ -1239,7 +1242,7 @@ class BillingMeter(_serialization.Model): 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 + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1285,10 +1288,10 @@ def __init__( :paramtype properties: ~azure.mgmt.appcontainers.models.BillingMeterProperties """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.system_data: Optional["_models.SystemData"] = None self.location = location self.properties = properties @@ -1361,29 +1364,55 @@ def __init__( class BlobStorageTokenStore(_serialization.Model): """The configuration settings of the storage of the tokens if blob storage is used. - All required parameters must be populated in order to send to server. - :ivar sas_url_setting_name: The name of the app secrets containing the SAS URL of the blob - storage containing the tokens. Required. + storage containing the tokens. Should not be used along with blobContainerUri. :vartype sas_url_setting_name: str + :ivar blob_container_uri: The URI of the blob storage containing the tokens. Should not be used + along with sasUrlSettingName. + :vartype blob_container_uri: str + :ivar client_id: The Client ID of a User-Assigned Managed Identity. Should not be used along + with managedIdentityResourceId. + :vartype client_id: str + :ivar managed_identity_resource_id: The Resource ID of a User-Assigned Managed Identity. Should + not be used along with clientId. + :vartype managed_identity_resource_id: str """ - _validation = { - "sas_url_setting_name": {"required": True}, - } - _attribute_map = { "sas_url_setting_name": {"key": "sasUrlSettingName", "type": "str"}, + "blob_container_uri": {"key": "blobContainerUri", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "managed_identity_resource_id": {"key": "managedIdentityResourceId", "type": "str"}, } - def __init__(self, *, sas_url_setting_name: str, **kwargs: Any) -> None: + def __init__( + self, + *, + sas_url_setting_name: Optional[str] = None, + blob_container_uri: Optional[str] = None, + client_id: Optional[str] = None, + managed_identity_resource_id: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword sas_url_setting_name: The name of the app secrets containing the SAS URL of the blob - storage containing the tokens. Required. + storage containing the tokens. Should not be used along with blobContainerUri. :paramtype sas_url_setting_name: str + :keyword blob_container_uri: The URI of the blob storage containing the tokens. Should not be + used along with sasUrlSettingName. + :paramtype blob_container_uri: str + :keyword client_id: The Client ID of a User-Assigned Managed Identity. Should not be used along + with managedIdentityResourceId. + :paramtype client_id: str + :keyword managed_identity_resource_id: The Resource ID of a User-Assigned Managed Identity. + Should not be used along with clientId. + :paramtype managed_identity_resource_id: str """ super().__init__(**kwargs) self.sas_url_setting_name = sas_url_setting_name + self.blob_container_uri = blob_container_uri + self.client_id = client_id + self.managed_identity_resource_id = managed_identity_resource_id class BuildCollection(_serialization.Model): @@ -1516,7 +1545,7 @@ class TrackedResource(Resource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1569,7 +1598,7 @@ class BuilderResource(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1644,7 +1673,7 @@ def __init__( """ super().__init__(tags=tags, location=location, **kwargs) self.identity = identity - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.BuilderProvisioningState"]] = None self.environment_id = environment_id self.container_registries = container_registries @@ -1690,13 +1719,13 @@ def __init__( self.environment_id = environment_id -class BuildResource(ProxyResource): # pylint: disable=too-many-instance-attributes +class BuildResource(ProxyResource): """Information pertaining to an individual build. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1772,13 +1801,13 @@ def __init__( :paramtype configuration: ~azure.mgmt.appcontainers.models.BuildConfiguration """ super().__init__(**kwargs) - self.provisioning_state = None - self.build_status = None + self.provisioning_state: Optional[Union[str, "_models.BuildProvisioningState"]] = None + self.build_status: Optional[Union[str, "_models.BuildStatus"]] = 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.upload_endpoint: Optional[str] = None + self.log_stream_endpoint: Optional[str] = None + self.token_endpoint: Optional[str] = None class BuildToken(_serialization.Model): @@ -1805,8 +1834,8 @@ class BuildToken(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.token = None - self.expires = None + self.token: Optional[str] = None + self.expires: Optional[datetime.datetime] = None class Certificate(TrackedResource): @@ -1817,7 +1846,7 @@ class Certificate(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1903,7 +1932,7 @@ def __init__(self, *, value: List["_models.Certificate"], **kwargs: Any) -> None """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class CertificateKeyVaultProperties(_serialization.Model): @@ -1954,15 +1983,17 @@ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> N self.tags = tags -class CertificateProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes +class CertificateProperties(_serialization.Model): """Certificate resource specific properties. Variables are only populated by the server, and will be ignored when sending a request. :ivar provisioning_state: Provisioning state of the certificate. Known values are: "Succeeded", - "Failed", "Canceled", "DeleteFailed", and "Pending". + "Failed", "Canceled", "DeleteFailed", "Pending", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.CertificateProvisioningState + :ivar deployment_errors: Any errors that occurred during deployment or deployment validation. + :vartype deployment_errors: str :ivar certificate_key_vault_properties: Properties for a certificate stored in a Key Vault. :vartype certificate_key_vault_properties: ~azure.mgmt.appcontainers.models.CertificateKeyVaultProperties @@ -1994,6 +2025,7 @@ class CertificateProperties(_serialization.Model): # pylint: disable=too-many-i _validation = { "provisioning_state": {"readonly": True}, + "deployment_errors": {"readonly": True}, "subject_name": {"readonly": True}, "subject_alternative_names": {"readonly": True}, "issuer": {"readonly": True}, @@ -2006,6 +2038,7 @@ class CertificateProperties(_serialization.Model): # pylint: disable=too-many-i _attribute_map = { "provisioning_state": {"key": "provisioningState", "type": "str"}, + "deployment_errors": {"key": "deploymentErrors", "type": "str"}, "certificate_key_vault_properties": { "key": "certificateKeyVaultProperties", "type": "CertificateKeyVaultProperties", @@ -2046,18 +2079,19 @@ def __init__( :paramtype certificate_type: str or ~azure.mgmt.appcontainers.models.CertificateType """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.CertificateProvisioningState"]] = None + self.deployment_errors: Optional[str] = None self.certificate_key_vault_properties = certificate_key_vault_properties self.password = password - self.subject_name = None - self.subject_alternative_names = None + self.subject_name: Optional[str] = None + self.subject_alternative_names: Optional[List[str]] = None self.value = value - self.issuer = None - self.issue_date = None - self.expiration_date = None - self.thumbprint = None - self.valid = None - self.public_key_hash = None + self.issuer: Optional[str] = None + self.issue_date: Optional[datetime.datetime] = None + self.expiration_date: Optional[datetime.datetime] = None + self.thumbprint: Optional[str] = None + self.valid: Optional[bool] = None + self.public_key_hash: Optional[str] = None self.certificate_type = certificate_type @@ -2214,10 +2248,15 @@ class Configuration(_serialization.Model): .. raw:: html - Multiple: multiple revisions can be active.Single: Only one - revision can be active at a time. Revision weights can not be used in this mode. If no value if - provided, this is the default.. Known values are: "Multiple" and "Single". + Single: Only one revision can be active at a time. Traffic weights cannot be + used. This is the default.Multiple: Multiple revisions can be active, including + optional traffic weights and labels.Labels: Only revisions with labels are active. + Traffic weights can be applied to labels.. Known values are: "Multiple", + "Single", and "Labels". :vartype active_revisions_mode: str or ~azure.mgmt.appcontainers.models.ActiveRevisionsMode + :ivar target_label: Required in labels revisions mode. Label to apply to newly created + revision. + :vartype target_label: str :ivar ingress: Ingress configurations. :vartype ingress: ~azure.mgmt.appcontainers.models.Ingress :ivar registries: Collection of private container registry credentials for containers used by @@ -2229,6 +2268,10 @@ class Configuration(_serialization.Model): :vartype runtime: ~azure.mgmt.appcontainers.models.Runtime :ivar max_inactive_revisions: Optional. Max inactive revisions a Container App can have. :vartype max_inactive_revisions: int + :ivar revision_transition_threshold: Optional. The percent of the total number of replicas that + must be brought up before revision transition occurs. Defaults to 100 when none is given. Value + must be greater than 0 and less than or equal to 100. + :vartype revision_transition_threshold: int :ivar service: Container App to be a dev Container App Service. :vartype service: ~azure.mgmt.appcontainers.models.Service :ivar identity_settings: Optional settings for Managed Identities that are assigned to the @@ -2236,14 +2279,20 @@ class Configuration(_serialization.Model): :vartype identity_settings: list[~azure.mgmt.appcontainers.models.IdentitySettings] """ + _validation = { + "revision_transition_threshold": {"maximum": 100, "minimum": 1}, + } + _attribute_map = { "secrets": {"key": "secrets", "type": "[Secret]"}, "active_revisions_mode": {"key": "activeRevisionsMode", "type": "str"}, + "target_label": {"key": "targetLabel", "type": "str"}, "ingress": {"key": "ingress", "type": "Ingress"}, "registries": {"key": "registries", "type": "[RegistryCredentials]"}, "dapr": {"key": "dapr", "type": "Dapr"}, "runtime": {"key": "runtime", "type": "Runtime"}, "max_inactive_revisions": {"key": "maxInactiveRevisions", "type": "int"}, + "revision_transition_threshold": {"key": "revisionTransitionThreshold", "type": "int"}, "service": {"key": "service", "type": "Service"}, "identity_settings": {"key": "identitySettings", "type": "[IdentitySettings]"}, } @@ -2253,11 +2302,13 @@ def __init__( *, secrets: Optional[List["_models.Secret"]] = None, active_revisions_mode: Union[str, "_models.ActiveRevisionsMode"] = "Single", + target_label: Optional[str] = None, ingress: Optional["_models.Ingress"] = None, registries: Optional[List["_models.RegistryCredentials"]] = None, dapr: Optional["_models.Dapr"] = None, runtime: Optional["_models.Runtime"] = None, max_inactive_revisions: Optional[int] = None, + revision_transition_threshold: Optional[int] = None, service: Optional["_models.Service"] = None, identity_settings: Optional[List["_models.IdentitySettings"]] = None, **kwargs: Any @@ -2271,10 +2322,15 @@ def __init__( .. raw:: html - Multiple: multiple revisions can be active.Single: Only one - revision can be active at a time. Revision weights can not be used in this mode. If no value if - provided, this is the default.. Known values are: "Multiple" and "Single". + Single: Only one revision can be active at a time. Traffic weights cannot be + used. This is the default.Multiple: Multiple revisions can be active, including + optional traffic weights and labels.Labels: Only revisions with labels are active. + Traffic weights can be applied to labels.. Known values are: "Multiple", + "Single", and "Labels". :paramtype active_revisions_mode: str or ~azure.mgmt.appcontainers.models.ActiveRevisionsMode + :keyword target_label: Required in labels revisions mode. Label to apply to newly created + revision. + :paramtype target_label: str :keyword ingress: Ingress configurations. :paramtype ingress: ~azure.mgmt.appcontainers.models.Ingress :keyword registries: Collection of private container registry credentials for containers used @@ -2286,6 +2342,10 @@ def __init__( :paramtype runtime: ~azure.mgmt.appcontainers.models.Runtime :keyword max_inactive_revisions: Optional. Max inactive revisions a Container App can have. :paramtype max_inactive_revisions: int + :keyword revision_transition_threshold: Optional. The percent of the total number of replicas + that must be brought up before revision transition occurs. Defaults to 100 when none is given. + Value must be greater than 0 and less than or equal to 100. + :paramtype revision_transition_threshold: int :keyword service: Container App to be a dev Container App Service. :paramtype service: ~azure.mgmt.appcontainers.models.Service :keyword identity_settings: Optional settings for Managed Identities that are assigned to the @@ -2295,16 +2355,18 @@ def __init__( super().__init__(**kwargs) self.secrets = secrets self.active_revisions_mode = active_revisions_mode + self.target_label = target_label self.ingress = ingress self.registries = registries self.dapr = dapr self.runtime = runtime self.max_inactive_revisions = max_inactive_revisions + self.revision_transition_threshold = revision_transition_threshold self.service = service self.identity_settings = identity_settings -class ConnectedEnvironment(TrackedResource): # pylint: disable=too-many-instance-attributes +class ConnectedEnvironment(TrackedResource): """An environment for Kubernetes cluster specialized for web workloads by Azure App Service. Variables are only populated by the server, and will be ignored when sending a request. @@ -2312,7 +2374,7 @@ class ConnectedEnvironment(TrackedResource): # pylint: disable=too-many-instanc All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2406,9 +2468,9 @@ def __init__( """ super().__init__(tags=tags, location=location, **kwargs) self.extended_location = extended_location - self.provisioning_state = None - self.deployment_errors = None - self.default_domain = None + self.provisioning_state: Optional[Union[str, "_models.ConnectedEnvironmentProvisioningState"]] = None + self.deployment_errors: Optional[str] = None + self.default_domain: Optional[str] = None self.static_ip = static_ip self.dapr_ai_connection_string = dapr_ai_connection_string self.custom_domain_configuration = custom_domain_configuration @@ -2441,16 +2503,16 @@ def __init__(self, *, value: Optional[List["_models.ConnectedEnvironment"]] = No """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None -class ConnectedEnvironmentStorage(ProxyResource): - """Storage resource for connectedEnvironment. +class ConnectedEnvironmentDaprComponent(ProxyResource): + """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. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2460,8 +2522,32 @@ class ConnectedEnvironmentStorage(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar properties: Storage properties. - :vartype properties: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorageProperties + :ivar component_type: Component type. + :vartype component_type: str + :ivar version: Component version. + :vartype version: str + :ivar ignore_errors: Boolean describing if the component errors are ignores. + :vartype ignore_errors: bool + :ivar init_timeout: Initialization timeout. + :vartype init_timeout: str + :ivar secrets: Collection of secrets used by a Dapr component. + :vartype secrets: list[~azure.mgmt.appcontainers.models.Secret] + :ivar secret_store_component: Name of a Dapr component to retrieve component secrets from. + :vartype secret_store_component: str + :ivar metadata: Component metadata. + :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] + :ivar provisioning_state: Provisioning state of the Connected Environment Dapr Component. Known + values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponentProvisioningState + :ivar deployment_errors: Any errors that occurred during deployment or deployment validation. + :vartype deployment_errors: str """ _validation = { @@ -2469,6 +2555,8 @@ class ConnectedEnvironmentStorage(ProxyResource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "deployment_errors": {"readonly": True}, } _attribute_map = { @@ -2476,85 +2564,451 @@ class ConnectedEnvironmentStorage(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ConnectedEnvironmentStorageProperties"}, + "component_type": {"key": "properties.componentType", "type": "str"}, + "version": {"key": "properties.version", "type": "str"}, + "ignore_errors": {"key": "properties.ignoreErrors", "type": "bool"}, + "init_timeout": {"key": "properties.initTimeout", "type": "str"}, + "secrets": {"key": "properties.secrets", "type": "[Secret]"}, + "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]"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "deployment_errors": {"key": "properties.deploymentErrors", "type": "str"}, } def __init__( - self, *, properties: Optional["_models.ConnectedEnvironmentStorageProperties"] = None, **kwargs: Any + self, + *, + component_type: Optional[str] = None, + version: Optional[str] = None, + ignore_errors: bool = False, + init_timeout: Optional[str] = None, + secrets: Optional[List["_models.Secret"]] = None, + 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: """ - :keyword properties: Storage properties. - :paramtype properties: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorageProperties + :keyword component_type: Component type. + :paramtype component_type: str + :keyword version: Component version. + :paramtype version: str + :keyword ignore_errors: Boolean describing if the component errors are ignores. + :paramtype ignore_errors: bool + :keyword init_timeout: Initialization timeout. + :paramtype init_timeout: str + :keyword secrets: Collection of secrets used by a Dapr component. + :paramtype secrets: list[~azure.mgmt.appcontainers.models.Secret] + :keyword secret_store_component: Name of a Dapr component to retrieve component secrets from. + :paramtype secret_store_component: str + :keyword metadata: Component metadata. + :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.properties = properties + self.component_type = component_type + self.version = version + self.ignore_errors = ignore_errors + self.init_timeout = init_timeout + self.secrets = secrets + self.secret_store_component = secret_store_component + self.metadata = metadata + self.scopes = scopes + self.service_component_bind = service_component_bind + self.provisioning_state: Optional[Union[str, "_models.ConnectedEnvironmentDaprComponentProvisioningState"]] = ( + None + ) + self.deployment_errors: Optional[str] = None -class ConnectedEnvironmentStorageProperties(_serialization.Model): - """Storage properties. +class DaprComponentProperties(_serialization.Model): + """Dapr Component resource specific properties. - :ivar azure_file: Azure file properties. - :vartype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties - :ivar smb: SMB storage properties. - :vartype smb: ~azure.mgmt.appcontainers.models.SmbStorage + :ivar component_type: Component type. + :vartype component_type: str + :ivar version: Component version. + :vartype version: str + :ivar ignore_errors: Boolean describing if the component errors are ignores. + :vartype ignore_errors: bool + :ivar init_timeout: Initialization timeout. + :vartype init_timeout: str + :ivar secrets: Collection of secrets used by a Dapr component. + :vartype secrets: list[~azure.mgmt.appcontainers.models.Secret] + :ivar secret_store_component: Name of a Dapr component to retrieve component secrets from. + :vartype secret_store_component: str + :ivar metadata: Component metadata. + :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] """ _attribute_map = { - "azure_file": {"key": "azureFile", "type": "AzureFileProperties"}, - "smb": {"key": "smb", "type": "SmbStorage"}, + "component_type": {"key": "componentType", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "ignore_errors": {"key": "ignoreErrors", "type": "bool"}, + "init_timeout": {"key": "initTimeout", "type": "str"}, + "secrets": {"key": "secrets", "type": "[Secret]"}, + "secret_store_component": {"key": "secretStoreComponent", "type": "str"}, + "metadata": {"key": "metadata", "type": "[DaprMetadata]"}, + "scopes": {"key": "scopes", "type": "[str]"}, + "service_component_bind": {"key": "serviceComponentBind", "type": "[DaprComponentServiceBinding]"}, } def __init__( self, *, - azure_file: Optional["_models.AzureFileProperties"] = None, - smb: Optional["_models.SmbStorage"] = None, + component_type: Optional[str] = None, + version: Optional[str] = None, + ignore_errors: bool = False, + init_timeout: Optional[str] = None, + secrets: Optional[List["_models.Secret"]] = None, + 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: """ - :keyword azure_file: Azure file properties. - :paramtype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties - :keyword smb: SMB storage properties. - :paramtype smb: ~azure.mgmt.appcontainers.models.SmbStorage + :keyword component_type: Component type. + :paramtype component_type: str + :keyword version: Component version. + :paramtype version: str + :keyword ignore_errors: Boolean describing if the component errors are ignores. + :paramtype ignore_errors: bool + :keyword init_timeout: Initialization timeout. + :paramtype init_timeout: str + :keyword secrets: Collection of secrets used by a Dapr component. + :paramtype secrets: list[~azure.mgmt.appcontainers.models.Secret] + :keyword secret_store_component: Name of a Dapr component to retrieve component secrets from. + :paramtype secret_store_component: str + :keyword metadata: Component metadata. + :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.azure_file = azure_file - self.smb = smb + self.component_type = component_type + self.version = version + self.ignore_errors = ignore_errors + self.init_timeout = init_timeout + self.secrets = secrets + self.secret_store_component = secret_store_component + self.metadata = metadata + self.scopes = scopes + self.service_component_bind = service_component_bind -class ConnectedEnvironmentStoragesCollection(_serialization.Model): - """Collection of Storage for Environments. +class ConnectedEnvironmentDaprComponentProperties(DaprComponentProperties): # pylint: disable=name-too-long + """Dapr component properties. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: Collection of storage resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage] + :ivar component_type: Component type. + :vartype component_type: str + :ivar version: Component version. + :vartype version: str + :ivar ignore_errors: Boolean describing if the component errors are ignores. + :vartype ignore_errors: bool + :ivar init_timeout: Initialization timeout. + :vartype init_timeout: str + :ivar secrets: Collection of secrets used by a Dapr component. + :vartype secrets: list[~azure.mgmt.appcontainers.models.Secret] + :ivar secret_store_component: Name of a Dapr component to retrieve component secrets from. + :vartype secret_store_component: str + :ivar metadata: Component metadata. + :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] + :ivar provisioning_state: Provisioning state of the Connected Environment Dapr Component. Known + values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponentProvisioningState + :ivar deployment_errors: Any errors that occurred during deployment or deployment validation. + :vartype deployment_errors: str """ _validation = { - "value": {"required": True}, + "provisioning_state": {"readonly": True}, + "deployment_errors": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[ConnectedEnvironmentStorage]"}, + "component_type": {"key": "componentType", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "ignore_errors": {"key": "ignoreErrors", "type": "bool"}, + "init_timeout": {"key": "initTimeout", "type": "str"}, + "secrets": {"key": "secrets", "type": "[Secret]"}, + "secret_store_component": {"key": "secretStoreComponent", "type": "str"}, + "metadata": {"key": "metadata", "type": "[DaprMetadata]"}, + "scopes": {"key": "scopes", "type": "[str]"}, + "service_component_bind": {"key": "serviceComponentBind", "type": "[DaprComponentServiceBinding]"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "deployment_errors": {"key": "deploymentErrors", "type": "str"}, } - def __init__(self, *, value: List["_models.ConnectedEnvironmentStorage"], **kwargs: Any) -> None: - """ - :keyword value: Collection of storage resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage] + def __init__( + self, + *, + component_type: Optional[str] = None, + version: Optional[str] = None, + ignore_errors: bool = False, + init_timeout: Optional[str] = None, + secrets: Optional[List["_models.Secret"]] = None, + 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: """ - super().__init__(**kwargs) - self.value = value - - -class Container(BaseContainer): - """Container App container definition. - - :ivar image: Container image tag. - :vartype image: str - :ivar image_type: The type of the image. Set to CloudBuild to let the system manages the image, - where user will not be able to update image through image field. Set to ContainerImage for user + :keyword component_type: Component type. + :paramtype component_type: str + :keyword version: Component version. + :paramtype version: str + :keyword ignore_errors: Boolean describing if the component errors are ignores. + :paramtype ignore_errors: bool + :keyword init_timeout: Initialization timeout. + :paramtype init_timeout: str + :keyword secrets: Collection of secrets used by a Dapr component. + :paramtype secrets: list[~azure.mgmt.appcontainers.models.Secret] + :keyword secret_store_component: Name of a Dapr component to retrieve component secrets from. + :paramtype secret_store_component: str + :keyword metadata: Component metadata. + :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__( + component_type=component_type, + version=version, + ignore_errors=ignore_errors, + init_timeout=init_timeout, + secrets=secrets, + secret_store_component=secret_store_component, + metadata=metadata, + scopes=scopes, + service_component_bind=service_component_bind, + **kwargs + ) + self.provisioning_state: Optional[Union[str, "_models.ConnectedEnvironmentDaprComponentProvisioningState"]] = ( + None + ) + self.deployment_errors: Optional[str] = None + + +class ConnectedEnvironmentDaprComponentsCollection(_serialization.Model): # pylint: disable=name-too-long + """Collection of Dapr Components for Environments. + + 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 Dapr component resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent] + :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": "[ConnectedEnvironmentDaprComponent]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.ConnectedEnvironmentDaprComponent"], **kwargs: Any) -> None: + """ + :keyword value: Collection of Dapr component resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent] + """ + super().__init__(**kwargs) + self.value = value + self.next_link: Optional[str] = None + + +class ResourceTags(_serialization.Model): + """List of key value pairs that describe the resource. This will overwrite the existing tags. + + :ivar tags: Resource tags. + :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: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags + + +class ConnectedEnvironmentPatchResource(ResourceTags): + """Connected environment patch properties. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + +class ConnectedEnvironmentStorage(ProxyResource): + """Storage resource for connectedEnvironment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData + :ivar properties: Storage properties. + :vartype properties: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorageProperties + """ + + _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"}, + "properties": {"key": "properties", "type": "ConnectedEnvironmentStorageProperties"}, + } + + def __init__( + self, *, properties: Optional["_models.ConnectedEnvironmentStorageProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: Storage properties. + :paramtype properties: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorageProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class ConnectedEnvironmentStorageProperties(_serialization.Model): + """Storage properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: Provisioning state of the storage. Known values are: "Succeeded", + "Failed", "Canceled", "InProgress", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorageProvisioningState + :ivar deployment_errors: Any errors that occurred during deployment or deployment validation. + :vartype deployment_errors: str + :ivar azure_file: Azure file properties. + :vartype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties + :ivar smb: SMB storage properties. + :vartype smb: ~azure.mgmt.appcontainers.models.SmbStorage + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "deployment_errors": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "deployment_errors": {"key": "deploymentErrors", "type": "str"}, + "azure_file": {"key": "azureFile", "type": "AzureFileProperties"}, + "smb": {"key": "smb", "type": "SmbStorage"}, + } + + def __init__( + self, + *, + azure_file: Optional["_models.AzureFileProperties"] = None, + smb: Optional["_models.SmbStorage"] = None, + **kwargs: Any + ) -> None: + """ + :keyword azure_file: Azure file properties. + :paramtype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties + :keyword smb: SMB storage properties. + :paramtype smb: ~azure.mgmt.appcontainers.models.SmbStorage + """ + super().__init__(**kwargs) + self.provisioning_state: Optional[Union[str, "_models.ConnectedEnvironmentStorageProvisioningState"]] = None + self.deployment_errors: Optional[str] = None + self.azure_file = azure_file + self.smb = smb + + +class ConnectedEnvironmentStoragesCollection(_serialization.Model): + """Collection of Storage for Environments. + + All required parameters must be populated in order to send to server. + + :ivar value: Collection of storage resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage] + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ConnectedEnvironmentStorage]"}, + } + + def __init__(self, *, value: List["_models.ConnectedEnvironmentStorage"], **kwargs: Any) -> None: + """ + :keyword value: Collection of storage resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage] + """ + super().__init__(**kwargs) + self.value = value + + +class Container(BaseContainer): + """Container App container definition. + + :ivar image: Container image tag. + :vartype image: str + :ivar image_type: The type of the image. Set to CloudBuild to let the system manages the image, + where user will not be able to update image through image field. Set to ContainerImage for user provided image. Known values are: "CloudBuild" and "ContainerImage". :vartype image_type: str or ~azure.mgmt.appcontainers.models.ImageType :ivar name: Custom container name. @@ -2635,7 +3089,7 @@ def __init__( self.probes = probes -class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attributes +class ContainerApp(TrackedResource): """Container App. Variables are only populated by the server, and will be ignored when sending a request. @@ -2643,7 +3097,7 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2675,6 +3129,9 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib "InProgress", "Succeeded", "Failed", "Canceled", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.ContainerAppProvisioningState + :ivar running_status: Running status of the Container App. Known values are: "Progressing", + "Running", "Stopped", "Suspended", and "Ready". + :vartype running_status: str or ~azure.mgmt.appcontainers.models.ContainerAppRunningStatus :ivar deployment_errors: Any errors that occurred during deployment. :vartype deployment_errors: str :ivar managed_environment_id: Deprecated. Resource ID of the Container App's environment. @@ -2712,6 +3169,7 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib "system_data": {"readonly": True}, "location": {"required": True}, "provisioning_state": {"readonly": True}, + "running_status": {"readonly": True}, "deployment_errors": {"readonly": True}, "latest_revision_name": {"readonly": True}, "latest_ready_revision_name": {"readonly": True}, @@ -2733,6 +3191,7 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib "managed_by": {"key": "managedBy", "type": "str"}, "kind": {"key": "kind", "type": "str"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "running_status": {"key": "properties.runningStatus", "type": "str"}, "deployment_errors": {"key": "properties.deploymentErrors", "type": "str"}, "managed_environment_id": {"key": "properties.managedEnvironmentId", "type": "str"}, "environment_id": {"key": "properties.environmentId", "type": "str"}, @@ -2806,20 +3265,21 @@ def __init__( # pylint: disable=too-many-locals self.identity = identity self.managed_by = managed_by self.kind = kind - self.provisioning_state = None - self.deployment_errors = None + self.provisioning_state: Optional[Union[str, "_models.ContainerAppProvisioningState"]] = None + self.running_status: Optional[Union[str, "_models.ContainerAppRunningStatus"]] = None + self.deployment_errors: Optional[str] = None self.managed_environment_id = managed_environment_id self.environment_id = environment_id self.workload_profile_name = workload_profile_name self.patching_configuration = patching_configuration - self.latest_revision_name = None - self.latest_ready_revision_name = None - self.latest_revision_fqdn = None - self.custom_domain_verification_id = None + self.latest_revision_name: Optional[str] = None + self.latest_ready_revision_name: Optional[str] = None + self.latest_revision_fqdn: Optional[str] = None + self.custom_domain_verification_id: Optional[str] = None self.configuration = configuration self.template = template - self.outbound_ip_addresses = None - self.event_stream_endpoint = None + self.outbound_ip_addresses: Optional[List[str]] = None + self.event_stream_endpoint: Optional[str] = None class ContainerAppAuthToken(TrackedResource): @@ -2830,7 +3290,7 @@ class ContainerAppAuthToken(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2879,8 +3339,8 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw :paramtype location: str """ super().__init__(tags=tags, location=location, **kwargs) - self.token = None - self.expires = None + self.token: Optional[str] = None + self.expires: Optional[datetime.datetime] = None class ContainerAppCollection(_serialization.Model): @@ -2913,7 +3373,7 @@ def __init__(self, *, value: List["_models.ContainerApp"], **kwargs: Any) -> Non """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class ContainerAppJobExecutions(_serialization.Model): @@ -2946,7 +3406,7 @@ def __init__(self, *, value: List["_models.JobExecution"], **kwargs: Any) -> Non """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class ContainerAppProbe(_serialization.Model): @@ -3292,11 +3752,11 @@ class ContainerAppsBuildConfiguration(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.base_os = None - self.platform = None - self.platform_version = None - self.environment_variables = None - self.pre_build_steps = None + self.base_os: Optional[str] = None + self.platform: Optional[str] = None + self.platform_version: Optional[str] = None + self.environment_variables: Optional[List["_models.EnvironmentVariable"]] = None + self.pre_build_steps: Optional[List["_models.PreBuildStep"]] = None class ContainerAppsBuildResource(ProxyResource): @@ -3305,7 +3765,7 @@ class ContainerAppsBuildResource(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3361,11 +3821,11 @@ class ContainerAppsBuildResource(ProxyResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_state = None - self.build_status = None - self.destination_container_registry = None - self.configuration = None - self.log_stream_endpoint = None + self.provisioning_state: Optional[Union[str, "_models.BuildProvisioningState"]] = None + self.build_status: Optional[Union[str, "_models.BuildStatus"]] = None + self.destination_container_registry: Optional["_models.ContainerRegistryWithCustomImage"] = None + self.configuration: Optional["_models.ContainerAppsBuildConfiguration"] = None + self.log_stream_endpoint: Optional[str] = None class ContainerAppSecret(_serialization.Model): @@ -3402,10 +3862,10 @@ class ContainerAppSecret(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.value = None - self.identity = None - self.key_vault_url = None + self.name: Optional[str] = None + self.value: Optional[str] = None + self.identity: Optional[str] = None + self.key_vault_url: Optional[str] = None class ContainerAppsPatchResource(ProxyResource): @@ -3414,7 +3874,7 @@ class ContainerAppsPatchResource(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3447,7 +3907,7 @@ class ContainerAppsPatchResource(ProxyResource): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.properties = None + self.properties: Optional["_models.PatchProperties"] = None class ContainerExecutionStatus(_serialization.Model): @@ -3578,6 +4038,8 @@ class ContainerResources(_serialization.Model): :vartype memory: str :ivar ephemeral_storage: Ephemeral Storage, e.g. "1Gi". :vartype ephemeral_storage: str + :ivar gpu: Required GPU in cores for GPU based app, e.g. 1.0. + :vartype gpu: float """ _validation = { @@ -3588,19 +4050,25 @@ class ContainerResources(_serialization.Model): "cpu": {"key": "cpu", "type": "float"}, "memory": {"key": "memory", "type": "str"}, "ephemeral_storage": {"key": "ephemeralStorage", "type": "str"}, + "gpu": {"key": "gpu", "type": "float"}, } - def __init__(self, *, cpu: Optional[float] = None, memory: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, *, cpu: Optional[float] = None, memory: Optional[str] = None, gpu: Optional[float] = None, **kwargs: Any + ) -> None: """ :keyword cpu: Required CPU in cores, e.g. 0.5. :paramtype cpu: float :keyword memory: Required memory, e.g. "250Mb". :paramtype memory: str + :keyword gpu: Required GPU in cores for GPU based app, e.g. 1.0. + :paramtype gpu: float """ super().__init__(**kwargs) self.cpu = cpu self.memory = memory - self.ephemeral_storage = None + self.ephemeral_storage: Optional[str] = None + self.gpu = gpu class CookieExpiration(_serialization.Model): @@ -3755,7 +4223,8 @@ class CustomDomain(_serialization.Model): :ivar name: Hostname. Required. :vartype name: str - :ivar binding_type: Custom Domain binding type. Known values are: "Disabled" and "SniEnabled". + :ivar binding_type: Custom Domain binding type. Known values are: "Disabled", "SniEnabled", and + "Auto". :vartype binding_type: str or ~azure.mgmt.appcontainers.models.BindingType :ivar certificate_id: Resource Id of the Certificate to be bound to this hostname. Must exist in the Managed Environment. @@ -3783,8 +4252,8 @@ def __init__( """ :keyword name: Hostname. Required. :paramtype name: str - :keyword binding_type: Custom Domain binding type. Known values are: "Disabled" and - "SniEnabled". + :keyword binding_type: Custom Domain binding type. Known values are: "Disabled", "SniEnabled", + and "Auto". :paramtype binding_type: str or ~azure.mgmt.appcontainers.models.BindingType :keyword certificate_id: Resource Id of the Certificate to be bound to this hostname. Must exist in the Managed Environment. @@ -3862,17 +4331,17 @@ def __init__( :paramtype certificate_password: str """ super().__init__(**kwargs) - self.custom_domain_verification_id = None + self.custom_domain_verification_id: Optional[str] = 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 - self.thumbprint = None - self.subject_name = None + self.expiration_date: Optional[datetime.datetime] = None + self.thumbprint: Optional[str] = None + self.subject_name: Optional[str] = None -class CustomHostnameAnalysisResult(_serialization.Model): # pylint: disable=too-many-instance-attributes +class CustomHostnameAnalysisResult(_serialization.Model): """Custom domain analysis. Variables are only populated by the server, and will be ignored when sending a request. @@ -3963,13 +4432,15 @@ def __init__( :paramtype alternate_txt_records: list[str] """ super().__init__(**kwargs) - self.host_name = None - self.is_hostname_already_verified = None - self.custom_domain_verification_test = None - self.custom_domain_verification_failure_info = None - self.has_conflict_on_managed_environment = None - self.conflict_with_environment_custom_domain = None - self.conflicting_container_app_resource_id = None + self.host_name: Optional[str] = None + self.is_hostname_already_verified: Optional[bool] = None + self.custom_domain_verification_test: Optional[Union[str, "_models.DnsVerificationTestResult"]] = None + self.custom_domain_verification_failure_info: Optional[ + "_models.CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo" + ] = None + self.has_conflict_on_managed_environment: Optional[bool] = None + self.conflict_with_environment_custom_domain: Optional[bool] = None + self.conflicting_container_app_resource_id: Optional[str] = None self.c_name_records = c_name_records self.txt_records = txt_records self.a_records = a_records @@ -4022,12 +4493,12 @@ def __init__( """ :keyword details: Details or the error. :paramtype details: - list[~azure.mgmt.appcontainers.models.CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem] # pylint: disable=line-too-long + list[~azure.mgmt.appcontainers.models.CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem] """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None + self.code: Optional[str] = None + self.message: Optional[str] = None + self.target: Optional[str] = None self.details = details @@ -4061,9 +4532,9 @@ class CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None + self.code: Optional[str] = None + self.message: Optional[str] = None + self.target: Optional[str] = None class CustomOpenIdConnectProvider(_serialization.Model): @@ -4184,6 +4655,11 @@ class Dapr(_serialization.Model): :vartype log_level: str or ~azure.mgmt.appcontainers.models.LogLevel :ivar enable_api_logging: Enables API logging for the Dapr sidecar. :vartype enable_api_logging: bool + :ivar app_health: Dapr application health check configuration. + :vartype app_health: ~azure.mgmt.appcontainers.models.DaprAppHealth + :ivar max_concurrency: Maximum number of concurrent requests, events handled by the Dapr + sidecar. + :vartype max_concurrency: int """ _attribute_map = { @@ -4195,6 +4671,8 @@ class Dapr(_serialization.Model): "http_max_request_size": {"key": "httpMaxRequestSize", "type": "int"}, "log_level": {"key": "logLevel", "type": "str"}, "enable_api_logging": {"key": "enableApiLogging", "type": "bool"}, + "app_health": {"key": "appHealth", "type": "DaprAppHealth"}, + "max_concurrency": {"key": "maxConcurrency", "type": "int"}, } def __init__( @@ -4208,6 +4686,8 @@ def __init__( http_max_request_size: Optional[int] = None, log_level: Optional[Union[str, "_models.LogLevel"]] = None, enable_api_logging: Optional[bool] = None, + app_health: Optional["_models.DaprAppHealth"] = None, + max_concurrency: Optional[int] = None, **kwargs: Any ) -> None: """ @@ -4231,6 +4711,11 @@ def __init__( :paramtype log_level: str or ~azure.mgmt.appcontainers.models.LogLevel :keyword enable_api_logging: Enables API logging for the Dapr sidecar. :paramtype enable_api_logging: bool + :keyword app_health: Dapr application health check configuration. + :paramtype app_health: ~azure.mgmt.appcontainers.models.DaprAppHealth + :keyword max_concurrency: Maximum number of concurrent requests, events handled by the Dapr + sidecar. + :paramtype max_concurrency: int """ super().__init__(**kwargs) self.enabled = enabled @@ -4241,15 +4726,76 @@ def __init__( self.http_max_request_size = http_max_request_size self.log_level = log_level self.enable_api_logging = enable_api_logging + self.app_health = app_health + self.max_concurrency = max_concurrency + + +class DaprAppHealth(_serialization.Model): + """Dapr application health check configuration. + + :ivar enabled: Boolean indicating if the health probe is enabled. + :vartype enabled: bool + :ivar path: Path for the health probe. + :vartype path: str + :ivar probe_interval_seconds: Interval for the health probe in seconds. + :vartype probe_interval_seconds: int + :ivar probe_timeout_milliseconds: Timeout for the health probe in milliseconds. + :vartype probe_timeout_milliseconds: int + :ivar threshold: Threshold for the health probe. + :vartype threshold: int + """ + + _validation = { + "probe_interval_seconds": {"minimum": 1}, + "probe_timeout_milliseconds": {"minimum": 1}, + "threshold": {"minimum": 1}, + } + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "path": {"key": "path", "type": "str"}, + "probe_interval_seconds": {"key": "probeIntervalSeconds", "type": "int"}, + "probe_timeout_milliseconds": {"key": "probeTimeoutMilliseconds", "type": "int"}, + "threshold": {"key": "threshold", "type": "int"}, + } -class DaprComponent(ProxyResource): # pylint: disable=too-many-instance-attributes + def __init__( + self, + *, + enabled: Optional[bool] = None, + path: Optional[str] = None, + probe_interval_seconds: Optional[int] = None, + probe_timeout_milliseconds: Optional[int] = None, + threshold: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Boolean indicating if the health probe is enabled. + :paramtype enabled: bool + :keyword path: Path for the health probe. + :paramtype path: str + :keyword probe_interval_seconds: Interval for the health probe in seconds. + :paramtype probe_interval_seconds: int + :keyword probe_timeout_milliseconds: Timeout for the health probe in milliseconds. + :paramtype probe_timeout_milliseconds: int + :keyword threshold: Threshold for the health probe. + :paramtype threshold: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.path = path + self.probe_interval_seconds = probe_interval_seconds + self.probe_timeout_milliseconds = probe_timeout_milliseconds + self.threshold = threshold + + +class DaprComponent(ProxyResource): """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. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4382,7 +4928,7 @@ def __init__(self, *, value: List["_models.DaprComponentResiliencyPolicy"], **kw """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class DaprComponentResiliencyPolicy(ProxyResource): @@ -4391,7 +4937,7 @@ class DaprComponentResiliencyPolicy(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4665,7 +5211,7 @@ def __init__(self, *, value: List["_models.DaprComponent"], **kwargs: Any) -> No """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class DaprComponentServiceBinding(_serialization.Model): @@ -4727,7 +5273,7 @@ class DaprConfiguration(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.version = None + self.version: Optional[str] = None class DaprMetadata(_serialization.Model): @@ -4795,8 +5341,8 @@ class DaprSecret(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.value = None + self.name: Optional[str] = None + self.value: Optional[str] = None class DaprSecretsCollection(_serialization.Model): @@ -4851,13 +5397,13 @@ def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, * self.value = value -class DaprSubscription(ProxyResource): # pylint: disable=too-many-instance-attributes +class DaprSubscription(ProxyResource): """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. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5079,7 +5625,7 @@ def __init__(self, *, value: List["_models.DaprSubscription"], **kwargs: Any) -> """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class DataDogConfiguration(_serialization.Model): @@ -5164,7 +5710,7 @@ class DefaultErrorResponse(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.error = None + self.error: Optional["_models.DefaultErrorResponseError"] = None class DefaultErrorResponseError(_serialization.Model): @@ -5207,11 +5753,11 @@ def __init__( :paramtype details: list[~azure.mgmt.appcontainers.models.DefaultErrorResponseErrorDetailsItem] """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None + self.code: Optional[str] = None + self.message: Optional[str] = None + self.target: Optional[str] = None self.details = details - self.innererror = None + self.innererror: Optional[str] = None class DefaultErrorResponseErrorDetailsItem(_serialization.Model): @@ -5242,9 +5788,9 @@ class DefaultErrorResponseErrorDetailsItem(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None + self.code: Optional[str] = None + self.message: Optional[str] = None + self.target: Optional[str] = None class DestinationsConfiguration(_serialization.Model): @@ -5469,7 +6015,7 @@ class Diagnostics(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5537,7 +6083,7 @@ def __init__(self, *, value: List["_models.Diagnostics"], **kwargs: Any) -> None """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class DiagnosticsDataApiResponse(_serialization.Model): @@ -5633,15 +6179,15 @@ def __init__( :paramtype analysis_types: list[str] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.description = None - self.author = None - self.category = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.description: Optional[str] = None + self.author: Optional[str] = None + self.category: Optional[str] = None self.support_topic_list = support_topic_list self.analysis_types = analysis_types - self.type = None - self.score = None + self.type: Optional[str] = None + self.score: Optional[float] = None class DiagnosticsProperties(_serialization.Model): @@ -5742,8 +6288,8 @@ class DiagnosticSupportTopic(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.pes_id = None + self.id: Optional[str] = None + self.pes_id: Optional[str] = None class DotNetComponent(ProxyResource): @@ -5752,7 +6298,7 @@ class DotNetComponent(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5813,7 +6359,7 @@ def __init__( """ super().__init__(**kwargs) self.component_type = component_type - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.DotNetComponentProvisioningState"]] = None self.configurations = configurations self.service_binds = service_binds @@ -5874,7 +6420,7 @@ def __init__(self, *, value: List["_models.DotNetComponent"], **kwargs: Any) -> """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class DotNetComponentServiceBind(_serialization.Model): @@ -5980,7 +6526,7 @@ class EnvironmentAuthToken(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -6029,8 +6575,8 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw :paramtype location: str """ super().__init__(tags=tags, location=location, **kwargs) - self.token = None - self.expires = None + self.token: Optional[str] = None + self.expires: Optional[datetime.datetime] = None class EnvironmentVar(_serialization.Model): @@ -6131,8 +6677,8 @@ class ErrorAdditionalInfo(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.type = None - self.info = None + self.type: Optional[str] = None + self.info: Optional[JSON] = None class ErrorDetail(_serialization.Model): @@ -6171,11 +6717,11 @@ class ErrorDetail(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None + self.code: Optional[str] = None + self.message: Optional[str] = None + self.target: Optional[str] = None + self.details: Optional[List["_models.ErrorDetail"]] = None + self.additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = None class ErrorEntity(_serialization.Model): @@ -6458,7 +7004,7 @@ def __init__( self.login = login -class GithubActionConfiguration(_serialization.Model): # pylint: disable=too-many-instance-attributes +class GithubActionConfiguration(_serialization.Model): """Configuration properties that define the mutable settings of a Container App SourceControl. :ivar registry_info: Registry configurations. @@ -6566,8 +7112,7 @@ class GlobalValidation(_serialization.Model): ~azure.mgmt.appcontainers.models.UnauthenticatedClientActionV2 :ivar redirect_to_provider: The default authentication provider to use when multiple providers are configured. - This setting is only needed if multiple providers are configured and the unauthenticated - client + This setting is only needed if multiple providers are configured and the unauthenticated client action is set to "RedirectToLoginPage". :vartype redirect_to_provider: str :ivar excluded_paths: The paths for which unauthenticated flow would not be redirected to the @@ -6597,8 +7142,7 @@ def __init__( ~azure.mgmt.appcontainers.models.UnauthenticatedClientActionV2 :keyword redirect_to_provider: The default authentication provider to use when multiple providers are configured. - This setting is only needed if multiple providers are configured and the unauthenticated - client + This setting is only needed if multiple providers are configured and the unauthenticated client action is set to "RedirectToLoginPage". :paramtype redirect_to_provider: str :keyword excluded_paths: The paths for which unauthenticated flow would not be redirected to @@ -6874,6 +7418,357 @@ def __init__( self.max_interval_in_milliseconds = max_interval_in_milliseconds +class HttpRoute(_serialization.Model): + """Http Routes configuration, including paths to match on and whether or not rewrites are to be + done. + + :ivar match: Conditions route will match on. + :vartype match: ~azure.mgmt.appcontainers.models.HttpRouteMatch + :ivar action: Once route is matched, what is the desired action. + :vartype action: ~azure.mgmt.appcontainers.models.HttpRouteAction + """ + + _attribute_map = { + "match": {"key": "match", "type": "HttpRouteMatch"}, + "action": {"key": "action", "type": "HttpRouteAction"}, + } + + def __init__( + self, + *, + match: Optional["_models.HttpRouteMatch"] = None, + action: Optional["_models.HttpRouteAction"] = None, + **kwargs: Any + ) -> None: + """ + :keyword match: Conditions route will match on. + :paramtype match: ~azure.mgmt.appcontainers.models.HttpRouteMatch + :keyword action: Once route is matched, what is the desired action. + :paramtype action: ~azure.mgmt.appcontainers.models.HttpRouteAction + """ + super().__init__(**kwargs) + self.match = match + self.action = action + + +class HttpRouteAction(_serialization.Model): + """Action to perform once matching of routes is done. + + :ivar prefix_rewrite: Rewrite prefix, default is no rewrites. + :vartype prefix_rewrite: str + """ + + _attribute_map = { + "prefix_rewrite": {"key": "prefixRewrite", "type": "str"}, + } + + def __init__(self, *, prefix_rewrite: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword prefix_rewrite: Rewrite prefix, default is no rewrites. + :paramtype prefix_rewrite: str + """ + super().__init__(**kwargs) + self.prefix_rewrite = prefix_rewrite + + +class HttpRouteConfig(ProxyResource): + """Advanced Ingress routing for path/header based routing for a Container App Environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData + :ivar properties: Http Route Config properties. + :vartype properties: ~azure.mgmt.appcontainers.models.HttpRouteConfigProperties + """ + + _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"}, + "properties": {"key": "properties", "type": "HttpRouteConfigProperties"}, + } + + def __init__(self, *, properties: Optional["_models.HttpRouteConfigProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Http Route Config properties. + :paramtype properties: ~azure.mgmt.appcontainers.models.HttpRouteConfigProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class HttpRouteConfigCollection(_serialization.Model): + """Collection of Advanced Ingress Routing Config resources. + + 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.HttpRouteConfig] + :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": "[HttpRouteConfig]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.HttpRouteConfig"], **kwargs: Any) -> None: + """ + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.HttpRouteConfig] + """ + super().__init__(**kwargs) + self.value = value + self.next_link: Optional[str] = None + + +class HttpRouteConfigProperties(_serialization.Model): + """Http Route Config properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The provisioning state of the Http Route Config in cluster. Known + values are: "Succeeded", "Failed", "Canceled", "Waiting", "Updating", "Deleting", and + "Pending". + :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.HttpRouteProvisioningState + :ivar provisioning_errors: List of errors when trying to reconcile http routes. + :vartype provisioning_errors: + list[~azure.mgmt.appcontainers.models.HttpRouteProvisioningErrors] + :ivar fqdn: FQDN of the route resource. + :vartype fqdn: str + :ivar custom_domains: Custom domain bindings for http Routes' hostnames. + :vartype custom_domains: list[~azure.mgmt.appcontainers.models.CustomDomain] + :ivar rules: Routing Rules for http route resource. + :vartype rules: list[~azure.mgmt.appcontainers.models.HttpRouteRule] + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "provisioning_errors": {"readonly": True}, + "fqdn": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "provisioning_errors": {"key": "provisioningErrors", "type": "[HttpRouteProvisioningErrors]"}, + "fqdn": {"key": "fqdn", "type": "str"}, + "custom_domains": {"key": "customDomains", "type": "[CustomDomain]"}, + "rules": {"key": "rules", "type": "[HttpRouteRule]"}, + } + + def __init__( + self, + *, + custom_domains: Optional[List["_models.CustomDomain"]] = None, + rules: Optional[List["_models.HttpRouteRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword custom_domains: Custom domain bindings for http Routes' hostnames. + :paramtype custom_domains: list[~azure.mgmt.appcontainers.models.CustomDomain] + :keyword rules: Routing Rules for http route resource. + :paramtype rules: list[~azure.mgmt.appcontainers.models.HttpRouteRule] + """ + super().__init__(**kwargs) + self.provisioning_state: Optional[Union[str, "_models.HttpRouteProvisioningState"]] = None + self.provisioning_errors: Optional[List["_models.HttpRouteProvisioningErrors"]] = None + self.fqdn: Optional[str] = None + self.custom_domains = custom_domains + self.rules = rules + + +class HttpRouteMatch(_serialization.Model): + """Criteria to match on. + + :ivar prefix: match on all prefix's. Not exact. + :vartype prefix: str + :ivar path: match on exact path. + :vartype path: str + :ivar path_separated_prefix: match on all prefix's. Not exact. + :vartype path_separated_prefix: str + :ivar case_sensitive: path case sensitive, default is true. + :vartype case_sensitive: bool + """ + + _attribute_map = { + "prefix": {"key": "prefix", "type": "str"}, + "path": {"key": "path", "type": "str"}, + "path_separated_prefix": {"key": "pathSeparatedPrefix", "type": "str"}, + "case_sensitive": {"key": "caseSensitive", "type": "bool"}, + } + + def __init__( + self, + *, + prefix: Optional[str] = None, + path: Optional[str] = None, + path_separated_prefix: Optional[str] = None, + case_sensitive: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword prefix: match on all prefix's. Not exact. + :paramtype prefix: str + :keyword path: match on exact path. + :paramtype path: str + :keyword path_separated_prefix: match on all prefix's. Not exact. + :paramtype path_separated_prefix: str + :keyword case_sensitive: path case sensitive, default is true. + :paramtype case_sensitive: bool + """ + super().__init__(**kwargs) + self.prefix = prefix + self.path = path + self.path_separated_prefix = path_separated_prefix + self.case_sensitive = case_sensitive + + +class HttpRouteProvisioningErrors(_serialization.Model): + """List of provisioning errors for a http route config object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar timestamp: Timestamp error occured at. + :vartype timestamp: ~datetime.datetime + :ivar message: Description or error message. + :vartype message: str + """ + + _validation = { + "timestamp": {"readonly": True}, + "message": {"readonly": True}, + } + + _attribute_map = { + "timestamp": {"key": "timestamp", "type": "iso-8601"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.timestamp: Optional[datetime.datetime] = None + self.message: Optional[str] = None + + +class HttpRouteRule(_serialization.Model): + """Http Route rule. + + :ivar targets: Targets- container apps, revisions, labels. + :vartype targets: list[~azure.mgmt.appcontainers.models.HttpRouteTarget] + :ivar routes: Routing configuration that will allow matches on specific paths/headers. + :vartype routes: list[~azure.mgmt.appcontainers.models.HttpRoute] + :ivar description: Description of rule. Optional. + :vartype description: str + """ + + _attribute_map = { + "targets": {"key": "targets", "type": "[HttpRouteTarget]"}, + "routes": {"key": "routes", "type": "[HttpRoute]"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + targets: Optional[List["_models.HttpRouteTarget"]] = None, + routes: Optional[List["_models.HttpRoute"]] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword targets: Targets- container apps, revisions, labels. + :paramtype targets: list[~azure.mgmt.appcontainers.models.HttpRouteTarget] + :keyword routes: Routing configuration that will allow matches on specific paths/headers. + :paramtype routes: list[~azure.mgmt.appcontainers.models.HttpRoute] + :keyword description: Description of rule. Optional. + :paramtype description: str + """ + super().__init__(**kwargs) + self.targets = targets + self.routes = routes + self.description = description + + +class HttpRouteTarget(_serialization.Model): + """Targets - Container App Names, Revision Names, Labels. + + All required parameters must be populated in order to send to server. + + :ivar container_app: Container App Name to route requests to. Required. + :vartype container_app: str + :ivar revision: Revision to route requests to. + :vartype revision: str + :ivar label: Label/Revision to route requests to. + :vartype label: str + :ivar weight: Weighted routing. + :vartype weight: int + """ + + _validation = { + "container_app": {"required": True}, + "weight": {"maximum": 100, "minimum": 0}, + } + + _attribute_map = { + "container_app": {"key": "containerApp", "type": "str"}, + "revision": {"key": "revision", "type": "str"}, + "label": {"key": "label", "type": "str"}, + "weight": {"key": "weight", "type": "int"}, + } + + def __init__( + self, + *, + container_app: str, + revision: Optional[str] = None, + label: Optional[str] = None, + weight: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword container_app: Container App Name to route requests to. Required. + :paramtype container_app: str + :keyword revision: Revision to route requests to. + :paramtype revision: str + :keyword label: Label/Revision to route requests to. + :paramtype label: str + :keyword weight: Weighted routing. + :paramtype weight: int + """ + super().__init__(**kwargs) + self.container_app = container_app + self.revision = revision + self.label = label + self.weight = weight + + class HttpScaleRule(_serialization.Model): """Container App container Http scaling rule. @@ -7088,7 +7983,11 @@ class IdentitySettings(_serialization.Model): } def __init__( - self, *, identity: str, lifecycle: Union[str, "_models.IdentitySettingsLifeCycle"] = "All", **kwargs: Any + self, + *, + identity: str, + lifecycle: Optional[Union[str, "_models.IdentitySettingsLifeCycle"]] = None, + **kwargs: Any ) -> None: """ :keyword identity: The resource ID of a user-assigned managed identity that is assigned to the @@ -7103,7 +8002,7 @@ def __init__( self.lifecycle = lifecycle -class Ingress(_serialization.Model): # pylint: disable=too-many-instance-attributes +class Ingress(_serialization.Model): """Container App Ingress configuration. Variables are only populated by the server, and will be ignored when sending a request. @@ -7224,20 +8123,112 @@ def __init__( ~azure.mgmt.appcontainers.models.IngressTargetPortHttpScheme """ super().__init__(**kwargs) - self.fqdn = None - self.external = external - self.target_port = target_port - self.exposed_port = exposed_port - self.transport = transport - self.traffic = traffic - self.custom_domains = custom_domains - self.allow_insecure = allow_insecure - self.ip_security_restrictions = ip_security_restrictions - self.sticky_sessions = sticky_sessions - 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 + self.fqdn: Optional[str] = None + self.external = external + self.target_port = target_port + self.exposed_port = exposed_port + self.transport = transport + self.traffic = traffic + self.custom_domains = custom_domains + self.allow_insecure = allow_insecure + self.ip_security_restrictions = ip_security_restrictions + self.sticky_sessions = sticky_sessions + 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 IngressConfiguration(_serialization.Model): + """Settings for the ingress component, including workload profile, scaling, and connection + handling. + + :ivar workload_profile_name: Name of the workload profile used by the ingress component. + Required. + :vartype workload_profile_name: str + :ivar scale: Scaling configuration for the ingress component. Required. + :vartype scale: ~azure.mgmt.appcontainers.models.IngressConfigurationScale + :ivar termination_grace_period_seconds: Time (in seconds) to allow active connections to + complete on termination. Must be between 0 and 3600. Defaults to 480 seconds. + :vartype termination_grace_period_seconds: int + :ivar header_count_limit: Maximum number of headers per request allowed by the ingress. Must be + at least 1. Defaults to 100. + :vartype header_count_limit: int + :ivar request_idle_timeout: Duration (in minutes) before idle requests are timed out. Must be + at least 1 minute. Defaults to 4 minutes. + :vartype request_idle_timeout: int + """ + + _attribute_map = { + "workload_profile_name": {"key": "workloadProfileName", "type": "str"}, + "scale": {"key": "scale", "type": "IngressConfigurationScale"}, + "termination_grace_period_seconds": {"key": "terminationGracePeriodSeconds", "type": "int"}, + "header_count_limit": {"key": "headerCountLimit", "type": "int"}, + "request_idle_timeout": {"key": "requestIdleTimeout", "type": "int"}, + } + + def __init__( + self, + *, + workload_profile_name: Optional[str] = None, + scale: Optional["_models.IngressConfigurationScale"] = None, + termination_grace_period_seconds: Optional[int] = None, + header_count_limit: Optional[int] = None, + request_idle_timeout: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword workload_profile_name: Name of the workload profile used by the ingress component. + Required. + :paramtype workload_profile_name: str + :keyword scale: Scaling configuration for the ingress component. Required. + :paramtype scale: ~azure.mgmt.appcontainers.models.IngressConfigurationScale + :keyword termination_grace_period_seconds: Time (in seconds) to allow active connections to + complete on termination. Must be between 0 and 3600. Defaults to 480 seconds. + :paramtype termination_grace_period_seconds: int + :keyword header_count_limit: Maximum number of headers per request allowed by the ingress. Must + be at least 1. Defaults to 100. + :paramtype header_count_limit: int + :keyword request_idle_timeout: Duration (in minutes) before idle requests are timed out. Must + be at least 1 minute. Defaults to 4 minutes. + :paramtype request_idle_timeout: int + """ + super().__init__(**kwargs) + self.workload_profile_name = workload_profile_name + self.scale = scale + self.termination_grace_period_seconds = termination_grace_period_seconds + self.header_count_limit = header_count_limit + self.request_idle_timeout = request_idle_timeout + + +class IngressConfigurationScale(_serialization.Model): + """Scaling configuration for the ingress component. Required. + + :ivar min_replicas: Minimum number of ingress replicas. Must be at least 2. Required. + :vartype min_replicas: int + :ivar max_replicas: Maximum number of ingress replicas. Must be greater than or equal to + minReplicas. + :vartype max_replicas: int + """ + + _attribute_map = { + "min_replicas": {"key": "minReplicas", "type": "int"}, + "max_replicas": {"key": "maxReplicas", "type": "int"}, + } + + def __init__( + self, *, min_replicas: Optional[int] = None, max_replicas: Optional[int] = None, **kwargs: Any + ) -> None: + """ + :keyword min_replicas: Minimum number of ingress replicas. Must be at least 2. Required. + :paramtype min_replicas: int + :keyword max_replicas: Maximum number of ingress replicas. Must be greater than or equal to + minReplicas. + :paramtype max_replicas: int + """ + super().__init__(**kwargs) + self.min_replicas = min_replicas + self.max_replicas = max_replicas class IngressPortMapping(_serialization.Model): @@ -7391,7 +8382,7 @@ class JavaComponent(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -7475,7 +8466,7 @@ class JavaComponentIngress(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.fqdn = None + self.fqdn: Optional[str] = None class JavaComponentProperties(_serialization.Model): @@ -7547,7 +8538,7 @@ def __init__( """ super().__init__(**kwargs) self.component_type: Optional[str] = None - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.JavaComponentProvisioningState"]] = None self.configurations = configurations self.scale = scale self.service_binds = service_binds @@ -7613,7 +8604,7 @@ def __init__(self, *, value: List["_models.JavaComponent"], **kwargs: Any) -> No """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class JavaComponentServiceBind(_serialization.Model): @@ -7642,7 +8633,7 @@ def __init__(self, *, name: Optional[str] = None, service_id: Optional[str] = No self.service_id = service_id -class Job(TrackedResource): # pylint: disable=too-many-instance-attributes +class Job(TrackedResource): """Container App Job. Variables are only populated by the server, and will be ignored when sending a request. @@ -7650,7 +8641,7 @@ class Job(TrackedResource): # pylint: disable=too-many-instance-attributes All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -7755,14 +8746,14 @@ def __init__( super().__init__(tags=tags, location=location, **kwargs) self.extended_location = extended_location self.identity = identity - self.provisioning_state = None - self.running_state = None + self.provisioning_state: Optional[Union[str, "_models.JobProvisioningState"]] = None + self.running_state: Optional[Union[str, "_models.JobRunningState"]] = None self.environment_id = environment_id self.workload_profile_name = workload_profile_name self.configuration = configuration self.template = template - self.outbound_ip_addresses = None - self.event_stream_endpoint = None + self.outbound_ip_addresses: Optional[List[str]] = None + self.event_stream_endpoint: Optional[str] = None class JobConfiguration(_serialization.Model): @@ -8062,7 +9053,7 @@ def __init__( self.name = name self.id = id self.type = type - self.status = None + self.status: Optional[Union[str, "_models.JobExecutionRunningState"]] = None self.start_time = start_time self.end_time = end_time self.template = template @@ -8457,7 +9448,7 @@ def __init__(self, *, value: List["_models.Job"], **kwargs: Any) -> None: """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class JobSecretsCollection(_serialization.Model): @@ -8578,7 +9569,147 @@ class KedaConfiguration(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.version = None + self.version: Optional[str] = None + + +class LabelHistory(ProxyResource): + """Container App Label History. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData + :ivar properties: Container App Label History resource specific properties. + :vartype properties: ~azure.mgmt.appcontainers.models.LabelHistoryProperties + """ + + _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"}, + "properties": {"key": "properties", "type": "LabelHistoryProperties"}, + } + + def __init__(self, *, properties: Optional["_models.LabelHistoryProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Container App Label History resource specific properties. + :paramtype properties: ~azure.mgmt.appcontainers.models.LabelHistoryProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class LabelHistoryCollection(_serialization.Model): + """Container App Label History collection 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.LabelHistory] + :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": "[LabelHistory]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.LabelHistory"], **kwargs: Any) -> None: + """ + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.LabelHistory] + """ + super().__init__(**kwargs) + self.value = value + self.next_link: Optional[str] = None + + +class LabelHistoryProperties(_serialization.Model): + """Container App Label History resource specific properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar records: List of label history records. + :vartype records: list[~azure.mgmt.appcontainers.models.LabelHistoryRecordItem] + """ + + _validation = { + "records": {"readonly": True}, + } + + _attribute_map = { + "records": {"key": "records", "type": "[LabelHistoryRecordItem]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.records: Optional[List["_models.LabelHistoryRecordItem"]] = None + + +class LabelHistoryRecordItem(_serialization.Model): + """Container App Label History Item resource specific properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar revision: Container App revision name that label was applied to. + :vartype revision: str + :ivar start: Timestamp describing when the label was applied to the revision. + :vartype start: ~datetime.datetime + :ivar stop: Timestamp describing when the label was removed from the revision. Only meaningful + when the label is currently applied to the revision. + :vartype stop: ~datetime.datetime + :ivar status: Status of the label history record. Known values are: "Succeeded", "Failed", and + "Starting". + :vartype status: str or ~azure.mgmt.appcontainers.models.Status + """ + + _validation = { + "revision": {"readonly": True}, + "start": {"readonly": True}, + "stop": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "revision": {"key": "revision", "type": "str"}, + "start": {"key": "start", "type": "iso-8601"}, + "stop": {"key": "stop", "type": "iso-8601"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.revision: Optional[str] = None + self.start: Optional[datetime.datetime] = None + self.stop: Optional[datetime.datetime] = None + self.status: Optional[Union[str, "_models.Status"]] = None class ListUsagesResult(_serialization.Model): @@ -8694,7 +9825,7 @@ class LogicApp(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -8861,6 +9992,82 @@ def __init__(self, *, destinations: Optional[List[str]] = None, **kwargs: Any) - self.destinations = destinations +class MaintenanceConfigurationCollection(_serialization.Model): + """The response of list maintenance configuration resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Results of the list maintenance configuration resources. + :vartype value: list[~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource] + :ivar next_link: Link for next page of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[MaintenanceConfigurationResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.MaintenanceConfigurationResource"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Results of the list maintenance configuration resources. + :paramtype value: list[~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource] + """ + super().__init__(**kwargs) + self.value = value + self.next_link: Optional[str] = None + + +class MaintenanceConfigurationResource(ProxyResource): + """Information about the Maintenance Configuration resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData + :ivar scheduled_entries: List of maintenance schedules for a managed environment. + :vartype scheduled_entries: list[~azure.mgmt.appcontainers.models.ScheduledEntry] + """ + + _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"}, + "scheduled_entries": {"key": "properties.scheduledEntries", "type": "[ScheduledEntry]"}, + } + + def __init__(self, *, scheduled_entries: Optional[List["_models.ScheduledEntry"]] = None, **kwargs: Any) -> None: + """ + :keyword scheduled_entries: List of maintenance schedules for a managed environment. + :paramtype scheduled_entries: list[~azure.mgmt.appcontainers.models.ScheduledEntry] + """ + super().__init__(**kwargs) + self.scheduled_entries = scheduled_entries + + class ManagedCertificate(TrackedResource): """Managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. @@ -8870,7 +10077,7 @@ class ManagedCertificate(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -8956,7 +10163,7 @@ def __init__(self, *, value: List["_models.ManagedCertificate"], **kwargs: Any) """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class ManagedCertificatePatch(_serialization.Model): @@ -8985,7 +10192,7 @@ class ManagedCertificateProperties(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar provisioning_state: Provisioning state of the certificate. Known values are: "Succeeded", - "Failed", "Canceled", "DeleteFailed", and "Pending". + "Failed", "Canceled", "DeleteFailed", "Pending", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.CertificateProvisioningState :ivar subject_name: Subject name of the certificate. @@ -9031,14 +10238,14 @@ def __init__( ~azure.mgmt.appcontainers.models.ManagedCertificateDomainControlValidation """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.CertificateProvisioningState"]] = None self.subject_name = subject_name - self.error = None + self.error: Optional[str] = None self.domain_control_validation = domain_control_validation - self.validation_token = None + self.validation_token: Optional[str] = None -class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance-attributes +class ManagedEnvironment(TrackedResource): """An environment for hosting container apps. Variables are only populated by the server, and will be ignored when sending a request. @@ -9046,7 +10253,7 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -9082,11 +10289,12 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- :vartype deployment_errors: str :ivar default_domain: Default Domain Name for the cluster. :vartype default_domain: str + :ivar private_link_default_domain: Private Link Default Domain Name for the environment. + :vartype private_link_default_domain: str :ivar static_ip: Static IP of the Environment. :vartype static_ip: str - :ivar app_logs_configuration: Cluster configuration which enables the log daemon to export - app logs to a destination. Currently only "log-analytics" is - supported. + :ivar app_logs_configuration: Cluster configuration which enables the log daemon to export app + logs to configured destination. :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 @@ -9095,6 +10303,8 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- ~azure.mgmt.appcontainers.models.OpenTelemetryConfiguration :ivar zone_redundant: Whether or not this Managed Environment is zone-redundant. :vartype zone_redundant: bool + :ivar availability_zones: The list of availability zones to use for managed environment. + :vartype availability_zones: list[str] :ivar custom_domain_configuration: Custom domain configuration for the environment. :vartype custom_domain_configuration: ~azure.mgmt.appcontainers.models.CustomDomainConfiguration @@ -9116,6 +10326,8 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- :ivar peer_traffic_configuration: Peer traffic settings for the Managed Environment. :vartype peer_traffic_configuration: ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration + :ivar ingress_configuration: Ingress configuration for the Managed Environment. + :vartype ingress_configuration: ~azure.mgmt.appcontainers.models.IngressConfiguration :ivar private_endpoint_connections: Private endpoint connections to the resource. :vartype private_endpoint_connections: list[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] @@ -9133,6 +10345,7 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- "provisioning_state": {"readonly": True}, "deployment_errors": {"readonly": True}, "default_domain": {"readonly": True}, + "private_link_default_domain": {"readonly": True}, "static_ip": {"readonly": True}, "event_stream_endpoint": {"readonly": True}, "private_endpoint_connections": {"readonly": True}, @@ -9153,6 +10366,7 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- "vnet_configuration": {"key": "properties.vnetConfiguration", "type": "VnetConfiguration"}, "deployment_errors": {"key": "properties.deploymentErrors", "type": "str"}, "default_domain": {"key": "properties.defaultDomain", "type": "str"}, + "private_link_default_domain": {"key": "properties.privateLinkDefaultDomain", "type": "str"}, "static_ip": {"key": "properties.staticIp", "type": "str"}, "app_logs_configuration": {"key": "properties.appLogsConfiguration", "type": "AppLogsConfiguration"}, "app_insights_configuration": { @@ -9164,6 +10378,7 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- "type": "OpenTelemetryConfiguration", }, "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, + "availability_zones": {"key": "properties.availabilityZones", "type": "[str]"}, "custom_domain_configuration": { "key": "properties.customDomainConfiguration", "type": "CustomDomainConfiguration", @@ -9181,6 +10396,7 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- "key": "properties.peerTrafficConfiguration", "type": "ManagedEnvironmentPropertiesPeerTrafficConfiguration", }, + "ingress_configuration": {"key": "properties.ingressConfiguration", "type": "IngressConfiguration"}, "private_endpoint_connections": { "key": "properties.privateEndpointConnections", "type": "[PrivateEndpointConnection]", @@ -9202,6 +10418,7 @@ def __init__( # pylint: disable=too-many-locals app_insights_configuration: Optional["_models.AppInsightsConfiguration"] = None, open_telemetry_configuration: Optional["_models.OpenTelemetryConfiguration"] = None, zone_redundant: Optional[bool] = None, + availability_zones: Optional[List[str]] = None, custom_domain_configuration: Optional["_models.CustomDomainConfiguration"] = None, workload_profiles: Optional[List["_models.WorkloadProfile"]] = None, keda_configuration: Optional["_models.KedaConfiguration"] = None, @@ -9209,6 +10426,7 @@ def __init__( # pylint: disable=too-many-locals infrastructure_resource_group: Optional[str] = None, peer_authentication: Optional["_models.ManagedEnvironmentPropertiesPeerAuthentication"] = None, peer_traffic_configuration: Optional["_models.ManagedEnvironmentPropertiesPeerTrafficConfiguration"] = None, + ingress_configuration: Optional["_models.IngressConfiguration"] = None, public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, **kwargs: Any ) -> None: @@ -9231,8 +10449,7 @@ def __init__( # pylint: disable=too-many-locals :keyword vnet_configuration: Vnet configuration for the environment. :paramtype vnet_configuration: ~azure.mgmt.appcontainers.models.VnetConfiguration :keyword app_logs_configuration: Cluster configuration which enables the log daemon to export - app logs to a destination. Currently only "log-analytics" is - supported. + app logs to configured destination. :paramtype app_logs_configuration: ~azure.mgmt.appcontainers.models.AppLogsConfiguration :keyword app_insights_configuration: Environment level Application Insights configuration. :paramtype app_insights_configuration: @@ -9242,6 +10459,8 @@ def __init__( # pylint: disable=too-many-locals ~azure.mgmt.appcontainers.models.OpenTelemetryConfiguration :keyword zone_redundant: Whether or not this Managed Environment is zone-redundant. :paramtype zone_redundant: bool + :keyword availability_zones: The list of availability zones to use for managed environment. + :paramtype availability_zones: list[str] :keyword custom_domain_configuration: Custom domain configuration for the environment. :paramtype custom_domain_configuration: ~azure.mgmt.appcontainers.models.CustomDomainConfiguration @@ -9261,6 +10480,8 @@ def __init__( # pylint: disable=too-many-locals :keyword peer_traffic_configuration: Peer traffic settings for the Managed Environment. :paramtype peer_traffic_configuration: ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration + :keyword ingress_configuration: Ingress configuration for the Managed Environment. + :paramtype ingress_configuration: ~azure.mgmt.appcontainers.models.IngressConfiguration :keyword public_network_access: Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. Known values are: "Enabled" and "Disabled". :paramtype public_network_access: str or ~azure.mgmt.appcontainers.models.PublicNetworkAccess @@ -9268,26 +10489,29 @@ def __init__( # pylint: disable=too-many-locals super().__init__(tags=tags, location=location, **kwargs) self.kind = kind self.identity = identity - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.EnvironmentProvisioningState"]] = None self.dapr_ai_instrumentation_key = dapr_ai_instrumentation_key self.dapr_ai_connection_string = dapr_ai_connection_string self.vnet_configuration = vnet_configuration - self.deployment_errors = None - self.default_domain = None - self.static_ip = None + self.deployment_errors: Optional[str] = None + self.default_domain: Optional[str] = None + self.private_link_default_domain: Optional[str] = None + self.static_ip: Optional[str] = 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.availability_zones = availability_zones self.custom_domain_configuration = custom_domain_configuration - self.event_stream_endpoint = None + self.event_stream_endpoint: Optional[str] = None self.workload_profiles = workload_profiles self.keda_configuration = keda_configuration self.dapr_configuration = dapr_configuration self.infrastructure_resource_group = infrastructure_resource_group self.peer_authentication = peer_authentication self.peer_traffic_configuration = peer_traffic_configuration - self.private_endpoint_connections = None + self.ingress_configuration = ingress_configuration + self.private_endpoint_connections: Optional[List["_models.PrivateEndpointConnection"]] = None self.public_network_access = public_network_access @@ -9390,7 +10614,7 @@ def __init__(self, *, value: List["_models.ManagedEnvironment"], **kwargs: Any) """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class ManagedEnvironmentStorage(ProxyResource): @@ -9399,7 +10623,7 @@ class ManagedEnvironmentStorage(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -9497,6 +10721,48 @@ def __init__(self, *, value: List["_models.ManagedEnvironmentStorage"], **kwargs self.value = value +class ManagedIdentitySetting(_serialization.Model): + """Optional settings for a Managed Identity that is assigned to the Session pool. + + All required parameters must be populated in order to send to server. + + :ivar identity: The resource ID of a user-assigned managed identity that is assigned to the + Session Pool, or 'system' for system-assigned identity. Required. + :vartype identity: str + :ivar lifecycle: Use to select the lifecycle stages of a Session Pool during which the Managed + Identity should be available. Known values are: "Init", "Main", "None", and "All". + :vartype lifecycle: str or ~azure.mgmt.appcontainers.models.IdentitySettingsLifeCycle + """ + + _validation = { + "identity": {"required": True}, + } + + _attribute_map = { + "identity": {"key": "identity", "type": "str"}, + "lifecycle": {"key": "lifecycle", "type": "str"}, + } + + def __init__( + self, + *, + identity: str, + lifecycle: Optional[Union[str, "_models.IdentitySettingsLifeCycle"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword identity: The resource ID of a user-assigned managed identity that is assigned to the + Session Pool, or 'system' for system-assigned identity. Required. + :paramtype identity: str + :keyword lifecycle: Use to select the lifecycle stages of a Session Pool during which the + Managed Identity should be available. Known values are: "Init", "Main", "None", and "All". + :paramtype lifecycle: str or ~azure.mgmt.appcontainers.models.IdentitySettingsLifeCycle + """ + super().__init__(**kwargs) + self.identity = identity + self.lifecycle = lifecycle + + class ManagedServiceIdentity(_serialization.Model): """Managed service identity (system assigned and/or user assigned identities). @@ -9516,7 +10782,7 @@ class ManagedServiceIdentity(_serialization.Model): :vartype type: str or ~azure.mgmt.appcontainers.models.ManagedServiceIdentityType :ivar user_assigned_identities: The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. :vartype user_assigned_identities: dict[str, ~azure.mgmt.appcontainers.models.UserAssignedIdentity] @@ -9549,14 +10815,14 @@ def __init__( :paramtype type: str or ~azure.mgmt.appcontainers.models.ManagedServiceIdentityType :keyword user_assigned_identities: The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. :paramtype user_assigned_identities: dict[str, ~azure.mgmt.appcontainers.models.UserAssignedIdentity] """ super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None + self.principal_id: Optional[str] = None + self.tenant_id: Optional[str] = None self.type = type self.user_assigned_identities = user_assigned_identities @@ -10178,14 +11444,14 @@ class PatchDetails(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.target_container_name = None - self.target_image = None - self.last_detection_time = None - self.detection_status = None - self.new_image_name = None - self.new_layer = None - self.old_layer = None - self.patch_type = None + self.target_container_name: Optional[str] = None + self.target_image: Optional[str] = None + self.last_detection_time: Optional[datetime.datetime] = None + self.detection_status: Optional[Union[str, "_models.DetectionStatus"]] = None + self.new_image_name: Optional[str] = None + self.new_layer: Optional["_models.PatchDetailsNewLayer"] = None + self.old_layer: Optional["_models.PatchDetailsOldLayer"] = None + self.patch_type: Optional[Union[str, "_models.PatchType"]] = None class PatchDetailsNewLayer(_serialization.Model): @@ -10332,10 +11598,10 @@ def __init__( self.target_environment_id = target_environment_id self.target_container_app_id = target_container_app_id self.target_revision_id = target_revision_id - self.patch_apply_status = None - self.created_at = None - self.last_modified_at = None - self.patch_details = None + self.patch_apply_status: Optional[Union[str, "_models.PatchApplyStatus"]] = None + self.created_at: Optional[datetime.datetime] = None + self.last_modified_at: Optional[datetime.datetime] = None + self.patch_details: Optional[List["_models.PatchDetails"]] = None class PatchSkipConfig(_serialization.Model): @@ -10417,7 +11683,7 @@ class PrivateEndpoint(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None + self.id: Optional[str] = None class PrivateEndpointConnection(Resource): @@ -10426,7 +11692,7 @@ class PrivateEndpointConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -10490,10 +11756,10 @@ def __init__( ~azure.mgmt.appcontainers.models.PrivateLinkServiceConnectionState """ super().__init__(**kwargs) - self.group_ids = None + self.group_ids: Optional[List[str]] = None self.private_endpoint = private_endpoint self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = None class PrivateEndpointConnectionListResult(_serialization.Model): @@ -10523,7 +11789,7 @@ def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class PrivateLinkResource(Resource): @@ -10532,7 +11798,7 @@ class PrivateLinkResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -10575,8 +11841,8 @@ def __init__(self, *, required_zone_names: Optional[List[str]] = None, **kwargs: :paramtype required_zone_names: list[str] """ super().__init__(**kwargs) - self.group_id = None - self.required_members = None + self.group_id: Optional[str] = None + self.required_members: Optional[List[str]] = None self.required_zone_names = required_zone_names @@ -10607,7 +11873,7 @@ def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = Non """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class PrivateLinkServiceConnectionState(_serialization.Model): @@ -10806,7 +12072,7 @@ class Replica(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -10865,9 +12131,9 @@ def __init__( :paramtype init_containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] """ super().__init__(**kwargs) - self.created_time = None - self.running_state = None - self.running_state_details = None + self.created_time: Optional[datetime.datetime] = None + self.running_state: Optional[Union[str, "_models.ContainerAppReplicaRunningState"]] = None + self.running_state_details: Optional[str] = None self.containers = containers self.init_containers = init_containers @@ -10976,11 +12242,11 @@ def __init__( self.ready = ready self.started = started self.restart_count = restart_count - self.running_state = None - self.running_state_details = None - self.log_stream_endpoint = None - self.exec_endpoint = None - self.debug_endpoint = None + self.running_state: Optional[Union[str, "_models.ContainerAppContainerRunningState"]] = None + self.running_state_details: Optional[str] = None + self.log_stream_endpoint: Optional[str] = None + self.exec_endpoint: Optional[str] = None + self.debug_endpoint: Optional[str] = None class ReplicaExecutionStatus(_serialization.Model): @@ -11015,13 +12281,13 @@ def __init__( self.containers = containers -class Revision(ProxyResource): # pylint: disable=too-many-instance-attributes +class Revision(ProxyResource): """Container App Revision. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -11049,6 +12315,8 @@ class Revision(ProxyResource): # pylint: disable=too-many-instance-attributes :vartype replicas: int :ivar traffic_weight: Traffic weight assigned to this revision. :vartype traffic_weight: int + :ivar labels: List of labels assigned to this revision. + :vartype labels: list[str] :ivar provisioning_error: Optional Field - Platform Error Message. :vartype provisioning_error: str :ivar health_state: Current health State of the revision. Known values are: "Healthy", @@ -11074,6 +12342,7 @@ class Revision(ProxyResource): # pylint: disable=too-many-instance-attributes "active": {"readonly": True}, "replicas": {"readonly": True}, "traffic_weight": {"readonly": True}, + "labels": {"readonly": True}, "provisioning_error": {"readonly": True}, "health_state": {"readonly": True}, "provisioning_state": {"readonly": True}, @@ -11092,6 +12361,7 @@ class Revision(ProxyResource): # pylint: disable=too-many-instance-attributes "active": {"key": "properties.active", "type": "bool"}, "replicas": {"key": "properties.replicas", "type": "int"}, "traffic_weight": {"key": "properties.trafficWeight", "type": "int"}, + "labels": {"key": "properties.labels", "type": "[str]"}, "provisioning_error": {"key": "properties.provisioningError", "type": "str"}, "health_state": {"key": "properties.healthState", "type": "str"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, @@ -11101,17 +12371,18 @@ class Revision(ProxyResource): # pylint: disable=too-many-instance-attributes def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.created_time = None - self.last_active_time = None - self.fqdn = None - self.template = None - self.active = None - self.replicas = None - self.traffic_weight = None - self.provisioning_error = None - self.health_state = None - self.provisioning_state = None - self.running_state = None + self.created_time: Optional[datetime.datetime] = None + self.last_active_time: Optional[datetime.datetime] = None + self.fqdn: Optional[str] = None + self.template: Optional["_models.Template"] = None + self.active: Optional[bool] = None + self.replicas: Optional[int] = None + self.traffic_weight: Optional[int] = None + self.labels: Optional[List[str]] = None + self.provisioning_error: Optional[str] = None + self.health_state: Optional[Union[str, "_models.RevisionHealthState"]] = None + self.provisioning_state: Optional[Union[str, "_models.RevisionProvisioningState"]] = None + self.running_state: Optional[Union[str, "_models.RevisionRunningState"]] = None class RevisionCollection(_serialization.Model): @@ -11144,7 +12415,7 @@ def __init__(self, *, value: List["_models.Revision"], **kwargs: Any) -> None: """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class Runtime(_serialization.Model): @@ -11511,6 +12782,52 @@ def __init__( self.order = order +class ScheduledEntry(_serialization.Model): + """Maintenance schedule entry for a managed environment. + + All required parameters must be populated in order to send to server. + + :ivar week_day: Day of the week when a managed environment can be patched. Required. Known + values are: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". + :vartype week_day: str or ~azure.mgmt.appcontainers.models.WeekDay + :ivar start_hour_utc: Start hour after which managed environment maintenance can start from 0 + to 23 hour. Required. + :vartype start_hour_utc: int + :ivar duration_hours: Length of maintenance window range from 8 to 24 hours. Required. + :vartype duration_hours: int + """ + + _validation = { + "week_day": {"required": True}, + "start_hour_utc": {"required": True}, + "duration_hours": {"required": True}, + } + + _attribute_map = { + "week_day": {"key": "weekDay", "type": "str"}, + "start_hour_utc": {"key": "startHourUtc", "type": "int"}, + "duration_hours": {"key": "durationHours", "type": "int"}, + } + + def __init__( + self, *, week_day: Union[str, "_models.WeekDay"], start_hour_utc: int, duration_hours: int, **kwargs: Any + ) -> None: + """ + :keyword week_day: Day of the week when a managed environment can be patched. Required. Known + values are: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". + :paramtype week_day: str or ~azure.mgmt.appcontainers.models.WeekDay + :keyword start_hour_utc: Start hour after which managed environment maintenance can start from + 0 to 23 hour. Required. + :paramtype start_hour_utc: int + :keyword duration_hours: Length of maintenance window range from 8 to 24 hours. Required. + :paramtype duration_hours: int + """ + super().__init__(**kwargs) + self.week_day = week_day + self.start_hour_utc = start_hour_utc + self.duration_hours = duration_hours + + class Secret(_serialization.Model): """Secret definition. @@ -11561,6 +12878,34 @@ def __init__( self.key_vault_url = key_vault_url +class SecretKeyVaultProperties(_serialization.Model): + """Properties for a secret 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. + :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. + :paramtype key_vault_url: str + """ + super().__init__(**kwargs) + self.identity = identity + self.key_vault_url = key_vault_url + + class SecretsCollection(_serialization.Model): """Container App Secrets Collection ARM resource. @@ -11815,7 +13160,7 @@ def __init__(self, *, status: Optional[Union[str, "_models.SessionNetworkStatus" self.status = status -class SessionPool(TrackedResource): # pylint: disable=too-many-instance-attributes +class SessionPool(TrackedResource): """Container App session pool. Variables are only populated by the server, and will be ignored when sending a request. @@ -11823,7 +13168,7 @@ class SessionPool(TrackedResource): # pylint: disable=too-many-instance-attribu All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -11837,6 +13182,9 @@ class SessionPool(TrackedResource): # pylint: disable=too-many-instance-attribu :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str + :ivar identity: Managed identities needed by a session pool to interact with other Azure + services to not maintain any secrets or credentials in code. + :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity :ivar environment_id: Resource ID of the session pool's environment. :vartype environment_id: str :ivar container_type: The container type of the sessions. Known values are: "CustomContainer" @@ -11866,6 +13214,10 @@ class SessionPool(TrackedResource): # pylint: disable=too-many-instance-attribu "InProgress", "Succeeded", "Failed", "Canceled", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.SessionPoolProvisioningState + :ivar managed_identity_settings: Optional settings for a Managed Identity that is assigned to + the Session pool. + :vartype managed_identity_settings: + list[~azure.mgmt.appcontainers.models.ManagedIdentitySetting] """ _validation = { @@ -11886,6 +13238,7 @@ class SessionPool(TrackedResource): # pylint: disable=too-many-instance-attribu "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "environment_id": {"key": "properties.environmentId", "type": "str"}, "container_type": {"key": "properties.containerType", "type": "str"}, "pool_management_type": {"key": "properties.poolManagementType", "type": "str"}, @@ -11903,6 +13256,7 @@ class SessionPool(TrackedResource): # pylint: disable=too-many-instance-attribu }, "pool_management_endpoint": {"key": "properties.poolManagementEndpoint", "type": "str"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "managed_identity_settings": {"key": "properties.managedIdentitySettings", "type": "[ManagedIdentitySetting]"}, } def __init__( @@ -11910,6 +13264,7 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, environment_id: Optional[str] = None, container_type: Optional[Union[str, "_models.ContainerType"]] = None, pool_management_type: Optional[Union[str, "_models.PoolManagementType"]] = None, @@ -11918,6 +13273,7 @@ def __init__( dynamic_pool_configuration: Optional["_models.DynamicPoolConfiguration"] = None, custom_container_template: Optional["_models.CustomContainerTemplate"] = None, session_network_configuration: Optional["_models.SessionNetworkConfiguration"] = None, + managed_identity_settings: Optional[List["_models.ManagedIdentitySetting"]] = None, **kwargs: Any ) -> None: """ @@ -11925,6 +13281,9 @@ def __init__( :paramtype tags: dict[str, str] :keyword location: The geo-location where the resource lives. Required. :paramtype location: str + :keyword identity: Managed identities needed by a session pool to interact with other Azure + services to not maintain any secrets or credentials in code. + :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity :keyword environment_id: Resource ID of the session pool's environment. :paramtype environment_id: str :keyword container_type: The container type of the sessions. Known values are: @@ -11948,19 +13307,25 @@ def __init__( session pool. :paramtype session_network_configuration: ~azure.mgmt.appcontainers.models.SessionNetworkConfiguration + :keyword managed_identity_settings: Optional settings for a Managed Identity that is assigned + to the Session pool. + :paramtype managed_identity_settings: + list[~azure.mgmt.appcontainers.models.ManagedIdentitySetting] """ super().__init__(tags=tags, location=location, **kwargs) + self.identity = identity self.environment_id = environment_id self.container_type = container_type self.pool_management_type = pool_management_type - self.node_count = None + self.node_count: Optional[int] = None self.scale_configuration = scale_configuration self.secrets = secrets self.dynamic_pool_configuration = dynamic_pool_configuration self.custom_container_template = custom_container_template self.session_network_configuration = session_network_configuration - self.pool_management_endpoint = None - self.provisioning_state = None + self.pool_management_endpoint: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.SessionPoolProvisioningState"]] = None + self.managed_identity_settings = managed_identity_settings class SessionPoolCollection(_serialization.Model): @@ -11993,7 +13358,7 @@ def __init__(self, *, value: List["_models.SessionPool"], **kwargs: Any) -> None """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class SessionPoolSecret(_serialization.Model): @@ -12025,6 +13390,9 @@ def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, * class SessionPoolUpdatableProperties(_serialization.Model): """Container App session pool updatable properties. + :ivar identity: Managed identities needed by a session pool to interact with other Azure + services to not maintain any secrets or credentials in code. + :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity :ivar scale_configuration: The scale configuration of the session pool. :vartype scale_configuration: ~azure.mgmt.appcontainers.models.ScaleConfiguration :ivar secrets: The secrets of the session pool. @@ -12041,6 +13409,7 @@ class SessionPoolUpdatableProperties(_serialization.Model): """ _attribute_map = { + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "scale_configuration": {"key": "properties.scaleConfiguration", "type": "ScaleConfiguration"}, "secrets": {"key": "properties.secrets", "type": "[SessionPoolSecret]"}, "dynamic_pool_configuration": { @@ -12057,6 +13426,7 @@ class SessionPoolUpdatableProperties(_serialization.Model): def __init__( self, *, + identity: Optional["_models.ManagedServiceIdentity"] = None, scale_configuration: Optional["_models.ScaleConfiguration"] = None, secrets: Optional[List["_models.SessionPoolSecret"]] = None, dynamic_pool_configuration: Optional["_models.DynamicPoolConfiguration"] = None, @@ -12065,6 +13435,9 @@ def __init__( **kwargs: Any ) -> None: """ + :keyword identity: Managed identities needed by a session pool to interact with other Azure + services to not maintain any secrets or credentials in code. + :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity :keyword scale_configuration: The scale configuration of the session pool. :paramtype scale_configuration: ~azure.mgmt.appcontainers.models.ScaleConfiguration :keyword secrets: The secrets of the session pool. @@ -12082,6 +13455,7 @@ def __init__( ~azure.mgmt.appcontainers.models.SessionNetworkConfiguration """ super().__init__(**kwargs) + self.identity = identity self.scale_configuration = scale_configuration self.secrets = secrets self.dynamic_pool_configuration = dynamic_pool_configuration @@ -12205,7 +13579,7 @@ class SourceControl(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -12273,7 +13647,7 @@ def __init__( ~azure.mgmt.appcontainers.models.GithubActionConfiguration """ super().__init__(**kwargs) - self.operation_state = None + self.operation_state: Optional[Union[str, "_models.SourceControlOperationState"]] = None self.repo_url = repo_url self.branch = branch self.github_action_configuration = github_action_configuration @@ -12309,7 +13683,7 @@ def __init__(self, *, value: List["_models.SourceControl"], **kwargs: Any) -> No """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class SpringBootAdminComponent(JavaComponentProperties): @@ -13119,8 +14493,8 @@ class UserAssignedIdentity(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.principal_id = None - self.client_id = None + self.principal_id: Optional[str] = None + self.client_id: Optional[str] = None class VnetConfiguration(_serialization.Model): @@ -13380,9 +14754,9 @@ def __init__( :paramtype properties: ~azure.mgmt.appcontainers.models.WorkflowEnvelopeProperties """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None self.kind = kind self.location = location self.properties = properties @@ -13418,7 +14792,7 @@ def __init__(self, *, value: List["_models.WorkflowEnvelope"], **kwargs: Any) -> """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class WorkflowEnvelopeProperties(_serialization.Model): @@ -13570,7 +14944,7 @@ class WorkloadProfileStates(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -13640,7 +15014,7 @@ def __init__(self, *, value: List["_models.WorkloadProfileStates"], **kwargs: An """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class WorkloadProfileStatesProperties(_serialization.Model): 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 f105aaf0a686..7ae6a62ff715 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,55 +6,62 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -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 -from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations -from ._container_apps_operations import ContainerAppsOperations -from ._container_apps_builds_by_container_app_operations import ContainerAppsBuildsByContainerAppOperations -from ._container_apps_builds_operations import ContainerAppsBuildsOperations -from ._container_apps_patches_operations import ContainerAppsPatchesOperations -from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations -from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations -from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations -from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations -from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations -from ._jobs_operations import JobsOperations -from ._dot_net_components_operations import DotNetComponentsOperations -from ._functions_extension_operations import FunctionsExtensionOperations -from ._operations import Operations -from ._java_components_operations import JavaComponentsOperations -from ._jobs_executions_operations import JobsExecutionsOperations -from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin -from ._logic_apps_operations import LogicAppsOperations -from ._managed_environments_operations import ManagedEnvironmentsOperations -from ._certificates_operations import CertificatesOperations -from ._managed_certificates_operations import ManagedCertificatesOperations -from ._namespaces_operations import NamespacesOperations -from ._managed_environment_private_endpoint_connections_operations import ( - ManagedEnvironmentPrivateEndpointConnectionsOperations, -) -from ._managed_environment_private_link_resources_operations import ManagedEnvironmentPrivateLinkResourcesOperations -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_session_pools_operations import ContainerAppsSessionPoolsOperations -from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations -from ._usages_operations import UsagesOperations -from ._managed_environment_usages_operations import ManagedEnvironmentUsagesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._app_resiliency_operations import AppResiliencyOperations # type: ignore +from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations # type: ignore +from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations # type: ignore +from ._billing_meters_operations import BillingMetersOperations # type: ignore +from ._builders_operations import BuildersOperations # type: ignore +from ._builds_by_builder_resource_operations import BuildsByBuilderResourceOperations # type: ignore +from ._builds_operations import BuildsOperations # type: ignore +from ._build_auth_token_operations import BuildAuthTokenOperations # type: ignore +from ._connected_environments_operations import ConnectedEnvironmentsOperations # type: ignore +from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations # type: ignore +from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations # type: ignore +from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations # type: ignore +from ._container_apps_operations import ContainerAppsOperations # type: ignore +from ._container_apps_builds_by_container_app_operations import ContainerAppsBuildsByContainerAppOperations # type: ignore +from ._container_apps_builds_operations import ContainerAppsBuildsOperations # type: ignore +from ._container_apps_label_history_operations import ContainerAppsLabelHistoryOperations # type: ignore +from ._container_apps_patches_operations import ContainerAppsPatchesOperations # type: ignore +from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations # type: ignore +from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations # type: ignore +from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations # type: ignore +from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations # type: ignore +from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations # type: ignore +from ._jobs_operations import JobsOperations # type: ignore +from ._dot_net_components_operations import DotNetComponentsOperations # type: ignore +from ._functions_extension_operations import FunctionsExtensionOperations # type: ignore +from ._operations import Operations # type: ignore +from ._java_components_operations import JavaComponentsOperations # type: ignore +from ._jobs_executions_operations import JobsExecutionsOperations # type: ignore +from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin # type: ignore +from ._logic_apps_operations import LogicAppsOperations # type: ignore +from ._managed_environments_operations import ManagedEnvironmentsOperations # type: ignore +from ._certificates_operations import CertificatesOperations # type: ignore +from ._managed_certificates_operations import ManagedCertificatesOperations # type: ignore +from ._namespaces_operations import NamespacesOperations # type: ignore +from ._managed_environment_private_endpoint_connections_operations import ManagedEnvironmentPrivateEndpointConnectionsOperations # type: ignore +from ._managed_environment_private_link_resources_operations import ManagedEnvironmentPrivateLinkResourcesOperations # type: ignore +from ._dapr_component_resiliency_policies_operations import DaprComponentResiliencyPoliciesOperations # type: ignore +from ._dapr_components_operations import DaprComponentsOperations # type: ignore +from ._dapr_subscriptions_operations import DaprSubscriptionsOperations # type: ignore +from ._http_route_config_operations import HttpRouteConfigOperations # type: ignore +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations # type: ignore +from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations # type: ignore +from ._container_apps_session_pools_operations import ContainerAppsSessionPoolsOperations # type: ignore +from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations # type: ignore +from ._usages_operations import UsagesOperations # type: ignore +from ._managed_environment_usages_operations import ManagedEnvironmentUsagesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -72,6 +80,7 @@ "ContainerAppsOperations", "ContainerAppsBuildsByContainerAppOperations", "ContainerAppsBuildsOperations", + "ContainerAppsLabelHistoryOperations", "ContainerAppsPatchesOperations", "ContainerAppsRevisionsOperations", "ContainerAppsRevisionReplicasOperations", @@ -95,11 +104,13 @@ "DaprComponentResiliencyPoliciesOperations", "DaprComponentsOperations", "DaprSubscriptionsOperations", + "HttpRouteConfigOperations", + "MaintenanceConfigurationsOperations", "ManagedEnvironmentsStoragesOperations", "ContainerAppsSessionPoolsOperations", "ContainerAppsSourceControlsOperations", "UsagesOperations", "ManagedEnvironmentUsagesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _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 index 007ffc990766..c70e1e97758b 100644 --- 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +44,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -54,7 +52,7 @@ def build_create_or_update_request( _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( @@ -83,7 +81,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -91,7 +89,7 @@ def build_update_request( _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( @@ -120,14 +118,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -154,14 +152,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -186,14 +184,14 @@ def build_list_request(resource_group_name: str, app_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -227,10 +225,10 @@ class AppResiliencyOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload def create_or_update( @@ -323,7 +321,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.AppResiliency :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -470,7 +468,7 @@ def update( :rtype: ~azure.mgmt.appcontainers.models.AppResiliency :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -545,7 +543,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +600,7 @@ def get(self, resource_group_name: str, app_name: str, name: str, **kwargs: Any) :rtype: ~azure.mgmt.appcontainers.models.AppResiliency :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -667,7 +665,7 @@ def list(self, resource_group_name: str, app_name: str, **kwargs: Any) -> Iterab 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 2e759340e8f8..7c2767f5f030 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,14 +41,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/availableManagedEnvironmentsWorkloadProfileTypes", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -81,10 +79,10 @@ class AvailableWorkloadProfilesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, location: str, **kwargs: Any) -> Iterable["_models.AvailableWorkloadProfile"]: @@ -105,7 +103,7 @@ def get(self, location: str, **kwargs: Any) -> Iterable["_models.AvailableWorklo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AvailableWorkloadProfilesCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 8f64d6ac5a55..9f58d6c14746 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +24,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,13 +38,13 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "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"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -78,10 +75,10 @@ class BillingMetersOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, location: str, **kwargs: Any) -> _models.BillingMeterCollection: @@ -95,7 +92,7 @@ def get(self, location: str, **kwargs: Any) -> _models.BillingMeterCollection: :rtype: ~azure.mgmt.appcontainers.models.BillingMeterCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index ba1910fd2d62..93a7df64baf6 100644 --- 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +6,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,14 +41,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -89,10 +87,10 @@ class BuildAuthTokenOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any) -> _models.BuildToken: @@ -109,7 +107,7 @@ def list(self, resource_group_name: str, builder_name: str, build_name: str, **k :rtype: ~azure.mgmt.appcontainers.models.BuildToken :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index 186330f36bbd..1e9e41fddcf1 100644 --- 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +46,7 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,14 +70,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -102,14 +100,14 @@ def build_get_request(resource_group_name: str, builder_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -137,7 +135,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +143,7 @@ def build_create_or_update_request( _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( @@ -175,7 +173,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -183,7 +181,7 @@ def build_update_request( _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( @@ -213,14 +211,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -256,10 +254,10 @@ class BuildersOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.BuilderResource"]: @@ -275,7 +273,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.BuilderResour 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -353,7 +351,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -428,7 +426,7 @@ def get(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.appcontainers.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +476,7 @@ def _create_or_update_initial( builder_envelope: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -679,7 +677,7 @@ def _update_initial( builder_envelope: Union[_models.BuilderResourceUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -872,7 +870,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index 8aa6f68d3d89..52af43333d8f 100644 --- 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,14 +41,14 @@ def build_list_request(resource_group_name: str, builder_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -86,10 +84,10 @@ class BuildsByBuilderResourceOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> Iterable["_models.BuildResource"]: @@ -110,7 +108,7 @@ def list(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> It 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index bcc1f199cf5e..eec1cb7bfa94 100644 --- 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -29,12 +30,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,14 +46,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -86,7 +84,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -94,7 +92,7 @@ def build_create_or_update_request( _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( @@ -127,14 +125,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -173,10 +171,10 @@ class BuildsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any) -> _models.BuildResource: @@ -193,7 +191,7 @@ def get(self, resource_group_name: str, builder_name: str, build_name: str, **kw :rtype: ~azure.mgmt.appcontainers.models.BuildResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +243,7 @@ def _create_or_update_initial( build_envelope: Union[_models.BuildResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -453,7 +451,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 36e8d265de50..7e7c715e4999 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,14 +44,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -79,14 +77,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -113,7 +111,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -121,7 +119,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -150,14 +148,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -184,7 +182,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -192,7 +190,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -229,10 +227,10 @@ class CertificatesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> Iterable["_models.Certificate"]: @@ -255,7 +253,7 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -337,7 +335,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +470,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -550,7 +548,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -681,7 +679,7 @@ def update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 83e1e99e488e..a04eadaaef47 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,33 +6,35 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse 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 .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,14 +48,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +85,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -121,7 +123,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -129,7 +131,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -162,14 +164,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -200,7 +202,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -208,7 +210,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -245,10 +247,10 @@ class ConnectedEnvironmentsCertificatesOperations: # pylint: disable=name-too-l 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -273,7 +275,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +357,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -399,8 +401,80 @@ def get( return deserialized # type: ignore + def _create_or_update_initial( + self, + resource_group_name: str, + connected_environment_name: str, + certificate_name: str, + certificate_envelope: Optional[Union[_models.Certificate, IO[bytes]]] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(certificate_envelope, (IOBase, bytes)): + _content = certificate_envelope + else: + if certificate_envelope is not None: + _json = self._serialize.body(certificate_envelope, "Certificate") + else: + _json = None + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, @@ -409,7 +483,7 @@ def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Certificate: + ) -> LROPoller[_models.Certificate]: """Create or Update a Certificate. Create or Update a Certificate. @@ -426,13 +500,14 @@ def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of LROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, @@ -441,7 +516,7 @@ def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Certificate: + ) -> LROPoller[_models.Certificate]: """Create or Update a Certificate. Create or Update a Certificate. @@ -458,20 +533,21 @@ def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of LROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, certificate_name: str, certificate_envelope: Optional[Union[_models.Certificate, IO[bytes]]] = None, **kwargs: Any - ) -> _models.Certificate: + ) -> LROPoller[_models.Certificate]: """Create or Update a Certificate. Create or Update a Certificate. @@ -486,11 +562,65 @@ def create_or_update( :param certificate_envelope: Certificate to be created or updated. Is either a Certificate type or a IO[bytes] type. Default value is None. :type certificate_envelope: ~azure.mgmt.appcontainers.models.Certificate or IO[bytes] - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of LROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[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.Certificate] = 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, + connected_environment_name=connected_environment_name, + certificate_name=certificate_name, + certificate_envelope=certificate_envelope, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Certificate", pipeline_response.http_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.Certificate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Certificate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, connected_environment_name: str, certificate_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -498,61 +628,55 @@ def create_or_update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = 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.Certificate] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(certificate_envelope, (IOBase, bytes)): - _content = certificate_envelope - else: - if certificate_envelope is not None: - _json = self._serialize.body(certificate_envelope, "Certificate") - else: - _json = None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_create_or_update_request( + _request = build_delete_request( resource_group_name=resource_group_name, connected_environment_name=connected_environment_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("Certificate", pipeline_response.http_response) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements + def begin_delete( self, resource_group_name: str, connected_environment_name: str, certificate_name: str, **kwargs: Any - ) -> None: + ) -> LROPoller[None]: """Deletes the specified Certificate. Deletes the specified Certificate. @@ -564,11 +688,62 @@ def delete( # pylint: disable=inconsistent-return-statements :type connected_environment_name: str :param certificate_name: Name of the Certificate. Required. :type certificate_name: str - :return: None or the result of cls(response) - :rtype: None + :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: """ - error_map: MutableMapping[int, Type[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( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + certificate_name=certificate_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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 + + def _update_initial( + self, + resource_group_name: str, + connected_environment_name: str, + certificate_name: str, + certificate_envelope: Union[_models.CertificatePatch, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,40 +751,65 @@ def delete( # pylint: disable=inconsistent-return-statements } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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)) - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_delete_request( + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(certificate_envelope, (IOBase, bytes)): + _content = certificate_envelope + else: + _json = self._serialize.body(certificate_envelope, "CertificatePatch") + + _request = build_update_request( resource_group_name=resource_group_name, connected_environment_name=connected_environment_name, certificate_name=certificate_name, subscription_id=self._config.subscription_id, api_version=api_version, + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + 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")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @overload - def update( + def begin_update( self, resource_group_name: str, connected_environment_name: str, @@ -618,7 +818,7 @@ def update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Certificate: + ) -> LROPoller[_models.Certificate]: """Update properties of a certificate. Patches a certificate. Currently only patching of tags is supported. @@ -635,13 +835,14 @@ def update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of LROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( + def begin_update( self, resource_group_name: str, connected_environment_name: str, @@ -650,7 +851,7 @@ def update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Certificate: + ) -> LROPoller[_models.Certificate]: """Update properties of a certificate. Patches a certificate. Currently only patching of tags is supported. @@ -667,20 +868,21 @@ def update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of LROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def update( + def begin_update( self, resource_group_name: str, connected_environment_name: str, certificate_name: str, certificate_envelope: Union[_models.CertificatePatch, IO[bytes]], **kwargs: Any - ) -> _models.Certificate: + ) -> LROPoller[_models.Certificate]: """Update properties of a certificate. Patches a certificate. Currently only patching of tags is supported. @@ -695,62 +897,57 @@ def update( :param certificate_envelope: Properties of a certificate that need to be updated. Is either a CertificatePatch type or a IO[bytes] type. Required. :type certificate_envelope: ~azure.mgmt.appcontainers.models.CertificatePatch or IO[bytes] - :return: Certificate or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.Certificate + :return: An instance of LROPoller that returns either Certificate or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.Certificate] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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.Certificate] = 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, + connected_environment_name=connected_environment_name, + certificate_name=certificate_name, + certificate_envelope=certificate_envelope, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(certificate_envelope, (IOBase, bytes)): - _content = certificate_envelope - else: - _json = self._serialize.body(certificate_envelope, "CertificatePatch") - - _request = build_update_request( - resource_group_name=resource_group_name, - connected_environment_name=connected_environment_name, - certificate_name=certificate_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Certificate", pipeline_response.http_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, 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.Certificate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Certificate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - 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("Certificate", pipeline_response.http_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/_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py index 0b8bfb9753a0..1dd26d1e2202 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,33 +6,35 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse 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 .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,14 +48,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -79,14 +81,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -113,7 +115,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -121,7 +123,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -150,14 +152,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -184,14 +186,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -226,15 +228,15 @@ class ConnectedEnvironmentsDaprComponentsOperations: # pylint: disable=name-too 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( self, resource_group_name: str, connected_environment_name: str, **kwargs: Any - ) -> Iterable["_models.DaprComponent"]: + ) -> Iterable["_models.ConnectedEnvironmentDaprComponent"]: """Get the Dapr Components for a connected environment. Get the Dapr Components for a connected environment. @@ -244,17 +246,19 @@ def list( :type resource_group_name: str :param connected_environment_name: Name of the connected environment. Required. :type connected_environment_name: str - :return: An iterator like instance of either DaprComponent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.DaprComponent] + :return: An iterator like instance of either ConnectedEnvironmentDaprComponent or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent] :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.DaprComponentsCollection] = kwargs.pop("cls", None) + cls: ClsType[_models.ConnectedEnvironmentDaprComponentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -293,7 +297,7 @@ def prepare_request(next_link=None): return _request def extract_data(pipeline_response): - deserialized = self._deserialize("DaprComponentsCollection", pipeline_response) + deserialized = self._deserialize("ConnectedEnvironmentDaprComponentsCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -320,7 +324,7 @@ def get_next(next_link=None): @distributed_trace def get( self, resource_group_name: str, connected_environment_name: str, component_name: str, **kwargs: Any - ) -> _models.DaprComponent: + ) -> _models.ConnectedEnvironmentDaprComponent: """Get a dapr component. Get a dapr component. @@ -332,11 +336,11 @@ def get( :type connected_environment_name: str :param component_name: Name of the Dapr Component. Required. :type component_name: str - :return: DaprComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponent + :return: ConnectedEnvironmentDaprComponent or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -348,7 +352,7 @@ def get( _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.DaprComponent] = kwargs.pop("cls", None) + cls: ClsType[_models.ConnectedEnvironmentDaprComponent] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, @@ -373,7 +377,76 @@ def get( error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DaprComponent", pipeline_response.http_response) + deserialized = self._deserialize("ConnectedEnvironmentDaprComponent", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + connected_environment_name: str, + component_name: str, + dapr_component_envelope: Union[_models.ConnectedEnvironmentDaprComponent, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(dapr_component_envelope, (IOBase, bytes)): + _content = dapr_component_envelope + else: + _json = self._serialize.body(dapr_component_envelope, "ConnectedEnvironmentDaprComponent") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + component_name=component_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -381,16 +454,16 @@ def get( return deserialized # type: ignore @overload - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, component_name: str, - dapr_component_envelope: _models.DaprComponent, + dapr_component_envelope: _models.ConnectedEnvironmentDaprComponent, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DaprComponent: + ) -> LROPoller[_models.ConnectedEnvironmentDaprComponent]: """Creates or updates a Dapr Component. Creates or updates a Dapr Component in a connected environment. @@ -403,17 +476,20 @@ def create_or_update( :param component_name: Name of the Dapr Component. Required. :type component_name: str :param dapr_component_envelope: Configuration details of the Dapr Component. Required. - :type dapr_component_envelope: ~azure.mgmt.appcontainers.models.DaprComponent + :type dapr_component_envelope: + ~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: DaprComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponent + :return: An instance of LROPoller that returns either ConnectedEnvironmentDaprComponent or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, @@ -422,7 +498,7 @@ def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.DaprComponent: + ) -> LROPoller[_models.ConnectedEnvironmentDaprComponent]: """Creates or updates a Dapr Component. Creates or updates a Dapr Component in a connected environment. @@ -439,20 +515,22 @@ def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: DaprComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponent + :return: An instance of LROPoller that returns either ConnectedEnvironmentDaprComponent or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, component_name: str, - dapr_component_envelope: Union[_models.DaprComponent, IO[bytes]], + dapr_component_envelope: Union[_models.ConnectedEnvironmentDaprComponent, IO[bytes]], **kwargs: Any - ) -> _models.DaprComponent: + ) -> LROPoller[_models.ConnectedEnvironmentDaprComponent]: """Creates or updates a Dapr Component. Creates or updates a Dapr Component in a connected environment. @@ -465,13 +543,69 @@ def create_or_update( :param component_name: Name of the Dapr Component. Required. :type component_name: str :param dapr_component_envelope: Configuration details of the Dapr Component. Is either a - DaprComponent type or a IO[bytes] type. Required. - :type dapr_component_envelope: ~azure.mgmt.appcontainers.models.DaprComponent or IO[bytes] - :return: DaprComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponent + ConnectedEnvironmentDaprComponent type or a IO[bytes] type. Required. + :type dapr_component_envelope: + ~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent or IO[bytes] + :return: An instance of LROPoller that returns either ConnectedEnvironmentDaprComponent or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentDaprComponent] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[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.ConnectedEnvironmentDaprComponent] = 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, + connected_environment_name=connected_environment_name, + component_name=component_name, + dapr_component_envelope=dapr_component_envelope, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectedEnvironmentDaprComponent", pipeline_response.http_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.ConnectedEnvironmentDaprComponent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConnectedEnvironmentDaprComponent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, connected_environment_name: str, component_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -479,58 +613,55 @@ def create_or_update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = 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.DaprComponent] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dapr_component_envelope, (IOBase, bytes)): - _content = dapr_component_envelope - else: - _json = self._serialize.body(dapr_component_envelope, "DaprComponent") - - _request = build_create_or_update_request( + _request = build_delete_request( resource_group_name=resource_group_name, connected_environment_name=connected_environment_name, component_name=component_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DaprComponent", pipeline_response.http_response) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements + def begin_delete( self, resource_group_name: str, connected_environment_name: str, component_name: str, **kwargs: Any - ) -> None: + ) -> LROPoller[None]: """Delete a Dapr Component. Delete a Dapr Component from a connected environment. @@ -542,49 +673,52 @@ def delete( # pylint: disable=inconsistent-return-statements :type connected_environment_name: str :param component_name: Name of the Dapr Component. Required. :type component_name: str - :return: None or the result of cls(response) - :rtype: None + :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: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + component_name=component_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - _request = build_delete_request( - resource_group_name=resource_group_name, - connected_environment_name=connected_environment_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - if cls: - return cls(pipeline_response, 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 @distributed_trace def list_secrets( @@ -605,7 +739,7 @@ def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.DaprSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 ef3ba4e0eb42..c0d889095d91 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +46,7 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,14 +70,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -104,14 +102,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -137,7 +135,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +143,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -173,14 +171,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -206,14 +204,15 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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/connectedEnvironments/{connectedEnvironmentName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -228,6 +227,8 @@ def build_update_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) @@ -239,7 +240,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -247,7 +248,7 @@ def build_check_name_availability_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -283,10 +284,10 @@ class ConnectedEnvironmentsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ConnectedEnvironment"]: @@ -305,7 +306,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ConnectedEnvi api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConnectedEnvironmentCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +387,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConnectedEnvironmentCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -463,7 +464,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +514,7 @@ def _create_or_update_initial( environment_envelope: Union[_models.ConnectedEnvironment, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -704,7 +705,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, connected_environment_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -813,9 +814,73 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + @overload + def update( + self, + resource_group_name: str, + connected_environment_name: str, + environment_envelope: Optional[_models.ConnectedEnvironmentPatchResource] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectedEnvironment: + """Update connected Environment's properties. + + Patches a Managed Environment. Only patching of tags is supported currently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connected_environment_name: Name of the connectedEnvironment. Required. + :type connected_environment_name: str + :param environment_envelope: Configuration details of the connectedEnvironment. Default value + is None. + :type environment_envelope: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentPatchResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConnectedEnvironment or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + connected_environment_name: str, + environment_envelope: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConnectedEnvironment: + """Update connected Environment's properties. + + Patches a Managed Environment. Only patching of tags is supported currently. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param connected_environment_name: Name of the connectedEnvironment. Required. + :type connected_environment_name: str + :param environment_envelope: Configuration details of the connectedEnvironment. Default value + is None. + :type environment_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: ConnectedEnvironment or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace def update( - self, resource_group_name: str, connected_environment_name: str, **kwargs: Any + self, + resource_group_name: str, + connected_environment_name: str, + environment_envelope: Optional[Union[_models.ConnectedEnvironmentPatchResource, IO[bytes]]] = None, + **kwargs: Any ) -> _models.ConnectedEnvironment: """Update connected Environment's properties. @@ -826,11 +891,15 @@ def update( :type resource_group_name: str :param connected_environment_name: Name of the connectedEnvironment. Required. :type connected_environment_name: str + :param environment_envelope: Configuration details of the connectedEnvironment. Is either a + ConnectedEnvironmentPatchResource type or a IO[bytes] type. Default value is None. + :type environment_envelope: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentPatchResource + or IO[bytes] :return: ConnectedEnvironment or the result of cls(response) :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -838,17 +907,32 @@ def update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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.ConnectedEnvironment] = kwargs.pop("cls", None) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(environment_envelope, (IOBase, bytes)): + _content = environment_envelope + else: + if environment_envelope is not None: + _json = self._serialize.body(environment_envelope, "ConnectedEnvironmentPatchResource") + else: + _json = None + _request = build_update_request( resource_group_name=resource_group_name, connected_environment_name=connected_environment_name, subscription_id=self._config.subscription_id, api_version=api_version, + content_type=content_type, + json=_json, + content=_content, headers=_headers, params=_params, ) @@ -959,7 +1043,7 @@ def check_name_availability( :rtype: ~azure.mgmt.appcontainers.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 ca4ee82e2623..deafb464bfb0 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,31 +6,33 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse 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 .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,14 +46,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -77,14 +79,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -111,7 +113,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -119,7 +121,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -148,14 +150,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -190,10 +192,10 @@ class ConnectedEnvironmentsStoragesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -212,7 +214,7 @@ def list( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStoragesCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +276,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -318,8 +320,77 @@ def get( return deserialized # type: ignore + def _create_or_update_initial( + self, + resource_group_name: str, + connected_environment_name: str, + storage_name: str, + storage_envelope: Union[_models.ConnectedEnvironmentStorage, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(storage_envelope, (IOBase, bytes)): + _content = storage_envelope + else: + _json = self._serialize.body(storage_envelope, "ConnectedEnvironmentStorage") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + storage_name=storage_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, @@ -328,7 +399,7 @@ def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ConnectedEnvironmentStorage: + ) -> LROPoller[_models.ConnectedEnvironmentStorage]: """Create or update storage for a connectedEnvironment. Create or update storage for a connectedEnvironment. @@ -345,13 +416,15 @@ def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: ConnectedEnvironmentStorage or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage + :return: An instance of LROPoller that returns either ConnectedEnvironmentStorage or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, @@ -360,7 +433,7 @@ def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.ConnectedEnvironmentStorage: + ) -> LROPoller[_models.ConnectedEnvironmentStorage]: """Create or update storage for a connectedEnvironment. Create or update storage for a connectedEnvironment. @@ -377,20 +450,22 @@ def create_or_update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: ConnectedEnvironmentStorage or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage + :return: An instance of LROPoller that returns either ConnectedEnvironmentStorage or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, connected_environment_name: str, storage_name: str, storage_envelope: Union[_models.ConnectedEnvironmentStorage, IO[bytes]], **kwargs: Any - ) -> _models.ConnectedEnvironmentStorage: + ) -> LROPoller[_models.ConnectedEnvironmentStorage]: """Create or update storage for a connectedEnvironment. Create or update storage for a connectedEnvironment. @@ -406,11 +481,66 @@ def create_or_update( ConnectedEnvironmentStorage type or a IO[bytes] type. Required. :type storage_envelope: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage or IO[bytes] - :return: ConnectedEnvironmentStorage or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage + :return: An instance of LROPoller that returns either ConnectedEnvironmentStorage or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[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.ConnectedEnvironmentStorage] = 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, + connected_environment_name=connected_environment_name, + storage_name=storage_name, + storage_envelope=storage_envelope, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConnectedEnvironmentStorage", pipeline_response.http_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.ConnectedEnvironmentStorage].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ConnectedEnvironmentStorage]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, connected_environment_name: str, storage_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,58 +548,55 @@ def create_or_update( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = 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.ConnectedEnvironmentStorage] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(storage_envelope, (IOBase, bytes)): - _content = storage_envelope - else: - _json = self._serialize.body(storage_envelope, "ConnectedEnvironmentStorage") - - _request = build_create_or_update_request( + _request = build_delete_request( resource_group_name=resource_group_name, connected_environment_name=connected_environment_name, storage_name=storage_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("ConnectedEnvironmentStorage", pipeline_response.http_response) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements + def begin_delete( self, resource_group_name: str, connected_environment_name: str, storage_name: str, **kwargs: Any - ) -> None: + ) -> LROPoller[None]: """Delete storage for a connectedEnvironment. Delete storage for a connectedEnvironment. @@ -481,46 +608,49 @@ def delete( # pylint: disable=inconsistent-return-statements :type connected_environment_name: str :param storage_name: Name of the storage. Required. :type storage_name: str - :return: None or the result of cls(response) - :rtype: None + :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: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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, - connected_environment_name=connected_environment_name, - storage_name=storage_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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 + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + connected_environment_name=connected_environment_name, + storage_name=storage_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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/_container_apps_api_client_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py index 42a17070e70f..865a2cbd890e 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,10 +27,6 @@ from .._serialization import Serializer from .._vendor import ContainerAppsAPIClientMixinABC -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,14 +40,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -80,13 +76,13 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/getCustomDomainVerificationId" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -123,7 +119,7 @@ def job_execution( :rtype: ~azure.mgmt.appcontainers.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +171,7 @@ def get_custom_domain_verification_id(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 aad3e7f178e2..6c30227daa63 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,14 +44,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -79,14 +77,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -113,7 +111,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -121,7 +119,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -150,14 +148,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -192,10 +190,10 @@ class ContainerAppsAuthConfigsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_container_app( @@ -220,7 +218,7 @@ def list_by_container_app( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AuthConfigCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +300,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.AuthConfig :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -437,7 +435,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.AuthConfig :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +510,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_by_container_app_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_by_container_app_operations.py index c0c6bec4f1e7..438db5c55bc1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_by_container_app_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_by_container_app_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +43,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -88,10 +86,10 @@ class ContainerAppsBuildsByContainerAppOperations: # pylint: disable=name-too-l 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -116,7 +114,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppsBuildCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_operations.py index baa987a7159c..def31cd5626f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +6,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterator, Optional, Type, TypeVar, Union, cast +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterator, Optional, TypeVar, Union, cast +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -28,12 +29,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,14 +45,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -85,14 +83,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -131,10 +129,10 @@ class ContainerAppsBuildsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get( @@ -153,7 +151,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.ContainerAppsBuildResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -200,7 +198,7 @@ def get( def _delete_initial( self, resource_group_name: str, container_app_name: str, build_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 3f459b466f63..2e34f6a194e5 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, cast +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +43,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -78,14 +76,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -117,14 +115,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -152,14 +150,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -186,14 +184,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -227,10 +225,10 @@ class ContainerAppsDiagnosticsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_detectors( @@ -256,7 +254,7 @@ def list_detectors( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +336,7 @@ def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -407,7 +405,7 @@ def list_revisions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RevisionCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +488,7 @@ def get_revision( :rtype: ~azure.mgmt.appcontainers.models.Revision :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,14 +547,11 @@ def get_root(self, resource_group_name: str, container_app_name: str, **kwargs: :rtype: ~azure.mgmt.appcontainers.models.ContainerApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -584,7 +579,7 @@ def get_root(self, resource_group_name: str, container_app_name: str, **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) # type: ignore + 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) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_label_history_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_label_history_operations.py new file mode 100644 index 000000000000..89996c3da28f --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_label_history_operations.py @@ -0,0 +1,382 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core import PipelineClient +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.rest import HttpRequest, HttpResponse +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 .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_label_history_request( + resource_group_name: str, + container_app_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory", + ) + 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 + ), + "containerAppName": _SERIALIZER.url( + "container_app_name", container_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") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_label_history_request( + resource_group_name: str, container_app_name: str, label_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", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName}", + ) + 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 + ), + "containerAppName": _SERIALIZER.url( + "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), + "labelName": _SERIALIZER.url("label_name", label_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_delete_label_history_request( + resource_group_name: str, container_app_name: str, label_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", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName}", + ) + 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 + ), + "containerAppName": _SERIALIZER.url( + "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), + "labelName": _SERIALIZER.url("label_name", label_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 ContainerAppsLabelHistoryOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s + :attr:`container_apps_label_history` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_label_history( + self, resource_group_name: str, container_app_name: str, filter: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.LabelHistory"]: + """Get the Label History for a given Container App. + + Get the Label History for a given Container App. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param container_app_name: Name of the Container App. Required. + :type container_app_name: str + :param filter: The filter to apply on the operation. Default value is None. + :type filter: str + :return: An iterator like instance of either LabelHistory or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.LabelHistory] + :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.LabelHistoryCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_label_history_request( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LabelHistoryCollection", 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_label_history( + self, resource_group_name: str, container_app_name: str, label_name: str, **kwargs: Any + ) -> _models.LabelHistory: + """Get the history of a label. + + Get the history of a label. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param container_app_name: Name of the Container App. Required. + :type container_app_name: str + :param label_name: Name of the Container App label. Required. + :type label_name: str + :return: LabelHistory or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.LabelHistory + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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.LabelHistory] = kwargs.pop("cls", None) + + _request = build_get_label_history_request( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + label_name=label_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("LabelHistory", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete_label_history( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, container_app_name: str, label_name: str, **kwargs: Any + ) -> None: + """Delete the history of a label. + + Delete the history of a label. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param container_app_name: Name of the Container App. Required. + :type container_app_name: str + :param label_name: Name of the Container App label. Required. + :type label_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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_label_history_request( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + label_name=label_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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/_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py index 67267d32f72c..086e04d332fa 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +46,7 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,14 +70,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -104,14 +102,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -137,7 +135,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +143,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -173,14 +171,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -206,7 +204,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -214,7 +212,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -247,14 +245,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -282,14 +280,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -315,14 +313,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -348,14 +346,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -383,14 +381,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -426,10 +424,10 @@ class ContainerAppsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ContainerApp"]: @@ -447,7 +445,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ContainerApp" api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +525,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,14 +602,11 @@ def get(self, resource_group_name: str, container_app_name: str, **kwargs: Any) :rtype: ~azure.mgmt.appcontainers.models.ContainerApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -639,7 +634,7 @@ def get(self, resource_group_name: str, container_app_name: str, **kwargs: Any) 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) # type: ignore + 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) @@ -657,7 +652,7 @@ def _create_or_update_initial( container_app_envelope: Union[_models.ContainerApp, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -852,7 +847,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, container_app_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -968,7 +963,7 @@ def _update_initial( container_app_envelope: Union[_models.ContainerApp, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1183,7 +1178,7 @@ def list_custom_host_name_analysis( :rtype: ~azure.mgmt.appcontainers.models.CustomHostnameAnalysisResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1244,7 +1239,7 @@ def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.SecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1304,14 +1299,11 @@ def get_auth_token( :rtype: ~azure.mgmt.appcontainers.models.ContainerAppAuthToken :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -1339,7 +1331,7 @@ def get_auth_token( 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) # type: ignore + 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) @@ -1351,7 +1343,7 @@ def get_auth_token( return deserialized # type: ignore def _start_initial(self, resource_group_name: str, container_app_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1468,7 +1460,7 @@ def get_long_running_output(pipeline_response): ) def _stop_initial(self, resource_group_name: str, container_app_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_patches_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_patches_operations.py index 5ecf4eda2b9b..f3786f8f9480 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_patches_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_patches_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -55,14 +53,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -92,14 +90,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -130,14 +128,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -168,7 +166,7 @@ def build_skip_configure_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -176,7 +174,7 @@ def build_skip_configure_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/skipConfig", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -209,14 +207,14 @@ def build_apply_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/apply", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -255,10 +253,10 @@ class ContainerAppsPatchesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_container_app( @@ -286,7 +284,7 @@ def list_by_container_app( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PatchCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -367,7 +365,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.ContainerAppsPatchResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -414,7 +412,7 @@ def get( def _delete_initial( self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -535,7 +533,7 @@ def _skip_configure_initial( patch_skip_config: Union[_models.PatchSkipConfig, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -733,7 +731,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _apply_initial( self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 5dc5a5a20868..beec6b4f4856 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +6,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,14 +46,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -125,10 +123,10 @@ class ContainerAppsRevisionReplicasOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get_replica( @@ -151,7 +149,7 @@ def get_replica( :rtype: ~azure.mgmt.appcontainers.models.Replica :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +213,7 @@ def list_replicas( :rtype: ~azure.mgmt.appcontainers.models.ReplicaCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 36516fbefb0d..3f22302825b2 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -85,14 +83,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -119,14 +117,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -153,14 +151,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -187,14 +185,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -229,10 +227,10 @@ class ContainerAppsRevisionsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_revisions( @@ -259,7 +257,7 @@ def list_revisions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RevisionCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -342,7 +340,7 @@ def get_revision( :rtype: ~azure.mgmt.appcontainers.models.Revision :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -405,7 +403,7 @@ def activate_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +462,7 @@ def deactivate_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +521,7 @@ def restart_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_session_pools_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_session_pools_operations.py index 005c216efb9e..2b236a6c75ff 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_session_pools_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_session_pools_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +46,7 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,14 +70,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -104,14 +102,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -139,7 +137,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -147,7 +145,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -177,7 +175,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -185,7 +183,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -215,14 +213,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -258,10 +256,10 @@ class ContainerAppsSessionPoolsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SessionPool"]: @@ -279,7 +277,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SessionPool"] api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SessionPoolCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +357,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SessionPoolCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +434,7 @@ def get(self, resource_group_name: str, session_pool_name: str, **kwargs: Any) - :rtype: ~azure.mgmt.appcontainers.models.SessionPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -486,7 +484,7 @@ def _create_or_update_initial( session_pool_envelope: Union[_models.SessionPool, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -687,7 +685,7 @@ def _update_initial( session_pool_envelope: Union[_models.SessionPoolUpdatableProperties, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -887,7 +885,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, session_pool_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 e546fc010ddf..2f5ff76e671f 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -123,7 +121,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,7 +129,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -170,14 +168,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -220,10 +218,10 @@ class ContainerAppsSourceControlsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_container_app( @@ -248,7 +246,7 @@ def list_by_container_app( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SourceControlCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +328,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.SourceControl :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +381,7 @@ def _create_or_update_initial( x_ms_github_auxiliary: Optional[str] = None, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -612,7 +610,7 @@ def _delete_initial( delete_workflow: Optional[bool] = None, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index 045f7dd750c2..ac796e268b60 100644 --- 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,14 +44,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -80,14 +78,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -115,7 +113,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -123,7 +121,7 @@ def build_create_or_update_request( _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( @@ -153,14 +151,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -196,10 +194,10 @@ class DaprComponentResiliencyPoliciesOperations: # pylint: disable=name-too-lon 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -228,7 +226,7 @@ def list( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -313,7 +311,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -463,7 +461,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -541,7 +539,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 8d9e32077cec..34db75491e77 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,14 +44,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -79,14 +77,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -113,7 +111,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -121,7 +119,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -150,14 +148,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -184,14 +182,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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}/listSecrets", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -226,10 +224,10 @@ class DaprComponentsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> Iterable["_models.DaprComponent"]: @@ -252,7 +250,7 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DaprComponentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +332,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -469,7 +467,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +542,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +601,7 @@ def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.DaprSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index e629225b8b27..3535ef1df5a1 100644 --- 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,14 +44,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -79,14 +77,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -113,7 +111,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -121,7 +119,7 @@ def build_create_or_update_request( _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( @@ -150,14 +148,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -192,10 +190,10 @@ class DaprSubscriptionsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -220,7 +218,7 @@ def list( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +300,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +436,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +511,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index bf63632ced24..0cf975f171f8 100644 --- 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -83,14 +81,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -117,7 +115,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,7 +123,7 @@ def build_create_or_update_request( _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( @@ -154,7 +152,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -162,7 +160,7 @@ def build_update_request( _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( @@ -191,14 +189,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -233,10 +231,10 @@ class DotNetComponentsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -261,7 +259,7 @@ def list( 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -341,7 +339,7 @@ def get(self, resource_group_name: str, environment_name: str, name: str, **kwar :rtype: ~azure.mgmt.appcontainers.models.DotNetComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -393,7 +391,7 @@ def _create_or_update_initial( dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -606,7 +604,7 @@ def _update_initial( dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -816,7 +814,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_functions_extension_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_functions_extension_operations.py index 6f8a36799039..845455d0d24d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_functions_extension_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_functions_extension_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +6,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,14 +46,14 @@ def build_invoke_functions_host_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/providers/Microsoft.App/functions/{functionAppName}/invoke", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -93,10 +91,10 @@ class FunctionsExtensionOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def invoke_functions_host( @@ -124,7 +122,7 @@ def invoke_functions_host( :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_http_route_config_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_http_route_config_operations.py new file mode 100644 index 000000000000..d67c801dad85 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_http_route_config_operations.py @@ -0,0 +1,748 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import urllib.parse + +from azure.core import PipelineClient +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.rest import HttpRequest, HttpResponse +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 .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer + +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, environment_name: str, http_route_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", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}", + ) + 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\._\(\)]+$"), + "httpRouteName": _SERIALIZER.url( + "http_route_name", http_route_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _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, http_route_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", "2025-02-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}/httpRouteConfigs/{httpRouteName}", + ) + 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\._\(\)]+$"), + "httpRouteName": _SERIALIZER.url( + "http_route_name", http_route_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _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, http_route_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", "2025-02-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}/httpRouteConfigs/{httpRouteName}", + ) + 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"), + "httpRouteName": _SERIALIZER.url("http_route_name", http_route_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group_name: str, environment_name: str, http_route_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", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}", + ) + 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\._\(\)]+$"), + "httpRouteName": _SERIALIZER.url( + "http_route_name", http_route_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" + ), + } + + _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_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", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs", + ) + 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) + + +class HttpRouteConfigOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s + :attr:`http_route_config` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, environment_name: str, http_route_name: str, **kwargs: Any + ) -> _models.HttpRouteConfig: + """Get the specified Managed Http Route Config. + + Get the specified Managed Http Route Config. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :return: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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.HttpRouteConfig] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + environment_name=environment_name, + http_route_name=http_route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("HttpRouteConfig", pipeline_response.http_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, + http_route_name: str, + http_route_config_envelope: Optional[_models.HttpRouteConfig] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Create or Update a Http Route Config. + + Create or Update a Http Route Config. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Http Route config to be created or updated. Default value is + None. + :type http_route_config_envelope: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + environment_name: str, + http_route_name: str, + http_route_config_envelope: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Create or Update a Http Route Config. + + Create or Update a Http Route Config. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Http Route config to be created or updated. Default value is + None. + :type http_route_config_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: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + environment_name: str, + http_route_name: str, + http_route_config_envelope: Optional[Union[_models.HttpRouteConfig, IO[bytes]]] = None, + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Create or Update a Http Route Config. + + Create or Update a Http Route Config. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Http Route config to be created or updated. Is either a + HttpRouteConfig type or a IO[bytes] type. Default value is None. + :type http_route_config_envelope: ~azure.mgmt.appcontainers.models.HttpRouteConfig or IO[bytes] + :return: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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.HttpRouteConfig] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(http_route_config_envelope, (IOBase, bytes)): + _content = http_route_config_envelope + else: + if http_route_config_envelope is not None: + _json = self._serialize.body(http_route_config_envelope, "HttpRouteConfig") + else: + _json = None + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + environment_name=environment_name, + http_route_name=http_route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _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) + + deserialized = self._deserialize("HttpRouteConfig", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + environment_name: str, + http_route_name: str, + http_route_config_envelope: _models.HttpRouteConfig, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Update tags of a manged http route object. + + Patches an http route config resource. Only patching of tags is supported. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Properties of http route config that need to be updated. + Required. + :type http_route_config_envelope: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + environment_name: str, + http_route_name: str, + http_route_config_envelope: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Update tags of a manged http route object. + + Patches an http route config resource. Only patching of tags is supported. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Properties of http route config that need to be updated. + Required. + :type http_route_config_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: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + environment_name: str, + http_route_name: str, + http_route_config_envelope: Union[_models.HttpRouteConfig, IO[bytes]], + **kwargs: Any + ) -> _models.HttpRouteConfig: + """Update tags of a manged http route object. + + Patches an http route config resource. Only patching of tags is supported. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :param http_route_config_envelope: Properties of http route config that need to be updated. Is + either a HttpRouteConfig type or a IO[bytes] type. Required. + :type http_route_config_envelope: ~azure.mgmt.appcontainers.models.HttpRouteConfig or IO[bytes] + :return: HttpRouteConfig or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.HttpRouteConfig + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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.HttpRouteConfig] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(http_route_config_envelope, (IOBase, bytes)): + _content = http_route_config_envelope + else: + _json = self._serialize.body(http_route_config_envelope, "HttpRouteConfig") + + _request = build_update_request( + resource_group_name=resource_group_name, + environment_name=environment_name, + http_route_name=http_route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _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("HttpRouteConfig", pipeline_response.http_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, http_route_name: str, **kwargs: Any + ) -> None: + """Deletes the specified Managed Http Route. + + Deletes the specified Managed Http Route. + + :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 http_route_name: Name of the Http Route Config Resource. Required. + :type http_route_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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, + http_route_name=http_route_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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 list( + self, resource_group_name: str, environment_name: str, **kwargs: Any + ) -> Iterable["_models.HttpRouteConfig"]: + """Get the Managed Http Routes in a given managed environment. + + Get the Managed Http Routes in a given 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 HttpRouteConfig or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.HttpRouteConfig] + :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.HttpRouteConfigCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_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.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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("HttpRouteConfigCollection", 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/_java_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_java_components_operations.py index d3f5eb6f249c..412084c37558 100644 --- 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -83,14 +81,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -117,7 +115,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,7 +123,7 @@ def build_create_or_update_request( _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( @@ -154,7 +152,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -162,7 +160,7 @@ def build_update_request( _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( @@ -191,14 +189,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-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( @@ -233,10 +231,10 @@ class JavaComponentsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> Iterable["_models.JavaComponent"]: @@ -259,7 +257,7 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +337,7 @@ def get(self, resource_group_name: str, environment_name: str, name: str, **kwar :rtype: ~azure.mgmt.appcontainers.models.JavaComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +389,7 @@ def _create_or_update_initial( java_component_envelope: Union[_models.JavaComponent, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +602,7 @@ def _update_initial( java_component_envelope: Union[_models.JavaComponent, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -814,7 +812,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 cc7739b4cffd..8757370c3ed3 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +43,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -88,10 +86,10 @@ class JobsExecutionsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -118,7 +116,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppJobExecutions] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 3d818980ddcc..0202e624ac04 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -117,14 +115,14 @@ def build_proxy_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -149,7 +147,7 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,14 +171,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -203,14 +201,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -236,7 +234,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -244,7 +242,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -270,14 +268,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -301,7 +299,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -309,7 +307,7 @@ def build_update_request(resource_group_name: str, job_name: str, subscription_i _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -335,7 +333,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -343,7 +341,7 @@ def build_start_request(resource_group_name: str, job_name: str, subscription_id _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -371,14 +369,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -407,14 +405,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -440,14 +438,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -471,14 +469,14 @@ def build_resume_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/resume", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -502,14 +500,14 @@ def build_suspend_request(resource_group_name: str, job_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/suspend", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -543,10 +541,10 @@ class JobsOperations: # pylint: disable=too-many-public-methods 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_detectors(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterable["_models.Diagnostics"]: @@ -569,7 +567,7 @@ def list_detectors(self, resource_group_name: str, job_name: str, **kwargs: Any) 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: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -651,7 +649,7 @@ def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -712,7 +710,7 @@ def proxy_get(self, resource_group_name: str, job_name: str, api_name: str, **kw :rtype: ~azure.mgmt.appcontainers.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -772,7 +770,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Job"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -852,7 +850,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -929,7 +927,7 @@ def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models :rtype: ~azure.mgmt.appcontainers.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -975,7 +973,7 @@ def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models def _create_or_update_initial( self, resource_group_name: str, job_name: str, job_envelope: Union[_models.Job, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1161,7 +1159,7 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.Job](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1275,7 @@ def _update_initial( job_envelope: Union[_models.JobPatchProperties, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1475,7 +1473,7 @@ def _start_initial( template: Optional[Union[_models.JobExecutionTemplate, IO[bytes]]] = None, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1679,7 +1677,7 @@ def get_long_running_output(pipeline_response): def _stop_execution_initial( self, resource_group_name: str, job_name: str, job_execution_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1797,7 +1795,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_multiple_executions_initial( self, resource_group_name: str, job_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1929,7 +1927,7 @@ def list_secrets(self, resource_group_name: str, job_name: str, **kwargs: Any) - :rtype: ~azure.mgmt.appcontainers.models.JobSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1973,7 +1971,7 @@ def list_secrets(self, resource_group_name: str, job_name: str, **kwargs: Any) - return deserialized # type: ignore def _resume_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2088,7 +2086,7 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.Job](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _suspend_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_logic_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_logic_apps_operations.py index d605e1b98115..f7c635fc96cf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_logic_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_logic_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,13 +28,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,14 +45,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -83,7 +81,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -91,7 +89,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -122,14 +120,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -158,14 +156,14 @@ def build_list_workflows_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -199,14 +197,14 @@ def build_get_workflow_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -238,7 +236,7 @@ def build_deploy_workflow_artifacts_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -246,7 +244,7 @@ def build_deploy_workflow_artifacts_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/deployWorkflowArtifacts", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -277,14 +275,14 @@ def build_list_workflows_connections_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/listWorkflowsConnections", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -320,14 +318,14 @@ def build_invoke_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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/invoke", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -370,10 +368,10 @@ class LogicAppsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get( @@ -394,7 +392,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.LogicApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +521,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.LogicApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +594,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -661,7 +659,7 @@ def list_workflows( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkflowEnvelopeCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -746,7 +744,7 @@ def get_workflow( :rtype: ~azure.mgmt.appcontainers.models.WorkflowEnvelope :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -792,7 +790,7 @@ def get_workflow( return deserialized # type: ignore @overload - def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements + def deploy_workflow_artifacts( self, resource_group_name: str, container_app_name: str, @@ -823,7 +821,7 @@ def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements """ @overload - def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements + def deploy_workflow_artifacts( self, resource_group_name: str, container_app_name: str, @@ -878,7 +876,7 @@ def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -952,7 +950,7 @@ def list_workflows_connections( :rtype: ~azure.mgmt.appcontainers.models.WorkflowEnvelope :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1027,7 +1025,7 @@ def invoke( :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_maintenance_configurations_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..1f0521ea05c4 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_maintenance_configurations_operations.py @@ -0,0 +1,546 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import urllib.parse + +from azure.core import PipelineClient +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.rest import HttpRequest, HttpResponse +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 .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer + +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", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations", + ) + 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_create_or_update_request( + resource_group_name: str, environment_name: str, config_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", "2025-02-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}/maintenanceConfigurations/{configName}", + ) + 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\._\(\)]+$"), + "configName": _SERIALIZER.url("config_name", config_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_delete_request( + resource_group_name: str, environment_name: str, config_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", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}", + ) + 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\._\(\)]+$"), + "configName": _SERIALIZER.url("config_name", config_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, environment_name: str, config_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", "2025-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}", + ) + 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\._\(\)]+$"), + "configName": _SERIALIZER.url("config_name", config_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 MaintenanceConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s + :attr:`maintenance_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, environment_name: str, **kwargs: Any + ) -> Iterable["_models.MaintenanceConfigurationResource"]: + """Gets all maintenance configurations in the specified 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: The name of the Managed Environment. Required. + :type environment_name: str + :return: An iterator like instance of either MaintenanceConfigurationResource or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource] + :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.MaintenanceConfigurationCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_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.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.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MaintenanceConfigurationCollection", 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) + + @overload + def create_or_update( + self, + resource_group_name: str, + environment_name: str, + config_name: str, + maintenance_configuration_envelope: _models.MaintenanceConfigurationResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfigurationResource: + """Create or update the maintenance configuration for 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: The name of the Managed Environment. Required. + :type environment_name: str + :param config_name: The name of the maintenance configuration. Required. + :type config_name: str + :param maintenance_configuration_envelope: Parameters to set the maintenance configuration for + ManagedEnvironment . Required. + :type maintenance_configuration_envelope: + ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MaintenanceConfigurationResource or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + environment_name: str, + config_name: str, + maintenance_configuration_envelope: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfigurationResource: + """Create or update the maintenance configuration for 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: The name of the Managed Environment. Required. + :type environment_name: str + :param config_name: The name of the maintenance configuration. Required. + :type config_name: str + :param maintenance_configuration_envelope: Parameters to set the maintenance configuration for + ManagedEnvironment . Required. + :type maintenance_configuration_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: MaintenanceConfigurationResource or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + environment_name: str, + config_name: str, + maintenance_configuration_envelope: Union[_models.MaintenanceConfigurationResource, IO[bytes]], + **kwargs: Any + ) -> _models.MaintenanceConfigurationResource: + """Create or update the maintenance configuration for 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: The name of the Managed Environment. Required. + :type environment_name: str + :param config_name: The name of the maintenance configuration. Required. + :type config_name: str + :param maintenance_configuration_envelope: Parameters to set the maintenance configuration for + ManagedEnvironment . Is either a MaintenanceConfigurationResource type or a IO[bytes] type. + Required. + :type maintenance_configuration_envelope: + ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource or IO[bytes] + :return: MaintenanceConfigurationResource or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = 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.MaintenanceConfigurationResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(maintenance_configuration_envelope, (IOBase, bytes)): + _content = maintenance_configuration_envelope + else: + _json = self._serialize.body(maintenance_configuration_envelope, "MaintenanceConfigurationResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + environment_name=environment_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _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) + + deserialized = self._deserialize("MaintenanceConfigurationResource", pipeline_response.http_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, config_name: str, **kwargs: Any + ) -> None: + """Deletes the maintenance configuration of a ManagedEnvironment . + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param environment_name: The name of the Managed Environment. Required. + :type environment_name: str + :param config_name: The name of the maintenance configuration. Required. + :type config_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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, environment_name: str, config_name: str, **kwargs: Any + ) -> _models.MaintenanceConfigurationResource: + """Gets the maintenance configuration of a ManagedEnvironment . + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param environment_name: The name of the Managed Environment. Required. + :type environment_name: str + :param config_name: The name of the maintenance configuration. Required. + :type config_name: str + :return: MaintenanceConfigurationResource or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.MaintenanceConfigurationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = 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.MaintenanceConfigurationResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + environment_name=environment_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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("MaintenanceConfigurationResource", pipeline_response.http_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/_managed_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py index 9f36dced20c6..c2de85a1a577 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -84,7 +82,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -92,7 +90,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -121,14 +119,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -155,7 +153,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -163,7 +161,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -192,14 +190,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -233,10 +231,10 @@ class ManagedCertificatesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get( @@ -257,7 +255,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.ManagedCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,15 +307,11 @@ def _create_or_update_initial( managed_certificate_envelope: Optional[Union[_models.ManagedCertificate, IO[bytes]]] = None, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 400: cast( - Type[HttpResponseError], - lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -543,7 +537,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -677,7 +671,7 @@ def update( :rtype: ~azure.mgmt.appcontainers.models.ManagedCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -756,7 +750,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedCertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 9dc1c93f419e..996d5f9aa1f5 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +6,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,14 +41,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -76,14 +74,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -118,10 +116,10 @@ class ManagedEnvironmentDiagnosticsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_detectors( @@ -140,7 +138,7 @@ def list_detectors( :rtype: ~azure.mgmt.appcontainers.models.DiagnosticsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -202,7 +200,7 @@ def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_endpoint_connections_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_endpoint_connections_operations.py index bc2a1b0afbbd..8b02e46ffe9e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_endpoint_connections_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_endpoint_connections_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,14 +48,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -87,14 +85,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -127,7 +125,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -135,7 +133,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -170,14 +168,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -214,10 +212,10 @@ class ManagedEnvironmentPrivateEndpointConnectionsOperations: # pylint: disable 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -244,7 +242,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +325,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +377,7 @@ def _create_or_update_initial( private_endpoint_connection_envelope: Union[_models.PrivateEndpointConnection, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -595,7 +593,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, environment_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_link_resources_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_link_resources_operations.py index b0e3381efafc..952e740d67ba 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_link_resources_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_link_resources_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +43,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateLinkResources", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -86,10 +84,10 @@ class ManagedEnvironmentPrivateLinkResourcesOperations: # pylint: disable=name- 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -114,7 +112,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 1a5c2012b781..690eb992cc3e 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +43,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -86,10 +84,10 @@ class ManagedEnvironmentUsagesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> Iterable["_models.Usage"]: @@ -110,7 +108,7 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListUsagesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 3fc779e575d5..89b7274f1d21 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +6,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Optional, TypeVar +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -24,12 +25,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,14 +41,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -84,10 +82,10 @@ class ManagedEnvironmentsDiagnosticsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get_root(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> _models.ManagedEnvironment: @@ -104,7 +102,7 @@ def get_root(self, resource_group_name: str, environment_name: str, **kwargs: An :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 7a8ce01af66d..bb8b30ffc6ef 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +46,7 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,14 +70,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -104,14 +102,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -137,7 +135,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +143,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -173,14 +171,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -206,7 +204,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -214,7 +212,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -242,14 +240,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -275,14 +273,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -316,10 +314,10 @@ class ManagedEnvironmentsOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ManagedEnvironment"]: @@ -337,7 +335,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ManagedEnviro api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedEnvironmentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -417,7 +415,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedEnvironmentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -494,7 +492,7 @@ def get(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +542,7 @@ def _create_or_update_initial( environment_envelope: Union[_models.ManagedEnvironment, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +735,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -847,7 +845,7 @@ def _update_initial( environment_envelope: Union[_models.ManagedEnvironment, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1056,7 +1054,7 @@ def get_auth_token( :rtype: ~azure.mgmt.appcontainers.models.EnvironmentAuthToken :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1123,7 +1121,7 @@ def list_workload_profile_states( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadProfileStatesCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 03461d39e5b0..73dca4f47956 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,14 +42,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -77,14 +75,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -111,7 +109,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -119,7 +117,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -148,14 +146,14 @@ 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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -190,10 +188,10 @@ class ManagedEnvironmentsStoragesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list( @@ -212,7 +210,7 @@ def list( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStoragesCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +272,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +407,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -453,7 +451,7 @@ def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200]: + 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) @@ -484,7 +482,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 fc3bcc72ea79..e1653ff62ee8 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -25,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +42,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -52,7 +50,7 @@ def build_check_name_availability_request( _url = kwargs.pop( "template_url", "/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"), "resourceGroupName": _SERIALIZER.url( @@ -88,10 +86,10 @@ class NamespacesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload def check_name_availability( @@ -177,7 +175,7 @@ def check_name_availability( :rtype: ~azure.mgmt.appcontainers.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 2a59bde3b989..2dde34e03eb1 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,10 +69,10 @@ class Operations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: @@ -91,7 +88,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AvailableOperations] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 d5a93c241b48..5613d55964e4 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 @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import ContainerAppsAPIClientConfiguration +from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,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", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-02-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,10 +77,10 @@ class UsagesOperations: 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerAppsAPIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: @@ -102,7 +99,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListUsagesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 index 5a7c362d5592..7b87707aa2f4 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -56,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 2a3290b3c7b3..a60aa988c395 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 7065799318f7..882d8041c772 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index f6775fa9fb55..b6d25511cf8c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 7098bc5e8eb5..3d45ced92172 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_patch.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AppResiliency_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_blob_storage_token_store_client_id_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_blob_storage_token_store_client_id_create_or_update.py new file mode 100644 index 000000000000..4c456d8373d1 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_blob_storage_token_store_client_id_create_or_update.py @@ -0,0 +1,65 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 auth_configs_blob_storage_token_store_client_id_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.container_apps_auth_configs.create_or_update( + resource_group_name="rg1", + container_app_name="myapp", + auth_config_name="current", + auth_config_envelope={ + "properties": { + "encryptionSettings": { + "containerAppAuthEncryptionSecretName": "testEncryptionSecretName", + "containerAppAuthSigningSecretName": "testSigningSecretName", + }, + "globalValidation": {"unauthenticatedClientAction": "AllowAnonymous"}, + "identityProviders": { + "facebook": {"registration": {"appId": "123", "appSecretSettingName": "facebook-secret"}} + }, + "login": { + "tokenStore": { + "azureBlobStorage": { + "blobContainerUri": "https://test.blob.core.windows.net/container1", + "clientId": "00000000-0000-0000-0000-000000000000", + } + } + }, + "platform": {"enabled": True}, + } + }, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_BlobStorageTokenStore_ClientId_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_blob_storage_token_store_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_blob_storage_token_store_create_or_update.py new file mode 100644 index 000000000000..2f585f5c753c --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_blob_storage_token_store_create_or_update.py @@ -0,0 +1,65 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 auth_configs_blob_storage_token_store_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.container_apps_auth_configs.create_or_update( + resource_group_name="rg1", + container_app_name="myapp", + auth_config_name="current", + auth_config_envelope={ + "properties": { + "encryptionSettings": { + "containerAppAuthEncryptionSecretName": "testEncryptionSecretName", + "containerAppAuthSigningSecretName": "testSigningSecretName", + }, + "globalValidation": {"unauthenticatedClientAction": "AllowAnonymous"}, + "identityProviders": { + "facebook": {"registration": {"appId": "123", "appSecretSettingName": "facebook-secret"}} + }, + "login": { + "tokenStore": { + "azureBlobStorage": { + "blobContainerUri": "https://test.blob.core.windows.net/container1", + "managedIdentityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + } + } + }, + "platform": {"enabled": True}, + } + }, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_BlobStorageTokenStore_CreateOrUpdate.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 c71fdb6e4cdd..621d07c2f29e 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 8240d4e413a7..9de6fefd2bba 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 4c69273b19ca..1e8b41c0c444 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 dd0e21b2cdfb..b7073829ac1b 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_ListByContainer.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 32d0a6b0f796..96674ea98d50 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AvailableWorkloadProfiles_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 80c67d53ed01..def739cb7f31 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/BillingMeters_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 index 04594ac45949..6e0668920fd8 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -60,6 +61,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 259406317a14..9f9015cd5e6c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index e2321d5c4a71..ffe1fdb96b75 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 2cdceb481671..e302647eaf3c 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 13608b9d4dff..ca68b2f67370 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 0d01c2a2e546..abf4d449713e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Update.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index ae6655d27d86..8256184eaefe 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -65,6 +66,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 67b8f63959d6..4123fb1db88e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 2148675026f8..f18e260633ae 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index f66fd8c88ea5..51f63d51f24f 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_ListAuthToken.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index cc345a50860d..5c2a0d12ec29 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_ListByBuilderResource.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 594148a497b8..23b1ae61056a 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 index ef33b0ce76c3..ad77e7001b7d 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_CreateOrUpdate_FromKeyVault.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 f23ff120a400..8c80f10ee732 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 0828c12aa00b..7483953b347a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 05ff56b14ce6..6c00467ebdd6 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificates_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 91be5df081a0..d9accf10450c 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificates_ListByManagedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 bb11fd7d3044..7160bccb6fa3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 da89a8a2733e..20f5d26bdfac 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,14 +31,14 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.connected_environments_certificates.create_or_update( + response = client.connected_environments_certificates.begin_create_or_update( resource_group_name="examplerg", connected_environment_name="testcontainerenv", certificate_name="certificate-firendly-name", - ) + ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 bb43e5e857eb..134aa400b880 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,13 +31,13 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - client.connected_environments_certificates.delete( + client.connected_environments_certificates.begin_delete( resource_group_name="examplerg", connected_environment_name="testcontainerenv", certificate_name="certificate-firendly-name", - ) + ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 86116532731b..47f9d373457b 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 6a53577f801c..af1c0d463207 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 1e7beb90acf6..0a16f9760b83 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 18e1b105e2e8..24d0254f1271 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,15 +31,15 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.connected_environments_certificates.update( + response = client.connected_environments_certificates.begin_update( resource_group_name="examplerg", connected_environment_name="testcontainerenv", certificate_name="certificate-firendly-name", certificate_envelope={"tags": {"tag1": "value1", "tag2": "value2"}}, - ) + ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 24727ed167a4..62153f3ae623 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -49,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 d9b1da9ab451..c24cfd6caa73 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,7 +31,7 @@ def main(): subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) - response = client.connected_environments_dapr_components.create_or_update( + response = client.connected_environments_dapr_components.begin_create_or_update( resource_group_name="examplerg", connected_environment_name="myenvironment", component_name="reddog", @@ -57,10 +58,10 @@ def main(): "version": "v1", } }, - ) + ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 76733621cead..70ea63e1dbc5 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,13 +31,13 @@ def main(): subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) - client.connected_environments_dapr_components.delete( + client.connected_environments_dapr_components.begin_delete( resource_group_name="examplerg", connected_environment_name="myenvironment", component_name="reddog", - ) + ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 b3dbdff17128..059523b32069 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 dc4e642bcea1..2d7fae2f14e1 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsDaprComponents_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 10a102b48849..aeebf6485cff 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 b6b488e37f47..d77325eb38f9 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 ae85090e64f1..b285ffee08bd 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 91340e4d4d70..cf1e5649ffa1 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 ffe41e43b870..6d57700f8ad4 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 9392818cb7a2..b929bc103daa 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 094e1d0ce1a1..088290e190b4 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,7 +31,7 @@ def main(): subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) - response = client.connected_environments_storages.create_or_update( + response = client.connected_environments_storages.begin_create_or_update( resource_group_name="examplerg", connected_environment_name="env", storage_name="jlaw-demo1", @@ -44,10 +45,10 @@ def main(): } } }, - ) + ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 05d1bf87a369..6605b9429bf5 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,13 +31,13 @@ def main(): subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) - client.connected_environments_storages.delete( + client.connected_environments_storages.begin_delete( resource_group_name="examplerg", connected_environment_name="env", storage_name="jlaw-demo1", - ) + ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsStorages_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 391eec19758c..651f0b8da467 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsStorages_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 c73dc0806d5a..64b65360ee3a 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsStorages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsStorages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_delete.py index 1a7c4db19768..d618e86aa47b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsBuilds_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_get.py index a1d2cf259996..27e64f705976 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsBuilds_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_list_by_container_app.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_list_by_container_app.py index c9c0d99d4e1f..62d47b9e8029 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_list_by_container_app.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_list_by_container_app.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_ListByContainerApp.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsBuilds_ListByContainerApp.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 c39bd4f29d8d..0014230b4b95 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 1ad3f2c2c0ab..ed64a0235142 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -44,6 +45,13 @@ def main(): "properties": { "configuration": { "dapr": { + "appHealth": { + "enabled": True, + "path": "/health", + "probeIntervalSeconds": 3, + "probeTimeoutMilliseconds": 1000, + "threshold": 3, + }, "appPort": 3000, "appProtocol": "http", "enableApiLogging": True, @@ -51,6 +59,7 @@ def main(): "httpMaxRequestSize": 10, "httpReadBufferSize": 30, "logLevel": "debug", + "maxConcurrency": 10, }, "identitySettings": [ { @@ -105,6 +114,7 @@ def main(): "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, + "revisionTransitionThreshold": 100, "runtime": { "dotnet": {"autoConfigureDataProtection": True}, "java": { @@ -149,7 +159,7 @@ def main(): "command": ["/bin/sh"], "image": "repo/testcontainerApp0:v4", "name": "testinitcontainerApp0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, + "resources": {"cpu": 0.2, "gpu": 1, "memory": "100Mi"}, } ], "scale": { @@ -205,6 +215,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 index 982c44339883..588daf8dcd14 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -96,6 +97,7 @@ def main(): "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, + "revisionTransitionThreshold": 100, "runtime": { "dotnet": {"autoConfigureDataProtection": True}, "java": { @@ -157,6 +159,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_CreateOrUpdate_ConnectedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 be555431bf19..12e55632a001 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 6a6cba62774f..2d27fe032f36 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsDiagnostics_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 44e30c8edd2c..e5dcf52f1410 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsDiagnostics_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 f5f2cf370cd5..0fb7f9e9a90c 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,13 +31,13 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.container_apps_diagnostics.get_root( + response = client.container_apps.get( resource_group_name="rg", container_app_name="testcontainerApp0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 42aaf1991bc1..33744a960434 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_GetAuthToken.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_GetAuthToken.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_kind_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_kind_create_or_update.py index 0710f88d9a99..6d672cb4ffc5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_kind_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_kind_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -59,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Kind_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Kind_CreateOrUpdate.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 1bc694dc2101..8b667d153a87 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 eca4c3765a5a..cff12b08ec2d 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 f057938529c9..65d91f2a5d9d 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 b06c04f37800..d0210c4da434 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 0567ceee69bc..5714476615cc 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -76,6 +77,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ManagedBy_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 614ee5f6f01e..0d998c0265f7 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,13 @@ def main(): "properties": { "configuration": { "dapr": { + "appHealth": { + "enabled": True, + "path": "/health", + "probeIntervalSeconds": 3, + "probeTimeoutMilliseconds": 1000, + "threshold": 3, + }, "appPort": 3000, "appProtocol": "http", "enableApiLogging": True, @@ -45,6 +53,7 @@ def main(): "httpMaxRequestSize": 10, "httpReadBufferSize": 30, "logLevel": "debug", + "maxConcurrency": 10, }, "ingress": { "customDomains": [ @@ -79,6 +88,7 @@ def main(): "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, + "revisionTransitionThreshold": 100, "runtime": { "dotnet": {"autoConfigureDataProtection": True}, "java": { @@ -147,6 +157,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_apply.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_apply.py index 3ae8181fb130..8970b2310f34 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_apply.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_apply.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Apply.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Apply.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_delete.py index 46e89807a6d6..338a6646d9a1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_get.py index ea96d388a69a..7b10f7abf0b9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_list_by_container_app.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_list_by_container_app.py index 137b60c3a890..4ac3dfd296f8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_list_by_container_app.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_list_by_container_app.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_ListByContainerApp.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_ListByContainerApp.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_skip_configure.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_skip_configure.py index 8c6cf0adfa0b..96109d0e2cf3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_skip_configure.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_skip_configure.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Skip_Configure.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Skip_Configure.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_source_to_cloud_app_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_source_to_cloud_app_create_or_update.py index 7a0d2a37f956..38b1c7ea01a4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_source_to_cloud_app_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_source_to_cloud_app_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -92,6 +93,7 @@ def main(): "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, + "revisionTransitionThreshold": 100, "service": {"type": "redis"}, }, "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", @@ -161,6 +163,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_SourceToCloudApp_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_SourceToCloudApp_CreateOrUpdate.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 b931704058da..34cf8de82eba 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Start.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 4e53aecae74d..15cc6ca349cd 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Stop.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 9088967d2cec..2c4bab79b1e5 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -75,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 index 394bfb98e13f..4aa9830eb628 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicies_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 7c171732cfb2..b88a79bf2458 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicies_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 64e1d88ee179..a236511ef3de 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicies_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index c4c74ea43170..23a787bb8d1d 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -59,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_AllOptions.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 7ba3b3bded64..338b920ca0aa 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_OutboundOnly.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index d6699ea9382e..9e28dd545e7c 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -51,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_SparseOptions.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 9e65fca11fad..e34ac4d318d8 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -61,6 +62,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 fd9f72adf0ee..5d06f1e0bc11 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -61,6 +62,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 bc2d152efa0b..c12cc258e0be 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 ddb007ce3e77..a28d72250455 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_Get_SecretStoreComponent.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 58575899c8e3..77548ed7ad1c 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_Get_Secrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 d714ed7bca74..3602646cb6d0 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 0f1599cd7207..2425eb667a6a 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 index a806104af44e..5e561d5a4187 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_CreateOrUpdate_BulkSubscribeAndScopes.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 861b72b01334..7d78c2b2ddc7 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_CreateOrUpdate_DefaultRoute.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index b9190c4a3420..9575da8e0f51 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_CreateOrUpdate_RouteRulesAndMetadata.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 5531aaa71688..8286296b3a9c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 76c9018263a1..64f1a9084a8b 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_Get_BulkSubscribeAndScopes.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index eab424bf711a..ce1de927e7a7 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_Get_DefaultRoute.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 0bd6e9711f36..1d5b3691443e 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_Get_RouteRulesAndMetadata.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 04baa56e6474..fbdcbc52dcc8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 7bf97b63e080..cde394a7bc48 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -44,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index bdf0d33a3abb..939b8c800e62 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -50,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_CreateOrUpdate_ServiceBind.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 08d450b57995..8408f384567c 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index af8ccf93d2d3..b178cd392f6b 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 95a45b0579e1..4a892d2163f3 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Get_ServiceBind.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index e20c21100d1d..269aec68a2bf 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 5509186a4fa4..32b1a18c4905 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_List_ServiceBind.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index b12aa6939207..b13fdff30109 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -44,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index d439a50b57cf..96264471c90f 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -50,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Patch_ServiceBind.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Patch_ServiceBind.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/functions_extension_post.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/functions_extension_post.py index 46a70524d072..4249ba960e2e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/functions_extension_post.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/functions_extension_post.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/FunctionsExtension_Post.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/FunctionsExtension_Post.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_create_or_update.py new file mode 100644 index 000000000000..607a8512960d --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_create_or_update.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 http_route_config_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.http_route_config.create_or_update( + resource_group_name="examplerg", + environment_name="testcontainerenv", + http_route_name="httproutefriendlyname", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_create_or_update_path_sep_prefix.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_create_or_update_path_sep_prefix.py new file mode 100644 index 000000000000..0938141b409b --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_create_or_update_path_sep_prefix.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 http_route_config_create_or_update_path_sep_prefix.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.http_route_config.create_or_update( + resource_group_name="examplerg", + environment_name="testcontainerenv", + http_route_name="httproutefriendlyname", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_CreateOrUpdate_PathSepPrefix.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_create_or_update_prefix.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_create_or_update_prefix.py new file mode 100644 index 000000000000..99158ac56d5e --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_create_or_update_prefix.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 http_route_config_create_or_update_prefix.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.http_route_config.create_or_update( + resource_group_name="examplerg", + environment_name="testcontainerenv", + http_route_name="httproutefriendlyname", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_CreateOrUpdatePrefix.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_delete.py new file mode 100644 index 000000000000..6b1b0668e554 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_delete.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 http_route_config_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.http_route_config.delete( + resource_group_name="examplerg", + environment_name="testcontainerenv", + http_route_name="httproutefriendlyname", + ) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_get.py new file mode 100644 index 000000000000..dafff3297e49 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_get.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 http_route_config_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.http_route_config.get( + resource_group_name="examplerg", + environment_name="testcontainerenv", + http_route_name="httproutefriendlyname", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_list_by_managed_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_list_by_managed_environment.py new file mode 100644 index 000000000000..b0576621925e --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_list_by_managed_environment.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 http_route_config_list_by_managed_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.http_route_config.list( + resource_group_name="examplerg", + environment_name="testcontainerenv", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_ListByManagedEnvironment.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_patch.py new file mode 100644 index 000000000000..01e0add527bb --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/http_route_config_patch.py @@ -0,0 +1,64 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 http_route_config_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.http_route_config.update( + resource_group_name="examplerg", + environment_name="testcontainerenv", + http_route_name="httproutefriendlyname", + http_route_config_envelope={ + "properties": { + "customDomains": [ + { + "bindingType": "SniEnabled", + "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificates/certificate-1", + "name": "example.com", + } + ], + "rules": [ + { + "description": "random-description", + "routes": [ + {"action": {"prefixRewrite": "/v1/api"}, "match": {"caseSensitive": True, "path": "/v1"}} + ], + "targets": [{"containerApp": "capp-1", "revision": "rev-1", "weight": 100}], + } + ], + } + }, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_Patch.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 index 78359218bf25..03ae865462c5 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 0a963ba92c96..60d9f5562a55 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -54,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_CreateOrUpdate_ServiceBind.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 783cb50c8e1a..2ef6100aedbf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index f1f2f6ba1733..28df0a670f87 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 9f764f970b73..b8a965313575 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Get_ServiceBind.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 1dfffd9db9f7..e4985ef7cd0e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 7e7008efcfbb..39ee4abb4fde 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_List_ServiceBind.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index 7b56ab8543fd..1f7611298528 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 index a8fcc4eba3ed..5d32d891f9d3 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -54,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Patch_ServiceBind.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Patch_ServiceBind.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 5aad6377c5c5..798cbb35eefc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 6f1ec8ca2fe3..6d9b60293d81 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Execution_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 787f2903c41c..96a8372428b2 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Executions_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 432732fb53e2..719bd945ac0e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 c0cd4f3e5e07..917fa028496d 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_GetDetector.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 8e3ed688b03d..7e6851de4200 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ListDetectors.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 45a5d1f3eda2..990bdefbdc12 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_ListSecrets.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 166007f8aa4f..ff9977de3f69 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ProxyGet.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 660e975ae04e..c476c8906c66 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Start.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 d9efac99f737..fe3e104f07ba 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Stop_Execution.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 964d950f3103..4eda466eb419 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Stop_Multiple.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 394544855a3b..5ce59a6aedae 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 901b6ca6b3c4..708ef475761f 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Jobs_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_resume.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_resume.py index d5103965c699..c7b66d7a6c99 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_resume.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_resume.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_Resume.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Jobs_Resume.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_suspend.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_suspend.py index 494dc3570660..8293faab4385 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_suspend.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_suspend.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_Suspend.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Jobs_Suspend.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/label_history_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/label_history_delete.py new file mode 100644 index 000000000000..c9a5d365fe81 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/label_history_delete.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 label_history_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.container_apps_label_history.delete_label_history( + resource_group_name="rg", + container_app_name="testContainerApp", + label_name="dev", + ) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LabelHistory_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/label_history_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/label_history_get.py new file mode 100644 index 000000000000..e0cc98dfe207 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/label_history_get.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 label_history_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.container_apps_label_history.get_label_history( + resource_group_name="rg", + container_app_name="testContainerApp", + label_name="dev", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LabelHistory_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/label_history_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/label_history_list.py new file mode 100644 index 000000000000..2fcc2e0d70a6 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/label_history_list.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 label_history_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.container_apps_label_history.list_label_history( + resource_group_name="rg", + container_app_name="testContainerApp", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LabelHistory_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_create.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_create.py index b17a83a1db5a..4ea1e48c84b0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_create.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Create.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_Create.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete.py index 3723a6b14dc0..9d7a778f9efc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete_deploy_workflow_artifacts.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete_deploy_workflow_artifacts.py index 53a088ad48e8..545bcfac1ba4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete_deploy_workflow_artifacts.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete_deploy_workflow_artifacts.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_DeleteDeployWorkflowArtifacts.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_DeleteDeployWorkflowArtifacts.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get.py index 3f3bbb065063..6b557192f723 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get_workflow.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get_workflow.py index 10cc104a38d5..d184390af0dd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get_workflow.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get_workflow.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_GetWorkflow.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_GetWorkflow.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_connections.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_connections.py index 0df82c749ed7..afe80e5bbf98 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_connections.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_connections.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListConnections.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_ListConnections.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_workflows.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_workflows.py index 1760beb7571c..afc4192d66ec 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_workflows.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_workflows.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListWorkflows.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_ListWorkflows.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_post_deploy_workflow_artifacts.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_post_deploy_workflow_artifacts.py index f2d1b47a8a05..7fd1d64848a4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_post_deploy_workflow_artifacts.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_post_deploy_workflow_artifacts.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_PostDeployWorkflowArtifacts.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_PostDeployWorkflowArtifacts.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 0a78917c2a1b..4ebcb6d146bb 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 88d24e1ba8fb..2a680c40e0b4 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 af53b64175c2..80621db4103a 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 a75a51c33023..77f6f27820af 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificates_ListByManagedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 b05a6fd36ff3..2bebf47f2c38 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 f0059c7b40bb..2b19abec3459 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentDiagnostics_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 05db0567889d..5323e55d8645 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentDiagnostics_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentDiagnostics_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_create_or_update.py new file mode 100644 index 000000000000..866a19bf7727 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_create_or_update.py @@ -0,0 +1,47 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_environment_maintenance_configurations_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.maintenance_configurations.create_or_update( + resource_group_name="rg1", + environment_name="managedEnv", + config_name="default", + maintenance_configuration_envelope={ + "properties": {"scheduledEntries": [{"durationHours": 9, "startHourUtc": 12, "weekDay": "Sunday"}]} + }, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_delete.py new file mode 100644 index 000000000000..875cab1b4166 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_delete.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_environment_maintenance_configurations_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.maintenance_configurations.delete( + resource_group_name="rg1", + environment_name="managedEnv", + config_name="default", + ) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_get.py new file mode 100644 index 000000000000..7bbda1cf8142 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_get.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_environment_maintenance_configurations_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.maintenance_configurations.get( + resource_group_name="rg1", + environment_name="managedEnv", + config_name="default", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_list.py new file mode 100644 index 000000000000..61bd11fb6e51 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_maintenance_configurations_list.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_environment_maintenance_configurations_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.maintenance_configurations.list( + resource_group_name="rg1", + environment_name="managedEnv", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_create_or_update.py index ac50de426bf2..d02b90f96295 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_delete.py index 4cda07073ec4..f3a7296247ff 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_get.py index f294ecfe6ebc..1dd29f89a49a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_list.py index f324695db3db..26fa092e9ffb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_link_resources_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_link_resources_list.py index 771e0aa19b54..9355a2feb9dd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_link_resources_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_link_resources_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateLinkResources_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateLinkResources_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 aa809adeb2e3..75a4b7900186 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentUsages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 5fa930b36332..c99e4903e510 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,12 +53,20 @@ def main(): "sharedKey": "string", } }, + "availabilityZones": ["1", "2", "3"], "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/", + "ingressConfiguration": { + "headerCountLimit": 30, + "requestIdleTimeout": 5, + "scale": {"maxReplicas": 4, "minReplicas": 2}, + "terminationGracePeriodSeconds": 3600, + "workloadProfileName": "My-CO-01", + }, "openTelemetryConfiguration": { "destinationsConfiguration": { "dataDogConfiguration": {"key": "000000000000000000000000", "site": "string"}, @@ -108,6 +117,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 8f8767d800dc..3ed17cfd223f 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,7 @@ def main(): "location": "East US", "properties": { "appLogsConfiguration": {"logAnalyticsConfiguration": {"customerId": "string", "sharedKey": "string"}}, + "availabilityZones": ["1", "2", "3"], "customDomainConfiguration": { "certificatePassword": "1234", "certificateValue": "Y2VydA==", @@ -76,6 +78,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 835a60c6ba03..84ea4e8c1ba1 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 7318e63a3949..971aee10b288 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,13 +31,13 @@ def main(): subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) - response = client.managed_environments.get( + response = client.managed_environments_diagnostics.get_root( resource_group_name="examplerg", environment_name="jlaw-demo1", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 d62bf60ab031..56062e0a1caf 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_GetAuthToken.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 f6b0a88941b7..3ef911524519 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 fa26dbe7803e..29f01e91ea3c 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 61c26bbbff07..207b8d35cf13 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 a42e432b9031..6fd94b23d569 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 a3d5b15e6e3a..d50604fd2f75 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 index 87655ae18c0e..35ceac33530d 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 e8d45d34bc46..4409705e29fc 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 1506b49d9b30..a23b708848cf 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 index a69c23be4467..55b2fcd0e5c6 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-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 e27605853999..c3e8db16c270 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 d945168ac5c0..39952bffab48 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Operations_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 4d55341354b1..1b70971f4d8b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Replicas_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 1620ba85d3de..5d99eadbfd91 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Replicas_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 c1fc63f741ea..aac1a61e3314 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Activate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 50cdbdd917af..34706ec169f4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Deactivate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 0cb1046f492b..2ad22195eab7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,7 +31,7 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.container_apps_diagnostics.get_revision( + response = client.container_apps_revisions.get_revision( resource_group_name="rg", container_app_name="testcontainerApp0", revision_name="testcontainerApp0-pjxhsye", @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 fc17ef5677bc..23153aa96493 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,7 +31,7 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.container_apps_diagnostics.list_revisions( + response = client.container_apps_revisions.list_revisions( resource_group_name="rg", container_app_name="testcontainerApp0", ) @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 018d3b7f8917..f0305e1dec24 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Restart.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Restart.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_create_or_update.py index a9466d929675..8bb8229150be 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_create_or_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -34,6 +35,7 @@ def main(): resource_group_name="rg", session_pool_name="testsessionpool", session_pool_envelope={ + "identity": {"type": "SystemAssigned"}, "location": "East US", "properties": { "containerType": "CustomContainer", @@ -48,9 +50,14 @@ def main(): } ], "ingress": {"targetPort": 80}, + "registryCredentials": { + "identity": "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP", + "server": "test.azurecr.io", + }, }, "dynamicPoolConfiguration": {"cooldownPeriodInSeconds": 600, "executionType": "Timed"}, "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", + "managedIdentitySettings": [{"identity": "system", "lifecycle": "Main"}], "poolManagementType": "Dynamic", "scaleConfiguration": {"maxConcurrentSessions": 500, "readySessionInstances": 100}, "sessionNetworkConfiguration": {"status": "EgressEnabled"}, @@ -60,6 +67,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_delete.py index 87437162a7c2..aa4174a48574 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_get.py index 2c8cced5037b..f03ca08c01a4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_resource_group.py index ecc34901eb6e..6b9e78a8a178 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_resource_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_subscription.py index 5a621a6ca5bb..2d077c94ba17 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_subscription.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_patch.py index ec4fb6a3bff4..977d9713fb39 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_patch.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -56,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_Patch.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 546e8c7f7c50..8b686ab6906b 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -62,6 +63,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 190c5f835db5..88b5678c4a20 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 fe678c5d8efb..9b2ba08c3849 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 858543e28e02..34327f7f5f94 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_ListByContainer.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 16e4146f2b8a..8dd9cb004741 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -34,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Subscriptions_GetCustomDomainVerificationId.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/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 62f7320f33b0..9b14bdf5278f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/usages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/usages_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Usages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Usages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/conftest.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/conftest.py index 961ce7cf468a..d6403655d30d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/conftest.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/conftest.py @@ -18,7 +18,7 @@ load_dotenv() -# aovid record sensitive identity information in recordings +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): containerappsapi_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api.py index 94215044ea12..508eacc41f89 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api.py @@ -25,7 +25,7 @@ def test_job_execution(self, resource_group): resource_group_name=resource_group.name, job_name="str", job_execution_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -35,7 +35,7 @@ def test_job_execution(self, resource_group): @recorded_by_proxy def test_get_custom_domain_verification_id(self, resource_group): response = self.client.get_custom_domain_verification_id( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_app_resiliency_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_app_resiliency_operations.py index 54644f94f304..7ef4475f3088 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_app_resiliency_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_app_resiliency_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_app_resiliency_create_or_update(self, resource_group): response = self.client.app_resiliency.create_or_update( resource_group_name=resource_group.name, app_name="str", @@ -59,7 +59,7 @@ def test_create_or_update(self, resource_group): "timeoutPolicy": {"connectionTimeoutInSeconds": 0, "responseTimeoutInSeconds": 0}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -67,7 +67,7 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_app_resiliency_update(self, resource_group): response = self.client.app_resiliency.update( resource_group_name=resource_group.name, app_name="str", @@ -106,7 +106,7 @@ def test_update(self, resource_group): "timeoutPolicy": {"connectionTimeoutInSeconds": 0, "responseTimeoutInSeconds": 0}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -114,12 +114,12 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_app_resiliency_delete(self, resource_group): response = self.client.app_resiliency.delete( resource_group_name=resource_group.name, app_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -127,12 +127,12 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_app_resiliency_get(self, resource_group): response = self.client.app_resiliency.get( resource_group_name=resource_group.name, app_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -140,11 +140,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_app_resiliency_list(self, resource_group): response = self.client.app_resiliency.list( resource_group_name=resource_group.name, app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_app_resiliency_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_app_resiliency_operations_async.py index ff4be53d4302..90ee2826964d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_app_resiliency_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_app_resiliency_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_app_resiliency_create_or_update(self, resource_group): response = await self.client.app_resiliency.create_or_update( resource_group_name=resource_group.name, app_name="str", @@ -60,7 +60,7 @@ async def test_create_or_update(self, resource_group): "timeoutPolicy": {"connectionTimeoutInSeconds": 0, "responseTimeoutInSeconds": 0}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_app_resiliency_update(self, resource_group): response = await self.client.app_resiliency.update( resource_group_name=resource_group.name, app_name="str", @@ -107,7 +107,7 @@ async def test_update(self, resource_group): "timeoutPolicy": {"connectionTimeoutInSeconds": 0, "responseTimeoutInSeconds": 0}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -115,12 +115,12 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_app_resiliency_delete(self, resource_group): response = await self.client.app_resiliency.delete( resource_group_name=resource_group.name, app_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -128,12 +128,12 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_app_resiliency_get(self, resource_group): response = await self.client.app_resiliency.get( resource_group_name=resource_group.name, app_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -141,11 +141,11 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_app_resiliency_list(self, resource_group): response = self.client.app_resiliency.list( resource_group_name=resource_group.name, app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_async.py index ef584fad5d2d..6fcf607e8173 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_async.py @@ -26,7 +26,7 @@ async def test_job_execution(self, resource_group): resource_group_name=resource_group.name, job_name="str", job_execution_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -36,7 +36,7 @@ async def test_job_execution(self, resource_group): @recorded_by_proxy_async async def test_get_custom_domain_verification_id(self, resource_group): response = await self.client.get_custom_domain_verification_id( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations.py index 8eae410d0d89..0d1a0d9f6649 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations.py @@ -20,10 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_available_workload_profiles_get(self, resource_group): response = self.client.available_workload_profiles.get( location="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations_async.py index f1c9e48ffecb..d0526c8fb921 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations_async.py @@ -21,10 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_available_workload_profiles_get(self, resource_group): response = self.client.available_workload_profiles.get( location="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations.py index 275a3238118c..a1ffcb256512 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations.py @@ -20,10 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_billing_meters_get(self, resource_group): response = self.client.billing_meters.get( location="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations_async.py index f0b99ca05854..0a1364b9d5f7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations_async.py @@ -21,10 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_billing_meters_get(self, resource_group): response = await self.client.billing_meters.get( location="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_build_auth_token_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_build_auth_token_operations.py index d042638f1658..d035ccb4be43 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_build_auth_token_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_build_auth_token_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_build_auth_token_list(self, resource_group): response = self.client.build_auth_token.list( resource_group_name=resource_group.name, builder_name="str", build_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_build_auth_token_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_build_auth_token_operations_async.py index c318505cab15..f895422ba13f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_build_auth_token_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_build_auth_token_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_build_auth_token_list(self, resource_group): response = await self.client.build_auth_token.list( resource_group_name=resource_group.name, builder_name="str", build_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builders_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builders_operations.py index bf0aa1457acc..4ab8d0c3e827 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builders_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builders_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_builders_list_by_subscription(self, resource_group): response = self.client.builders.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_builders_list_by_resource_group(self, resource_group): response = self.client.builders.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +41,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_builders_get(self, resource_group): response = self.client.builders.get( resource_group_name=resource_group.name, builder_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -53,7 +53,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_builders_begin_create_or_update(self, resource_group): response = self.client.builders.begin_create_or_update( resource_group_name=resource_group.name, builder_name="str", @@ -81,7 +81,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -89,7 +89,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_builders_begin_update(self, resource_group): response = self.client.builders.begin_update( resource_group_name=resource_group.name, builder_name="str", @@ -103,7 +103,7 @@ def test_begin_update(self, resource_group): }, "tags": {"str": "str"}, }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -111,11 +111,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_builders_begin_delete(self, resource_group): response = self.client.builders.begin_delete( resource_group_name=resource_group.name, builder_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builders_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builders_operations_async.py index 22c6c7970201..e1a54bbceb53 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builders_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builders_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_builders_list_by_subscription(self, resource_group): response = self.client.builders.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_builders_list_by_resource_group(self, resource_group): response = self.client.builders.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,11 +42,11 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_builders_get(self, resource_group): response = await self.client.builders.get( resource_group_name=resource_group.name, builder_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -54,7 +54,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_builders_begin_create_or_update(self, resource_group): response = await ( await self.client.builders.begin_create_or_update( resource_group_name=resource_group.name, @@ -83,7 +83,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -92,7 +92,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_builders_begin_update(self, resource_group): response = await ( await self.client.builders.begin_update( resource_group_name=resource_group.name, @@ -107,7 +107,7 @@ async def test_begin_update(self, resource_group): }, "tags": {"str": "str"}, }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -116,12 +116,12 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_builders_begin_delete(self, resource_group): response = await ( await self.client.builders.begin_delete( resource_group_name=resource_group.name, builder_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_by_builder_resource_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_by_builder_resource_operations.py index b09222cbb50d..129e5d69c312 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_by_builder_resource_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_by_builder_resource_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_builds_by_builder_resource_list(self, resource_group): response = self.client.builds_by_builder_resource.list( resource_group_name=resource_group.name, builder_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_by_builder_resource_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_by_builder_resource_operations_async.py index 3bb9dc3a779f..bb0ee0bd8702 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_by_builder_resource_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_by_builder_resource_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_builds_by_builder_resource_list(self, resource_group): response = self.client.builds_by_builder_resource.list( resource_group_name=resource_group.name, builder_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_operations.py index 27fc8b6e19e6..9b5daedc4607 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_builds_get(self, resource_group): response = self.client.builds.get( resource_group_name=resource_group.name, builder_name="str", build_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_builds_begin_create_or_update(self, resource_group): response = self.client.builds.begin_create_or_update( resource_group_name=resource_group.name, builder_name="str", @@ -70,7 +70,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", "uploadEndpoint": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -78,12 +78,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_builds_begin_delete(self, resource_group): response = self.client.builds.begin_delete( resource_group_name=resource_group.name, builder_name="str", build_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_operations_async.py index 8926a7c50342..d1330fdc8e39 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_builds_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_builds_get(self, resource_group): response = await self.client.builds.get( resource_group_name=resource_group.name, builder_name="str", build_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_builds_begin_create_or_update(self, resource_group): response = await ( await self.client.builds.begin_create_or_update( resource_group_name=resource_group.name, @@ -72,7 +72,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", "uploadEndpoint": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -81,13 +81,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_builds_begin_delete(self, resource_group): response = await ( await self.client.builds.begin_delete( resource_group_name=resource_group.name, builder_name="str", build_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations.py index bb71a5ae354f..1a2b401cc36d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_certificates_list(self, resource_group): response = self.client.certificates.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_certificates_get(self, resource_group): response = self.client.certificates.get( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,12 +45,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_certificates_create_or_update(self, resource_group): response = self.client.certificates.create_or_update( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -58,12 +58,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_certificates_delete(self, resource_group): response = self.client.certificates.delete( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -71,13 +71,13 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_certificates_update(self, resource_group): response = self.client.certificates.update( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations_async.py index fa7528f15ff7..4081fdc296e6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_certificates_list(self, resource_group): response = self.client.certificates.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_certificates_get(self, resource_group): response = await self.client.certificates.get( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,12 +46,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_certificates_create_or_update(self, resource_group): response = await self.client.certificates.create_or_update( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -59,12 +59,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_certificates_delete(self, resource_group): response = await self.client.certificates.delete( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -72,13 +72,13 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_certificates_update(self, resource_group): response = await self.client.certificates.update( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations.py index 90e7557395ce..81bcd2e08260 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_connected_environments_certificates_list(self, resource_group): response = self.client.connected_environments_certificates.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_connected_environments_certificates_get(self, resource_group): response = self.client.connected_environments_certificates.get( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,40 +45,40 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): - response = self.client.connected_environments_certificates.create_or_update( + def test_connected_environments_certificates_begin_create_or_update(self, resource_group): + response = self.client.connected_environments_certificates.begin_create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", - ) + api_version="2025-02-02-preview", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): - response = self.client.connected_environments_certificates.delete( + def test_connected_environments_certificates_begin_delete(self, resource_group): + response = self.client.connected_environments_certificates.begin_delete( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", - ) + api_version="2025-02-02-preview", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): - response = self.client.connected_environments_certificates.update( + def test_connected_environments_certificates_begin_update(self, resource_group): + response = self.client.connected_environments_certificates.begin_update( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", - ) + api_version="2025-02-02-preview", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations_async.py index 1aecd0cca672..84ef57453b74 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_connected_environments_certificates_list(self, resource_group): response = self.client.connected_environments_certificates.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_connected_environments_certificates_get(self, resource_group): response = await self.client.connected_environments_certificates.get( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,40 +46,46 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): - response = await self.client.connected_environments_certificates.create_or_update( - resource_group_name=resource_group.name, - connected_environment_name="str", - certificate_name="str", - api_version="2024-08-02-preview", - ) + async def test_connected_environments_certificates_begin_create_or_update(self, resource_group): + response = await ( + await self.client.connected_environments_certificates.begin_create_or_update( + resource_group_name=resource_group.name, + connected_environment_name="str", + certificate_name="str", + api_version="2025-02-02-preview", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): - response = await self.client.connected_environments_certificates.delete( - resource_group_name=resource_group.name, - connected_environment_name="str", - certificate_name="str", - api_version="2024-08-02-preview", - ) + async def test_connected_environments_certificates_begin_delete(self, resource_group): + response = await ( + await self.client.connected_environments_certificates.begin_delete( + resource_group_name=resource_group.name, + connected_environment_name="str", + certificate_name="str", + api_version="2025-02-02-preview", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): - response = await self.client.connected_environments_certificates.update( - resource_group_name=resource_group.name, - connected_environment_name="str", - certificate_name="str", - certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", - ) + async def test_connected_environments_certificates_begin_update(self, resource_group): + response = await ( + await self.client.connected_environments_certificates.begin_update( + resource_group_name=resource_group.name, + connected_environment_name="str", + certificate_name="str", + certificate_envelope={"tags": {"str": "str"}}, + api_version="2025-02-02-preview", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations.py index d8e59805808a..756951259318 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_connected_environments_dapr_components_list(self, resource_group): response = self.client.connected_environments_dapr_components.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_connected_environments_dapr_components_get(self, resource_group): response = self.client.connected_environments_dapr_components.get( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,18 +45,20 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): - response = self.client.connected_environments_dapr_components.create_or_update( + def test_connected_environments_dapr_components_begin_create_or_update(self, resource_group): + response = self.client.connected_environments_dapr_components.begin_create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", dapr_component_envelope={ "componentType": "str", + "deploymentErrors": "str", "id": "str", "ignoreErrors": False, "initTimeout": "str", "metadata": [{"name": "str", "secretRef": "str", "value": "str"}], "name": "str", + "provisioningState": "str", "scopes": ["str"], "secretStoreComponent": "str", "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], @@ -74,33 +76,33 @@ def test_create_or_update(self, resource_group): "type": "str", "version": "str", }, - api_version="2024-08-02-preview", - ) + api_version="2025-02-02-preview", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): - response = self.client.connected_environments_dapr_components.delete( + def test_connected_environments_dapr_components_begin_delete(self, resource_group): + response = self.client.connected_environments_dapr_components.begin_delete( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", - ) + api_version="2025-02-02-preview", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_secrets(self, resource_group): + def test_connected_environments_dapr_components_list_secrets(self, resource_group): response = self.client.connected_environments_dapr_components.list_secrets( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations_async.py index 1c70aa13e458..e766bb570e54 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_connected_environments_dapr_components_list(self, resource_group): response = self.client.connected_environments_dapr_components.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_connected_environments_dapr_components_get(self, resource_group): response = await self.client.connected_environments_dapr_components.get( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,62 +46,68 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): - response = await self.client.connected_environments_dapr_components.create_or_update( - resource_group_name=resource_group.name, - connected_environment_name="str", - component_name="str", - dapr_component_envelope={ - "componentType": "str", - "id": "str", - "ignoreErrors": False, - "initTimeout": "str", - "metadata": [{"name": "str", "secretRef": "str", "value": "str"}], - "name": "str", - "scopes": ["str"], - "secretStoreComponent": "str", - "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], - "serviceComponentBind": [ - {"metadata": {"name": "str", "value": "str"}, "name": "str", "serviceId": "str"} - ], - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", + async def test_connected_environments_dapr_components_begin_create_or_update(self, resource_group): + response = await ( + await self.client.connected_environments_dapr_components.begin_create_or_update( + resource_group_name=resource_group.name, + connected_environment_name="str", + component_name="str", + dapr_component_envelope={ + "componentType": "str", + "deploymentErrors": "str", + "id": "str", + "ignoreErrors": False, + "initTimeout": "str", + "metadata": [{"name": "str", "secretRef": "str", "value": "str"}], + "name": "str", + "provisioningState": "str", + "scopes": ["str"], + "secretStoreComponent": "str", + "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], + "serviceComponentBind": [ + {"metadata": {"name": "str", "value": "str"}, "name": "str", "serviceId": "str"} + ], + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + "version": "str", }, - "type": "str", - "version": "str", - }, - api_version="2024-08-02-preview", - ) + api_version="2025-02-02-preview", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): - response = await self.client.connected_environments_dapr_components.delete( - resource_group_name=resource_group.name, - connected_environment_name="str", - component_name="str", - api_version="2024-08-02-preview", - ) + async def test_connected_environments_dapr_components_begin_delete(self, resource_group): + response = await ( + await self.client.connected_environments_dapr_components.begin_delete( + resource_group_name=resource_group.name, + connected_environment_name="str", + component_name="str", + api_version="2025-02-02-preview", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_secrets(self, resource_group): + async def test_connected_environments_dapr_components_list_secrets(self, resource_group): response = await self.client.connected_environments_dapr_components.list_secrets( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations.py index d8d65eaeb645..bd1021c358e0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_connected_environments_list_by_subscription(self, resource_group): response = self.client.connected_environments.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_connected_environments_list_by_resource_group(self, resource_group): response = self.client.connected_environments.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +41,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_connected_environments_get(self, resource_group): response = self.client.connected_environments.get( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -53,7 +53,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_connected_environments_begin_create_or_update(self, resource_group): response = self.client.connected_environments.begin_create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", @@ -88,7 +88,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -96,11 +96,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_connected_environments_begin_delete(self, resource_group): response = self.client.connected_environments.begin_delete( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -108,11 +108,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_connected_environments_update(self, resource_group): response = self.client.connected_environments.update( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -120,12 +120,12 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_check_name_availability(self, resource_group): + def test_connected_environments_check_name_availability(self, resource_group): response = self.client.connected_environments.check_name_availability( resource_group_name=resource_group.name, connected_environment_name="str", check_name_availability_request={"name": "str", "type": "str"}, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations_async.py index 20b583aecca8..866e62258b9d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_connected_environments_list_by_subscription(self, resource_group): response = self.client.connected_environments.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_connected_environments_list_by_resource_group(self, resource_group): response = self.client.connected_environments.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,11 +42,11 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_connected_environments_get(self, resource_group): response = await self.client.connected_environments.get( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -54,7 +54,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_connected_environments_begin_create_or_update(self, resource_group): response = await ( await self.client.connected_environments.begin_create_or_update( resource_group_name=resource_group.name, @@ -90,7 +90,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -99,12 +99,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_connected_environments_begin_delete(self, resource_group): response = await ( await self.client.connected_environments.begin_delete( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -113,11 +113,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_connected_environments_update(self, resource_group): response = await self.client.connected_environments.update( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -125,12 +125,12 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_check_name_availability(self, resource_group): + async def test_connected_environments_check_name_availability(self, resource_group): response = await self.client.connected_environments.check_name_availability( resource_group_name=resource_group.name, connected_environment_name="str", check_name_availability_request={"name": "str", "type": "str"}, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations.py index 9d23204d77e3..e5704f19a53a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_connected_environments_storages_list(self, resource_group): response = self.client.connected_environments_storages.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_connected_environments_storages_get(self, resource_group): response = self.client.connected_environments_storages.get( resource_group_name=resource_group.name, connected_environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,8 +45,8 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): - response = self.client.connected_environments_storages.create_or_update( + def test_connected_environments_storages_begin_create_or_update(self, resource_group): + response = self.client.connected_environments_storages.begin_create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", storage_name="str", @@ -54,7 +54,15 @@ def test_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"}, + "azureFile": { + "accessMode": "str", + "accountKey": "str", + "accountKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, + "accountName": "str", + "shareName": "str", + }, + "deploymentErrors": "str", + "provisioningState": "str", "smb": { "accessMode": "str", "domain": "str", @@ -74,21 +82,21 @@ def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", - ) + api_version="2025-02-02-preview", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): - response = self.client.connected_environments_storages.delete( + def test_connected_environments_storages_begin_delete(self, resource_group): + response = self.client.connected_environments_storages.begin_delete( resource_group_name=resource_group.name, connected_environment_name="str", storage_name="str", - api_version="2024-08-02-preview", - ) + api_version="2025-02-02-preview", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations_async.py index 2f61ad4ecc5a..78f646b8b5ca 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_connected_environments_storages_list(self, resource_group): response = await self.client.connected_environments_storages.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_connected_environments_storages_get(self, resource_group): response = await self.client.connected_environments_storages.get( resource_group_name=resource_group.name, connected_environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,50 +46,62 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): - response = await self.client.connected_environments_storages.create_or_update( - resource_group_name=resource_group.name, - connected_environment_name="str", - storage_name="str", - storage_envelope={ - "id": "str", - "name": "str", - "properties": { - "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"}, - "smb": { - "accessMode": "str", - "domain": "str", - "host": "str", - "password": "str", - "shareName": "str", - "username": "str", + async def test_connected_environments_storages_begin_create_or_update(self, resource_group): + response = await ( + await self.client.connected_environments_storages.begin_create_or_update( + resource_group_name=resource_group.name, + connected_environment_name="str", + storage_name="str", + storage_envelope={ + "id": "str", + "name": "str", + "properties": { + "azureFile": { + "accessMode": "str", + "accountKey": "str", + "accountKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, + "accountName": "str", + "shareName": "str", + }, + "deploymentErrors": "str", + "provisioningState": "str", + "smb": { + "accessMode": "str", + "domain": "str", + "host": "str", + "password": "str", + "shareName": "str", + "username": "str", + }, }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", }, - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2024-08-02-preview", - ) + api_version="2025-02-02-preview", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): - response = await self.client.connected_environments_storages.delete( - resource_group_name=resource_group.name, - connected_environment_name="str", - storage_name="str", - api_version="2024-08-02-preview", - ) + async def test_connected_environments_storages_begin_delete(self, resource_group): + response = await ( + await self.client.connected_environments_storages.begin_delete( + resource_group_name=resource_group.name, + connected_environment_name="str", + storage_name="str", + api_version="2025-02-02-preview", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations.py index a05430f40e0d..7c49ea9ef6d3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_container_app(self, resource_group): + def test_container_apps_auth_configs_list_by_container_app(self, resource_group): response = self.client.container_apps_auth_configs.list_by_container_app( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_by_container_app(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_container_apps_auth_configs_get(self, resource_group): response = self.client.container_apps_auth_configs.get( resource_group_name=resource_group.name, container_app_name="str", auth_config_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_container_apps_auth_configs_create_or_update(self, resource_group): response = self.client.container_apps_auth_configs.create_or_update( resource_group_name=resource_group.name, container_app_name="str", @@ -144,7 +144,12 @@ def test_create_or_update(self, resource_group): "preserveUrlFragmentsForLogins": bool, "routes": {"logoutEndpoint": "str"}, "tokenStore": { - "azureBlobStorage": {"sasUrlSettingName": "str"}, + "azureBlobStorage": { + "blobContainerUri": "str", + "clientId": "str", + "managedIdentityResourceId": "str", + "sasUrlSettingName": "str", + }, "enabled": bool, "tokenRefreshExtensionHours": 0.0, }, @@ -161,7 +166,7 @@ def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -169,12 +174,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_container_apps_auth_configs_delete(self, resource_group): response = self.client.container_apps_auth_configs.delete( resource_group_name=resource_group.name, container_app_name="str", auth_config_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations_async.py index a5de3d34523f..b209ccacb5ed 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_container_app(self, resource_group): + async def test_container_apps_auth_configs_list_by_container_app(self, resource_group): response = self.client.container_apps_auth_configs.list_by_container_app( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_by_container_app(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_container_apps_auth_configs_get(self, resource_group): response = await self.client.container_apps_auth_configs.get( resource_group_name=resource_group.name, container_app_name="str", auth_config_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_container_apps_auth_configs_create_or_update(self, resource_group): response = await self.client.container_apps_auth_configs.create_or_update( resource_group_name=resource_group.name, container_app_name="str", @@ -145,7 +145,12 @@ async def test_create_or_update(self, resource_group): "preserveUrlFragmentsForLogins": bool, "routes": {"logoutEndpoint": "str"}, "tokenStore": { - "azureBlobStorage": {"sasUrlSettingName": "str"}, + "azureBlobStorage": { + "blobContainerUri": "str", + "clientId": "str", + "managedIdentityResourceId": "str", + "sasUrlSettingName": "str", + }, "enabled": bool, "tokenRefreshExtensionHours": 0.0, }, @@ -162,7 +167,7 @@ async def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -170,12 +175,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_container_apps_auth_configs_delete(self, resource_group): response = await self.client.container_apps_auth_configs.delete( resource_group_name=resource_group.name, container_app_name="str", auth_config_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_by_container_app_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_by_container_app_operations.py index de15466e9fb8..8754339fabb3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_by_container_app_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_by_container_app_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_container_apps_builds_by_container_app_list(self, resource_group): response = self.client.container_apps_builds_by_container_app.list( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_by_container_app_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_by_container_app_operations_async.py index 88f9aa60204e..dfec2db327be 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_by_container_app_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_by_container_app_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_container_apps_builds_by_container_app_list(self, resource_group): response = self.client.container_apps_builds_by_container_app.list( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_operations.py index b401d0208703..d660bc7e2e6c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_container_apps_builds_get(self, resource_group): response = self.client.container_apps_builds.get( resource_group_name=resource_group.name, container_app_name="str", build_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_container_apps_builds_begin_delete(self, resource_group): response = self.client.container_apps_builds.begin_delete( resource_group_name=resource_group.name, container_app_name="str", build_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_operations_async.py index d3686d69e48e..18f91650fe74 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_builds_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_container_apps_builds_get(self, resource_group): response = await self.client.container_apps_builds.get( resource_group_name=resource_group.name, container_app_name="str", build_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -34,13 +34,13 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_container_apps_builds_begin_delete(self, resource_group): response = await ( await self.client.container_apps_builds.begin_delete( resource_group_name=resource_group.name, container_app_name="str", build_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations.py index 6feb281ecca7..6e80aa8ee556 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_detectors(self, resource_group): + def test_container_apps_diagnostics_list_detectors(self, resource_group): response = self.client.container_apps_diagnostics.list_detectors( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_detector(self, resource_group): + def test_container_apps_diagnostics_get_detector(self, resource_group): response = self.client.container_apps_diagnostics.get_detector( resource_group_name=resource_group.name, container_app_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,11 +45,11 @@ def test_get_detector(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_revisions(self, resource_group): + def test_container_apps_diagnostics_list_revisions(self, resource_group): response = self.client.container_apps_diagnostics.list_revisions( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -57,12 +57,12 @@ def test_list_revisions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_revision(self, resource_group): + def test_container_apps_diagnostics_get_revision(self, resource_group): response = self.client.container_apps_diagnostics.get_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -70,11 +70,11 @@ def test_get_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_root(self, resource_group): + def test_container_apps_diagnostics_get_root(self, resource_group): response = self.client.container_apps_diagnostics.get_root( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations_async.py index 31469c25d996..29715fc18134 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_detectors(self, resource_group): + async def test_container_apps_diagnostics_list_detectors(self, resource_group): response = self.client.container_apps_diagnostics.list_detectors( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_detector(self, resource_group): + async def test_container_apps_diagnostics_get_detector(self, resource_group): response = await self.client.container_apps_diagnostics.get_detector( resource_group_name=resource_group.name, container_app_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,11 +46,11 @@ async def test_get_detector(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_revisions(self, resource_group): + async def test_container_apps_diagnostics_list_revisions(self, resource_group): response = self.client.container_apps_diagnostics.list_revisions( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -58,12 +58,12 @@ async def test_list_revisions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_revision(self, resource_group): + async def test_container_apps_diagnostics_get_revision(self, resource_group): response = await self.client.container_apps_diagnostics.get_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -71,11 +71,11 @@ async def test_get_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_root(self, resource_group): + async def test_container_apps_diagnostics_get_root(self, resource_group): response = await self.client.container_apps_diagnostics.get_root( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_label_history_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_label_history_operations.py new file mode 100644 index 000000000000..6f4e511ec807 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_label_history_operations.py @@ -0,0 +1,57 @@ +# 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 pytest +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestContainerAppsAPIContainerAppsLabelHistoryOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ContainerAppsAPIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_container_apps_label_history_list_label_history(self, resource_group): + response = self.client.container_apps_label_history.list_label_history( + resource_group_name=resource_group.name, + container_app_name="str", + api_version="2025-02-02-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_container_apps_label_history_get_label_history(self, resource_group): + response = self.client.container_apps_label_history.get_label_history( + resource_group_name=resource_group.name, + container_app_name="str", + label_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_container_apps_label_history_delete_label_history(self, resource_group): + response = self.client.container_apps_label_history.delete_label_history( + resource_group_name=resource_group.name, + container_app_name="str", + label_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_label_history_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_label_history_operations_async.py new file mode 100644 index 000000000000..94291d701c13 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_label_history_operations_async.py @@ -0,0 +1,58 @@ +# 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 pytest +from azure.mgmt.appcontainers.aio import ContainerAppsAPIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestContainerAppsAPIContainerAppsLabelHistoryOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ContainerAppsAPIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_container_apps_label_history_list_label_history(self, resource_group): + response = self.client.container_apps_label_history.list_label_history( + resource_group_name=resource_group.name, + container_app_name="str", + api_version="2025-02-02-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_container_apps_label_history_get_label_history(self, resource_group): + response = await self.client.container_apps_label_history.get_label_history( + resource_group_name=resource_group.name, + container_app_name="str", + label_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_container_apps_label_history_delete_label_history(self, resource_group): + response = await self.client.container_apps_label_history.delete_label_history( + resource_group_name=resource_group.name, + container_app_name="str", + label_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations.py index 990c849a6efc..18d7f0fc5616 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_container_apps_list_by_subscription(self, resource_group): response = self.client.container_apps.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_container_apps_list_by_resource_group(self, resource_group): response = self.client.container_apps.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +41,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_container_apps_get(self, resource_group): response = self.client.container_apps.get( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -53,7 +53,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_container_apps_begin_create_or_update(self, resource_group): response = self.client.container_apps.begin_create_or_update( resource_group_name=resource_group.name, container_app_name="str", @@ -62,6 +62,13 @@ def test_begin_create_or_update(self, resource_group): "configuration": { "activeRevisionsMode": "Single", "dapr": { + "appHealth": { + "enabled": bool, + "path": "str", + "probeIntervalSeconds": 0, + "probeTimeoutMilliseconds": 0, + "threshold": 0, + }, "appId": "str", "appPort": 0, "appProtocol": "http", @@ -70,8 +77,9 @@ def test_begin_create_or_update(self, resource_group): "httpMaxRequestSize": 0, "httpReadBufferSize": 0, "logLevel": "str", + "maxConcurrency": 0, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], + "identitySettings": [{"identity": "str", "lifecycle": "str"}], "ingress": { "additionalPortMappings": [{"external": bool, "targetPort": 0, "exposedPort": 0}], "allowInsecure": False, @@ -99,6 +107,7 @@ def test_begin_create_or_update(self, resource_group): }, "maxInactiveRevisions": 0, "registries": [{"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"}], + "revisionTransitionThreshold": 0, "runtime": { "dotnet": {"autoConfigureDataProtection": bool}, "java": { @@ -111,6 +120,7 @@ def test_begin_create_or_update(self, resource_group): }, "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], "service": {"type": "str"}, + "targetLabel": "str", }, "customDomainVerificationId": "str", "deploymentErrors": "str", @@ -134,6 +144,7 @@ def test_begin_create_or_update(self, resource_group): "outboundIpAddresses": ["str"], "patchingConfiguration": {"patchingMode": "str"}, "provisioningState": "str", + "runningStatus": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -171,7 +182,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", } ], - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -183,7 +194,7 @@ def test_begin_create_or_update(self, resource_group): "image": "str", "imageType": "str", "name": "str", - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -239,7 +250,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -247,11 +258,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_container_apps_begin_delete(self, resource_group): response = self.client.container_apps.begin_delete( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -259,7 +270,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_container_apps_begin_update(self, resource_group): response = self.client.container_apps.begin_update( resource_group_name=resource_group.name, container_app_name="str", @@ -268,6 +279,13 @@ def test_begin_update(self, resource_group): "configuration": { "activeRevisionsMode": "Single", "dapr": { + "appHealth": { + "enabled": bool, + "path": "str", + "probeIntervalSeconds": 0, + "probeTimeoutMilliseconds": 0, + "threshold": 0, + }, "appId": "str", "appPort": 0, "appProtocol": "http", @@ -276,8 +294,9 @@ def test_begin_update(self, resource_group): "httpMaxRequestSize": 0, "httpReadBufferSize": 0, "logLevel": "str", + "maxConcurrency": 0, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], + "identitySettings": [{"identity": "str", "lifecycle": "str"}], "ingress": { "additionalPortMappings": [{"external": bool, "targetPort": 0, "exposedPort": 0}], "allowInsecure": False, @@ -305,6 +324,7 @@ def test_begin_update(self, resource_group): }, "maxInactiveRevisions": 0, "registries": [{"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"}], + "revisionTransitionThreshold": 0, "runtime": { "dotnet": {"autoConfigureDataProtection": bool}, "java": { @@ -317,6 +337,7 @@ def test_begin_update(self, resource_group): }, "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], "service": {"type": "str"}, + "targetLabel": "str", }, "customDomainVerificationId": "str", "deploymentErrors": "str", @@ -340,6 +361,7 @@ def test_begin_update(self, resource_group): "outboundIpAddresses": ["str"], "patchingConfiguration": {"patchingMode": "str"}, "provisioningState": "str", + "runningStatus": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -377,7 +399,7 @@ def test_begin_update(self, resource_group): "type": "str", } ], - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -389,7 +411,7 @@ def test_begin_update(self, resource_group): "image": "str", "imageType": "str", "name": "str", - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -445,7 +467,7 @@ def test_begin_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -453,11 +475,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_custom_host_name_analysis(self, resource_group): + def test_container_apps_list_custom_host_name_analysis(self, resource_group): response = self.client.container_apps.list_custom_host_name_analysis( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -465,11 +487,11 @@ def test_list_custom_host_name_analysis(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_secrets(self, resource_group): + def test_container_apps_list_secrets(self, resource_group): response = self.client.container_apps.list_secrets( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -477,11 +499,11 @@ def test_list_secrets(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_auth_token(self, resource_group): + def test_container_apps_get_auth_token(self, resource_group): response = self.client.container_apps.get_auth_token( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -489,11 +511,11 @@ def test_get_auth_token(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_start(self, resource_group): + def test_container_apps_begin_start(self, resource_group): response = self.client.container_apps.begin_start( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -501,11 +523,11 @@ def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_stop(self, resource_group): + def test_container_apps_begin_stop(self, resource_group): response = self.client.container_apps.begin_stop( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations_async.py index 79bf6b517286..1039411fb3bc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_container_apps_list_by_subscription(self, resource_group): response = self.client.container_apps.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_container_apps_list_by_resource_group(self, resource_group): response = self.client.container_apps.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,11 +42,11 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_container_apps_get(self, resource_group): response = await self.client.container_apps.get( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -54,7 +54,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_container_apps_begin_create_or_update(self, resource_group): response = await ( await self.client.container_apps.begin_create_or_update( resource_group_name=resource_group.name, @@ -64,6 +64,13 @@ async def test_begin_create_or_update(self, resource_group): "configuration": { "activeRevisionsMode": "Single", "dapr": { + "appHealth": { + "enabled": bool, + "path": "str", + "probeIntervalSeconds": 0, + "probeTimeoutMilliseconds": 0, + "threshold": 0, + }, "appId": "str", "appPort": 0, "appProtocol": "http", @@ -72,8 +79,9 @@ async def test_begin_create_or_update(self, resource_group): "httpMaxRequestSize": 0, "httpReadBufferSize": 0, "logLevel": "str", + "maxConcurrency": 0, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], + "identitySettings": [{"identity": "str", "lifecycle": "str"}], "ingress": { "additionalPortMappings": [{"external": bool, "targetPort": 0, "exposedPort": 0}], "allowInsecure": False, @@ -103,6 +111,7 @@ async def test_begin_create_or_update(self, resource_group): "registries": [ {"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"} ], + "revisionTransitionThreshold": 0, "runtime": { "dotnet": {"autoConfigureDataProtection": bool}, "java": { @@ -115,6 +124,7 @@ async def test_begin_create_or_update(self, resource_group): }, "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], "service": {"type": "str"}, + "targetLabel": "str", }, "customDomainVerificationId": "str", "deploymentErrors": "str", @@ -138,6 +148,7 @@ async def test_begin_create_or_update(self, resource_group): "outboundIpAddresses": ["str"], "patchingConfiguration": {"patchingMode": "str"}, "provisioningState": "str", + "runningStatus": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -175,7 +186,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", } ], - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -187,7 +198,7 @@ async def test_begin_create_or_update(self, resource_group): "image": "str", "imageType": "str", "name": "str", - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -243,7 +254,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -252,12 +263,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_container_apps_begin_delete(self, resource_group): response = await ( await self.client.container_apps.begin_delete( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -266,7 +277,7 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_container_apps_begin_update(self, resource_group): response = await ( await self.client.container_apps.begin_update( resource_group_name=resource_group.name, @@ -276,6 +287,13 @@ async def test_begin_update(self, resource_group): "configuration": { "activeRevisionsMode": "Single", "dapr": { + "appHealth": { + "enabled": bool, + "path": "str", + "probeIntervalSeconds": 0, + "probeTimeoutMilliseconds": 0, + "threshold": 0, + }, "appId": "str", "appPort": 0, "appProtocol": "http", @@ -284,8 +302,9 @@ async def test_begin_update(self, resource_group): "httpMaxRequestSize": 0, "httpReadBufferSize": 0, "logLevel": "str", + "maxConcurrency": 0, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], + "identitySettings": [{"identity": "str", "lifecycle": "str"}], "ingress": { "additionalPortMappings": [{"external": bool, "targetPort": 0, "exposedPort": 0}], "allowInsecure": False, @@ -315,6 +334,7 @@ async def test_begin_update(self, resource_group): "registries": [ {"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"} ], + "revisionTransitionThreshold": 0, "runtime": { "dotnet": {"autoConfigureDataProtection": bool}, "java": { @@ -327,6 +347,7 @@ async def test_begin_update(self, resource_group): }, "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], "service": {"type": "str"}, + "targetLabel": "str", }, "customDomainVerificationId": "str", "deploymentErrors": "str", @@ -350,6 +371,7 @@ async def test_begin_update(self, resource_group): "outboundIpAddresses": ["str"], "patchingConfiguration": {"patchingMode": "str"}, "provisioningState": "str", + "runningStatus": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -387,7 +409,7 @@ async def test_begin_update(self, resource_group): "type": "str", } ], - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -399,7 +421,7 @@ async def test_begin_update(self, resource_group): "image": "str", "imageType": "str", "name": "str", - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -455,7 +477,7 @@ async def test_begin_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -464,11 +486,11 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_custom_host_name_analysis(self, resource_group): + async def test_container_apps_list_custom_host_name_analysis(self, resource_group): response = await self.client.container_apps.list_custom_host_name_analysis( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -476,11 +498,11 @@ async def test_list_custom_host_name_analysis(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_secrets(self, resource_group): + async def test_container_apps_list_secrets(self, resource_group): response = await self.client.container_apps.list_secrets( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -488,11 +510,11 @@ async def test_list_secrets(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_auth_token(self, resource_group): + async def test_container_apps_get_auth_token(self, resource_group): response = await self.client.container_apps.get_auth_token( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -500,12 +522,12 @@ async def test_get_auth_token(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_start(self, resource_group): + async def test_container_apps_begin_start(self, resource_group): response = await ( await self.client.container_apps.begin_start( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -514,12 +536,12 @@ async def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_stop(self, resource_group): + async def test_container_apps_begin_stop(self, resource_group): response = await ( await self.client.container_apps.begin_stop( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_patches_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_patches_operations.py index 066218350cda..170f011c59ea 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_patches_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_patches_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_container_app(self, resource_group): + def test_container_apps_patches_list_by_container_app(self, resource_group): response = self.client.container_apps_patches.list_by_container_app( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_by_container_app(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_container_apps_patches_get(self, resource_group): response = self.client.container_apps_patches.get( resource_group_name=resource_group.name, container_app_name="str", patch_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,12 +45,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_container_apps_patches_begin_delete(self, resource_group): response = self.client.container_apps_patches.begin_delete( resource_group_name=resource_group.name, container_app_name="str", patch_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -58,13 +58,13 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_skip_configure(self, resource_group): + def test_container_apps_patches_begin_skip_configure(self, resource_group): response = self.client.container_apps_patches.begin_skip_configure( resource_group_name=resource_group.name, container_app_name="str", patch_name="str", patch_skip_config={"skip": bool}, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,12 +72,12 @@ def test_begin_skip_configure(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_apply(self, resource_group): + def test_container_apps_patches_begin_apply(self, resource_group): response = self.client.container_apps_patches.begin_apply( resource_group_name=resource_group.name, container_app_name="str", patch_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_patches_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_patches_operations_async.py index ceffcba02976..f978d2fc228a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_patches_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_patches_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_container_app(self, resource_group): + async def test_container_apps_patches_list_by_container_app(self, resource_group): response = self.client.container_apps_patches.list_by_container_app( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_by_container_app(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_container_apps_patches_get(self, resource_group): response = await self.client.container_apps_patches.get( resource_group_name=resource_group.name, container_app_name="str", patch_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,13 +46,13 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_container_apps_patches_begin_delete(self, resource_group): response = await ( await self.client.container_apps_patches.begin_delete( resource_group_name=resource_group.name, container_app_name="str", patch_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -61,14 +61,14 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_skip_configure(self, resource_group): + async def test_container_apps_patches_begin_skip_configure(self, resource_group): response = await ( await self.client.container_apps_patches.begin_skip_configure( resource_group_name=resource_group.name, container_app_name="str", patch_name="str", patch_skip_config={"skip": bool}, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -77,13 +77,13 @@ async def test_begin_skip_configure(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_apply(self, resource_group): + async def test_container_apps_patches_begin_apply(self, resource_group): response = await ( await self.client.container_apps_patches.begin_apply( resource_group_name=resource_group.name, container_app_name="str", patch_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations.py index 2a146342491d..cbdac4a2e1de 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_replica(self, resource_group): + def test_container_apps_revision_replicas_get_replica(self, resource_group): response = self.client.container_apps_revision_replicas.get_replica( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", replica_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -34,12 +34,12 @@ def test_get_replica(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_replicas(self, resource_group): + def test_container_apps_revision_replicas_list_replicas(self, resource_group): response = self.client.container_apps_revision_replicas.list_replicas( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations_async.py index 2057852c3796..e4a72eefdd69 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_replica(self, resource_group): + async def test_container_apps_revision_replicas_get_replica(self, resource_group): response = await self.client.container_apps_revision_replicas.get_replica( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", replica_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -35,12 +35,12 @@ async def test_get_replica(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_replicas(self, resource_group): + async def test_container_apps_revision_replicas_list_replicas(self, resource_group): response = await self.client.container_apps_revision_replicas.list_replicas( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations.py index 94d92dbc0bfb..cf221fdc7812 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_revisions(self, resource_group): + def test_container_apps_revisions_list_revisions(self, resource_group): response = self.client.container_apps_revisions.list_revisions( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_revisions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_revision(self, resource_group): + def test_container_apps_revisions_get_revision(self, resource_group): response = self.client.container_apps_revisions.get_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,12 +45,12 @@ def test_get_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_activate_revision(self, resource_group): + def test_container_apps_revisions_activate_revision(self, resource_group): response = self.client.container_apps_revisions.activate_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -58,12 +58,12 @@ def test_activate_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_deactivate_revision(self, resource_group): + def test_container_apps_revisions_deactivate_revision(self, resource_group): response = self.client.container_apps_revisions.deactivate_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -71,12 +71,12 @@ def test_deactivate_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_restart_revision(self, resource_group): + def test_container_apps_revisions_restart_revision(self, resource_group): response = self.client.container_apps_revisions.restart_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations_async.py index a1947378e9ec..b6e5f60a3b33 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_revisions(self, resource_group): + async def test_container_apps_revisions_list_revisions(self, resource_group): response = self.client.container_apps_revisions.list_revisions( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_revisions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_revision(self, resource_group): + async def test_container_apps_revisions_get_revision(self, resource_group): response = await self.client.container_apps_revisions.get_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,12 +46,12 @@ async def test_get_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_activate_revision(self, resource_group): + async def test_container_apps_revisions_activate_revision(self, resource_group): response = await self.client.container_apps_revisions.activate_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -59,12 +59,12 @@ async def test_activate_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_deactivate_revision(self, resource_group): + async def test_container_apps_revisions_deactivate_revision(self, resource_group): response = await self.client.container_apps_revisions.deactivate_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -72,12 +72,12 @@ async def test_deactivate_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_restart_revision(self, resource_group): + async def test_container_apps_revisions_restart_revision(self, resource_group): response = await self.client.container_apps_revisions.restart_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_session_pools_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_session_pools_operations.py index 10922dbeb837..212850213b19 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_session_pools_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_session_pools_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_container_apps_session_pools_list_by_subscription(self, resource_group): response = self.client.container_apps_session_pools.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_container_apps_session_pools_list_by_resource_group(self, resource_group): response = self.client.container_apps_session_pools.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +41,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_container_apps_session_pools_get(self, resource_group): response = self.client.container_apps_session_pools.get( resource_group_name=resource_group.name, session_pool_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -53,7 +53,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_container_apps_session_pools_begin_create_or_update(self, resource_group): response = self.client.container_apps_session_pools.begin_create_or_update( resource_group_name=resource_group.name, session_pool_name="str", @@ -82,6 +82,13 @@ def test_begin_create_or_update(self, resource_group): "dynamicPoolConfiguration": {"cooldownPeriodInSeconds": 0, "executionType": "str"}, "environmentId": "str", "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "managedIdentitySettings": [{"identity": "str", "lifecycle": "str"}], "name": "str", "nodeCount": 0, "poolManagementEndpoint": "str", @@ -101,7 +108,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -109,7 +116,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_container_apps_session_pools_begin_update(self, resource_group): response = self.client.container_apps_session_pools.begin_update( resource_group_name=resource_group.name, session_pool_name="str", @@ -134,11 +141,17 @@ def test_begin_update(self, resource_group): }, }, "dynamicPoolConfiguration": {"cooldownPeriodInSeconds": 0, "executionType": "str"}, + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "scaleConfiguration": {"maxConcurrentSessions": 0, "readySessionInstances": 0}, "secrets": [{"name": "str", "value": "str"}], "sessionNetworkConfiguration": {"status": "str"}, }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -146,11 +159,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_container_apps_session_pools_begin_delete(self, resource_group): response = self.client.container_apps_session_pools.begin_delete( resource_group_name=resource_group.name, session_pool_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_session_pools_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_session_pools_operations_async.py index e621004b8fad..316d7e9453b5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_session_pools_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_session_pools_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_container_apps_session_pools_list_by_subscription(self, resource_group): response = self.client.container_apps_session_pools.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_container_apps_session_pools_list_by_resource_group(self, resource_group): response = self.client.container_apps_session_pools.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,11 +42,11 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_container_apps_session_pools_get(self, resource_group): response = await self.client.container_apps_session_pools.get( resource_group_name=resource_group.name, session_pool_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -54,7 +54,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_container_apps_session_pools_begin_create_or_update(self, resource_group): response = await ( await self.client.container_apps_session_pools.begin_create_or_update( resource_group_name=resource_group.name, @@ -84,6 +84,13 @@ async def test_begin_create_or_update(self, resource_group): "dynamicPoolConfiguration": {"cooldownPeriodInSeconds": 0, "executionType": "str"}, "environmentId": "str", "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "managedIdentitySettings": [{"identity": "str", "lifecycle": "str"}], "name": "str", "nodeCount": 0, "poolManagementEndpoint": "str", @@ -103,7 +110,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -112,7 +119,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_container_apps_session_pools_begin_update(self, resource_group): response = await ( await self.client.container_apps_session_pools.begin_update( resource_group_name=resource_group.name, @@ -138,11 +145,17 @@ async def test_begin_update(self, resource_group): }, }, "dynamicPoolConfiguration": {"cooldownPeriodInSeconds": 0, "executionType": "str"}, + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "scaleConfiguration": {"maxConcurrentSessions": 0, "readySessionInstances": 0}, "secrets": [{"name": "str", "value": "str"}], "sessionNetworkConfiguration": {"status": "str"}, }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -151,12 +164,12 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_container_apps_session_pools_begin_delete(self, resource_group): response = await ( await self.client.container_apps_session_pools.begin_delete( resource_group_name=resource_group.name, session_pool_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations.py index d1c3378482b3..26c71bf54f7c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_container_app(self, resource_group): + def test_container_apps_source_controls_list_by_container_app(self, resource_group): response = self.client.container_apps_source_controls.list_by_container_app( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_by_container_app(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_container_apps_source_controls_get(self, resource_group): response = self.client.container_apps_source_controls.get( resource_group_name=resource_group.name, container_app_name="str", source_control_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_container_apps_source_controls_begin_create_or_update(self, resource_group): response = self.client.container_apps_source_controls.begin_create_or_update( resource_group_name=resource_group.name, container_app_name="str", @@ -85,7 +85,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -93,12 +93,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_container_apps_source_controls_begin_delete(self, resource_group): response = self.client.container_apps_source_controls.begin_delete( resource_group_name=resource_group.name, container_app_name="str", source_control_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations_async.py index e7bdc90db6a5..1c90da3844f0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_container_app(self, resource_group): + async def test_container_apps_source_controls_list_by_container_app(self, resource_group): response = self.client.container_apps_source_controls.list_by_container_app( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_by_container_app(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_container_apps_source_controls_get(self, resource_group): response = await self.client.container_apps_source_controls.get( resource_group_name=resource_group.name, container_app_name="str", source_control_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_container_apps_source_controls_begin_create_or_update(self, resource_group): response = await ( await self.client.container_apps_source_controls.begin_create_or_update( resource_group_name=resource_group.name, @@ -87,7 +87,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -96,13 +96,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_container_apps_source_controls_begin_delete(self, resource_group): response = await ( await self.client.container_apps_source_controls.begin_delete( resource_group_name=resource_group.name, container_app_name="str", source_control_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_component_resiliency_policies_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_component_resiliency_policies_operations.py index 3147d365491d..557524c79042 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_component_resiliency_policies_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_component_resiliency_policies_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_dapr_component_resiliency_policies_list(self, resource_group): response = self.client.dapr_component_resiliency_policies.list( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,13 +33,13 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_dapr_component_resiliency_policies_get(self, resource_group): response = self.client.dapr_component_resiliency_policies.get( resource_group_name=resource_group.name, environment_name="str", component_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -47,7 +47,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_dapr_component_resiliency_policies_create_or_update(self, resource_group): response = self.client.dapr_component_resiliency_policies.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -82,7 +82,7 @@ def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -90,13 +90,13 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_dapr_component_resiliency_policies_delete(self, resource_group): response = self.client.dapr_component_resiliency_policies.delete( resource_group_name=resource_group.name, environment_name="str", component_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_component_resiliency_policies_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_component_resiliency_policies_operations_async.py index fc06f53a0604..7a5e916fd530 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_component_resiliency_policies_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_component_resiliency_policies_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_dapr_component_resiliency_policies_list(self, resource_group): response = self.client.dapr_component_resiliency_policies.list( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,13 +34,13 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_dapr_component_resiliency_policies_get(self, resource_group): response = await self.client.dapr_component_resiliency_policies.get( resource_group_name=resource_group.name, environment_name="str", component_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -48,7 +48,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_dapr_component_resiliency_policies_create_or_update(self, resource_group): response = await self.client.dapr_component_resiliency_policies.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -83,7 +83,7 @@ async def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -91,13 +91,13 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_dapr_component_resiliency_policies_delete(self, resource_group): response = await self.client.dapr_component_resiliency_policies.delete( resource_group_name=resource_group.name, environment_name="str", component_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations.py index bbd3070f070f..58df866d8cf5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_dapr_components_list(self, resource_group): response = self.client.dapr_components.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_dapr_components_get(self, resource_group): response = self.client.dapr_components.get( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_dapr_components_create_or_update(self, resource_group): response = self.client.dapr_components.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -74,7 +74,7 @@ def test_create_or_update(self, resource_group): "type": "str", "version": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -82,12 +82,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_dapr_components_delete(self, resource_group): response = self.client.dapr_components.delete( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -95,12 +95,12 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_secrets(self, resource_group): + def test_dapr_components_list_secrets(self, resource_group): response = self.client.dapr_components.list_secrets( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations_async.py index 59f9d86584b9..934caa10ee47 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_dapr_components_list(self, resource_group): response = self.client.dapr_components.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_dapr_components_get(self, resource_group): response = await self.client.dapr_components.get( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_dapr_components_create_or_update(self, resource_group): response = await self.client.dapr_components.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -75,7 +75,7 @@ async def test_create_or_update(self, resource_group): "type": "str", "version": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -83,12 +83,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_dapr_components_delete(self, resource_group): response = await self.client.dapr_components.delete( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -96,12 +96,12 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_secrets(self, resource_group): + async def test_dapr_components_list_secrets(self, resource_group): response = await self.client.dapr_components.list_secrets( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_subscriptions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_subscriptions_operations.py index 49197250bc40..a734af35d3df 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_subscriptions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_subscriptions_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_dapr_subscriptions_list(self, resource_group): response = self.client.dapr_subscriptions.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_dapr_subscriptions_get(self, resource_group): response = self.client.dapr_subscriptions.get( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_dapr_subscriptions_create_or_update(self, resource_group): response = self.client.dapr_subscriptions.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -70,7 +70,7 @@ def test_create_or_update(self, resource_group): "topic": "str", "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -78,12 +78,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_dapr_subscriptions_delete(self, resource_group): response = self.client.dapr_subscriptions.delete( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_subscriptions_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_subscriptions_operations_async.py index 9038a3c23b75..c52ba55c3a9e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_subscriptions_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_subscriptions_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_dapr_subscriptions_list(self, resource_group): response = self.client.dapr_subscriptions.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_dapr_subscriptions_get(self, resource_group): response = await self.client.dapr_subscriptions.get( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_dapr_subscriptions_create_or_update(self, resource_group): response = await self.client.dapr_subscriptions.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -71,7 +71,7 @@ async def test_create_or_update(self, resource_group): "topic": "str", "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -79,12 +79,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_dapr_subscriptions_delete(self, resource_group): response = await self.client.dapr_subscriptions.delete( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dot_net_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dot_net_components_operations.py index 72a4e436436f..436a27131b9a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dot_net_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dot_net_components_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_dot_net_components_list(self, resource_group): response = self.client.dot_net_components.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_dot_net_components_get(self, resource_group): response = self.client.dot_net_components.get( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_dot_net_components_begin_create_or_update(self, resource_group): response = self.client.dot_net_components.begin_create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -67,7 +67,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -75,7 +75,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_dot_net_components_begin_update(self, resource_group): response = self.client.dot_net_components.begin_update( resource_group_name=resource_group.name, environment_name="str", @@ -97,7 +97,7 @@ def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -105,12 +105,12 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_dot_net_components_begin_delete(self, resource_group): response = self.client.dot_net_components.begin_delete( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dot_net_components_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dot_net_components_operations_async.py index 1e6a8021baa2..f4731eb3c2fa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dot_net_components_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dot_net_components_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_dot_net_components_list(self, resource_group): response = self.client.dot_net_components.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_dot_net_components_get(self, resource_group): response = await self.client.dot_net_components.get( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_dot_net_components_begin_create_or_update(self, resource_group): response = await ( await self.client.dot_net_components.begin_create_or_update( resource_group_name=resource_group.name, @@ -69,7 +69,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -78,7 +78,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_dot_net_components_begin_update(self, resource_group): response = await ( await self.client.dot_net_components.begin_update( resource_group_name=resource_group.name, @@ -101,7 +101,7 @@ async def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -110,13 +110,13 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_dot_net_components_begin_delete(self, resource_group): response = await ( await self.client.dot_net_components.begin_delete( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_functions_extension_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_functions_extension_operations.py index 743c92817f33..145cf14131d6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_functions_extension_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_functions_extension_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_invoke_functions_host(self, resource_group): + def test_functions_extension_invoke_functions_host(self, resource_group): response = self.client.functions_extension.invoke_functions_host( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", function_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_functions_extension_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_functions_extension_operations_async.py index 7601b17d79b5..cfaf7a6b0f21 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_functions_extension_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_functions_extension_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_invoke_functions_host(self, resource_group): + async def test_functions_extension_invoke_functions_host(self, resource_group): response = await self.client.functions_extension.invoke_functions_host( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", function_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_http_route_config_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_http_route_config_operations.py new file mode 100644 index 000000000000..e78a328e7ffd --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_http_route_config_operations.py @@ -0,0 +1,119 @@ +# 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 pytest +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestContainerAppsAPIHttpRouteConfigOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ContainerAppsAPIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_http_route_config_get(self, resource_group): + response = self.client.http_route_config.get( + resource_group_name=resource_group.name, + environment_name="str", + http_route_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_http_route_config_create_or_update(self, resource_group): + response = self.client.http_route_config.create_or_update( + resource_group_name=resource_group.name, + environment_name="str", + http_route_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_http_route_config_update(self, resource_group): + response = self.client.http_route_config.update( + resource_group_name=resource_group.name, + environment_name="str", + http_route_name="str", + http_route_config_envelope={ + "id": "str", + "name": "str", + "properties": { + "customDomains": [{"name": "str", "bindingType": "str", "certificateId": "str"}], + "fqdn": "str", + "provisioningErrors": [{"message": "str", "timestamp": "2020-02-20 00:00:00"}], + "provisioningState": "str", + "rules": [ + { + "description": "str", + "routes": [ + { + "action": {"prefixRewrite": "str"}, + "match": { + "caseSensitive": bool, + "path": "str", + "pathSeparatedPrefix": "str", + "prefix": "str", + }, + } + ], + "targets": [{"containerApp": "str", "label": "str", "revision": "str", "weight": 0}], + } + ], + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_http_route_config_delete(self, resource_group): + response = self.client.http_route_config.delete( + resource_group_name=resource_group.name, + environment_name="str", + http_route_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_http_route_config_list(self, resource_group): + response = self.client.http_route_config.list( + resource_group_name=resource_group.name, + environment_name="str", + api_version="2025-02-02-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_http_route_config_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_http_route_config_operations_async.py new file mode 100644 index 000000000000..52164ddf2226 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_http_route_config_operations_async.py @@ -0,0 +1,120 @@ +# 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 pytest +from azure.mgmt.appcontainers.aio import ContainerAppsAPIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestContainerAppsAPIHttpRouteConfigOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ContainerAppsAPIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_http_route_config_get(self, resource_group): + response = await self.client.http_route_config.get( + resource_group_name=resource_group.name, + environment_name="str", + http_route_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_http_route_config_create_or_update(self, resource_group): + response = await self.client.http_route_config.create_or_update( + resource_group_name=resource_group.name, + environment_name="str", + http_route_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_http_route_config_update(self, resource_group): + response = await self.client.http_route_config.update( + resource_group_name=resource_group.name, + environment_name="str", + http_route_name="str", + http_route_config_envelope={ + "id": "str", + "name": "str", + "properties": { + "customDomains": [{"name": "str", "bindingType": "str", "certificateId": "str"}], + "fqdn": "str", + "provisioningErrors": [{"message": "str", "timestamp": "2020-02-20 00:00:00"}], + "provisioningState": "str", + "rules": [ + { + "description": "str", + "routes": [ + { + "action": {"prefixRewrite": "str"}, + "match": { + "caseSensitive": bool, + "path": "str", + "pathSeparatedPrefix": "str", + "prefix": "str", + }, + } + ], + "targets": [{"containerApp": "str", "label": "str", "revision": "str", "weight": 0}], + } + ], + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_http_route_config_delete(self, resource_group): + response = await self.client.http_route_config.delete( + resource_group_name=resource_group.name, + environment_name="str", + http_route_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_http_route_config_list(self, resource_group): + response = self.client.http_route_config.list( + resource_group_name=resource_group.name, + environment_name="str", + api_version="2025-02-02-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_java_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_java_components_operations.py index 3e2beb5bccf3..cf180c7b9af1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_java_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_java_components_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_java_components_list(self, resource_group): response = self.client.java_components.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_java_components_get(self, resource_group): response = self.client.java_components.get( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_java_components_begin_create_or_update(self, resource_group): response = self.client.java_components.begin_create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -64,7 +64,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,7 +72,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_java_components_begin_update(self, resource_group): response = self.client.java_components.begin_update( resource_group_name=resource_group.name, environment_name="str", @@ -91,7 +91,7 @@ def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,12 +99,12 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_java_components_begin_delete(self, resource_group): response = self.client.java_components.begin_delete( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_java_components_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_java_components_operations_async.py index afe090122714..ceb7694d36d9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_java_components_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_java_components_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_java_components_list(self, resource_group): response = self.client.java_components.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_java_components_get(self, resource_group): response = await self.client.java_components.get( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_java_components_begin_create_or_update(self, resource_group): response = await ( await self.client.java_components.begin_create_or_update( resource_group_name=resource_group.name, @@ -66,7 +66,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -75,7 +75,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_java_components_begin_update(self, resource_group): response = await ( await self.client.java_components.begin_update( resource_group_name=resource_group.name, @@ -95,7 +95,7 @@ async def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -104,13 +104,13 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_java_components_begin_delete(self, resource_group): response = await ( await self.client.java_components.begin_delete( resource_group_name=resource_group.name, environment_name="str", name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations.py index c2e31ca66ea3..bb39de112cee 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_jobs_executions_list(self, resource_group): response = self.client.jobs_executions.list( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations_async.py index 3bc443073725..c69a2747dc72 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_jobs_executions_list(self, resource_group): response = self.client.jobs_executions.list( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations.py index 9f8d3be2d07f..0b3528c5fa33 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_detectors(self, resource_group): + def test_jobs_list_detectors(self, resource_group): response = self.client.jobs.list_detectors( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_detector(self, resource_group): + def test_jobs_get_detector(self, resource_group): response = self.client.jobs.get_detector( resource_group_name=resource_group.name, job_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,12 +45,12 @@ def test_get_detector(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_proxy_get(self, resource_group): + def test_jobs_proxy_get(self, resource_group): response = self.client.jobs.proxy_get( resource_group_name=resource_group.name, job_name="str", api_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -58,9 +58,9 @@ def test_proxy_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_jobs_list_by_subscription(self, resource_group): response = self.client.jobs.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -68,10 +68,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_jobs_list_by_resource_group(self, resource_group): response = self.client.jobs.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -79,11 +79,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_jobs_get(self, resource_group): response = self.client.jobs.get( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -91,7 +91,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_jobs_begin_create_or_update(self, resource_group): response = self.client.jobs.begin_create_or_update( resource_group_name=resource_group.name, job_name="str", @@ -118,7 +118,7 @@ def test_begin_create_or_update(self, resource_group): ], }, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], + "identitySettings": [{"identity": "str", "lifecycle": "str"}], "manualTriggerConfig": {"parallelism": 0, "replicaCompletionCount": 0}, "registries": [{"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"}], "replicaRetryLimit": 0, @@ -176,7 +176,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", } ], - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -188,7 +188,7 @@ def test_begin_create_or_update(self, resource_group): "image": "str", "imageType": "str", "name": "str", - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -205,7 +205,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -213,11 +213,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_jobs_begin_delete(self, resource_group): response = self.client.jobs.begin_delete( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -225,7 +225,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_jobs_begin_update(self, resource_group): response = self.client.jobs.begin_update( resource_group_name=resource_group.name, job_name="str", @@ -259,7 +259,7 @@ def test_begin_update(self, resource_group): ], }, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], + "identitySettings": [{"identity": "str", "lifecycle": "str"}], "manualTriggerConfig": {"parallelism": 0, "replicaCompletionCount": 0}, "registries": [ {"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"} @@ -303,7 +303,7 @@ def test_begin_update(self, resource_group): "type": "str", } ], - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -315,7 +315,7 @@ def test_begin_update(self, resource_group): "image": "str", "imageType": "str", "name": "str", - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -332,7 +332,7 @@ def test_begin_update(self, resource_group): }, "tags": {"str": "str"}, }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -340,11 +340,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_start(self, resource_group): + def test_jobs_begin_start(self, resource_group): response = self.client.jobs.begin_start( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -352,12 +352,12 @@ def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_stop_execution(self, resource_group): + def test_jobs_begin_stop_execution(self, resource_group): response = self.client.jobs.begin_stop_execution( resource_group_name=resource_group.name, job_name="str", job_execution_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -365,11 +365,11 @@ def test_begin_stop_execution(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_stop_multiple_executions(self, resource_group): + def test_jobs_begin_stop_multiple_executions(self, resource_group): response = self.client.jobs.begin_stop_multiple_executions( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -377,11 +377,11 @@ def test_begin_stop_multiple_executions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_secrets(self, resource_group): + def test_jobs_list_secrets(self, resource_group): response = self.client.jobs.list_secrets( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -389,11 +389,11 @@ def test_list_secrets(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_resume(self, resource_group): + def test_jobs_begin_resume(self, resource_group): response = self.client.jobs.begin_resume( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -401,11 +401,11 @@ def test_begin_resume(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_suspend(self, resource_group): + def test_jobs_begin_suspend(self, resource_group): response = self.client.jobs.begin_suspend( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations_async.py index 09e16b1e7465..89d7ae875ceb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_detectors(self, resource_group): + async def test_jobs_list_detectors(self, resource_group): response = self.client.jobs.list_detectors( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_detector(self, resource_group): + async def test_jobs_get_detector(self, resource_group): response = await self.client.jobs.get_detector( resource_group_name=resource_group.name, job_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,12 +46,12 @@ async def test_get_detector(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_proxy_get(self, resource_group): + async def test_jobs_proxy_get(self, resource_group): response = await self.client.jobs.proxy_get( resource_group_name=resource_group.name, job_name="str", api_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -59,9 +59,9 @@ async def test_proxy_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_jobs_list_by_subscription(self, resource_group): response = self.client.jobs.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -69,10 +69,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_jobs_list_by_resource_group(self, resource_group): response = self.client.jobs.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -80,11 +80,11 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_jobs_get(self, resource_group): response = await self.client.jobs.get( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -92,7 +92,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_jobs_begin_create_or_update(self, resource_group): response = await ( await self.client.jobs.begin_create_or_update( resource_group_name=resource_group.name, @@ -120,7 +120,7 @@ async def test_begin_create_or_update(self, resource_group): ], }, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], + "identitySettings": [{"identity": "str", "lifecycle": "str"}], "manualTriggerConfig": {"parallelism": 0, "replicaCompletionCount": 0}, "registries": [ {"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"} @@ -184,7 +184,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", } ], - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -196,7 +196,7 @@ async def test_begin_create_or_update(self, resource_group): "image": "str", "imageType": "str", "name": "str", - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -213,7 +213,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -222,12 +222,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_jobs_begin_delete(self, resource_group): response = await ( await self.client.jobs.begin_delete( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -236,7 +236,7 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_jobs_begin_update(self, resource_group): response = await ( await self.client.jobs.begin_update( resource_group_name=resource_group.name, @@ -271,7 +271,7 @@ async def test_begin_update(self, resource_group): ], }, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], + "identitySettings": [{"identity": "str", "lifecycle": "str"}], "manualTriggerConfig": {"parallelism": 0, "replicaCompletionCount": 0}, "registries": [ {"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"} @@ -315,7 +315,7 @@ async def test_begin_update(self, resource_group): "type": "str", } ], - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -327,7 +327,7 @@ async def test_begin_update(self, resource_group): "image": "str", "imageType": "str", "name": "str", - "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, + "resources": {"cpu": 0.0, "ephemeralStorage": "str", "gpu": 0.0, "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], } ], @@ -344,7 +344,7 @@ async def test_begin_update(self, resource_group): }, "tags": {"str": "str"}, }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -353,12 +353,12 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_start(self, resource_group): + async def test_jobs_begin_start(self, resource_group): response = await ( await self.client.jobs.begin_start( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -367,13 +367,13 @@ async def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_stop_execution(self, resource_group): + async def test_jobs_begin_stop_execution(self, resource_group): response = await ( await self.client.jobs.begin_stop_execution( resource_group_name=resource_group.name, job_name="str", job_execution_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -382,12 +382,12 @@ async def test_begin_stop_execution(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_stop_multiple_executions(self, resource_group): + async def test_jobs_begin_stop_multiple_executions(self, resource_group): response = await ( await self.client.jobs.begin_stop_multiple_executions( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -396,11 +396,11 @@ async def test_begin_stop_multiple_executions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_secrets(self, resource_group): + async def test_jobs_list_secrets(self, resource_group): response = await self.client.jobs.list_secrets( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -408,12 +408,12 @@ async def test_list_secrets(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_resume(self, resource_group): + async def test_jobs_begin_resume(self, resource_group): response = await ( await self.client.jobs.begin_resume( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -422,12 +422,12 @@ async def test_begin_resume(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_suspend(self, resource_group): + async def test_jobs_begin_suspend(self, resource_group): response = await ( await self.client.jobs.begin_suspend( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_logic_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_logic_apps_operations.py index 1d4536c74063..ef8164581cad 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_logic_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_logic_apps_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_logic_apps_get(self, resource_group): response = self.client.logic_apps.get( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_logic_apps_create_or_update(self, resource_group): response = self.client.logic_apps.create_or_update( resource_group_name=resource_group.name, container_app_name="str", @@ -52,7 +52,7 @@ def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -60,12 +60,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_logic_apps_delete(self, resource_group): response = self.client.logic_apps.delete( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -73,12 +73,12 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_workflows(self, resource_group): + def test_logic_apps_list_workflows(self, resource_group): response = self.client.logic_apps.list_workflows( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -86,13 +86,13 @@ def test_list_workflows(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_workflow(self, resource_group): + def test_logic_apps_get_workflow(self, resource_group): response = self.client.logic_apps.get_workflow( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", workflow_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -100,12 +100,12 @@ def test_get_workflow(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_deploy_workflow_artifacts(self, resource_group): + def test_logic_apps_deploy_workflow_artifacts(self, resource_group): response = self.client.logic_apps.deploy_workflow_artifacts( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -113,12 +113,12 @@ def test_deploy_workflow_artifacts(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_workflows_connections(self, resource_group): + def test_logic_apps_list_workflows_connections(self, resource_group): response = self.client.logic_apps.list_workflows_connections( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -126,14 +126,14 @@ def test_list_workflows_connections(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_invoke(self, resource_group): + def test_logic_apps_invoke(self, resource_group): response = self.client.logic_apps.invoke( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", x_ms_logic_apps_proxy_path="str", x_ms_logic_apps_proxy_method="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_logic_apps_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_logic_apps_operations_async.py index 76a868a54901..015c42cbbedb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_logic_apps_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_logic_apps_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_logic_apps_get(self, resource_group): response = await self.client.logic_apps.get( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_logic_apps_create_or_update(self, resource_group): response = await self.client.logic_apps.create_or_update( resource_group_name=resource_group.name, container_app_name="str", @@ -53,7 +53,7 @@ async def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -61,12 +61,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_logic_apps_delete(self, resource_group): response = await self.client.logic_apps.delete( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -74,12 +74,12 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_workflows(self, resource_group): + async def test_logic_apps_list_workflows(self, resource_group): response = self.client.logic_apps.list_workflows( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -87,13 +87,13 @@ async def test_list_workflows(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_workflow(self, resource_group): + async def test_logic_apps_get_workflow(self, resource_group): response = await self.client.logic_apps.get_workflow( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", workflow_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -101,12 +101,12 @@ async def test_get_workflow(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_deploy_workflow_artifacts(self, resource_group): + async def test_logic_apps_deploy_workflow_artifacts(self, resource_group): response = await self.client.logic_apps.deploy_workflow_artifacts( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -114,12 +114,12 @@ async def test_deploy_workflow_artifacts(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_workflows_connections(self, resource_group): + async def test_logic_apps_list_workflows_connections(self, resource_group): response = await self.client.logic_apps.list_workflows_connections( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -127,14 +127,14 @@ async def test_list_workflows_connections(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_invoke(self, resource_group): + async def test_logic_apps_invoke(self, resource_group): response = await self.client.logic_apps.invoke( resource_group_name=resource_group.name, container_app_name="str", logic_app_name="str", x_ms_logic_apps_proxy_path="str", x_ms_logic_apps_proxy_method="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_maintenance_configurations_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_maintenance_configurations_operations.py new file mode 100644 index 000000000000..37a584beb426 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_maintenance_configurations_operations.py @@ -0,0 +1,84 @@ +# 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 pytest +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestContainerAppsAPIMaintenanceConfigurationsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ContainerAppsAPIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_configurations_list(self, resource_group): + response = self.client.maintenance_configurations.list( + resource_group_name=resource_group.name, + environment_name="str", + api_version="2025-02-02-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_configurations_create_or_update(self, resource_group): + response = self.client.maintenance_configurations.create_or_update( + resource_group_name=resource_group.name, + environment_name="str", + config_name="str", + maintenance_configuration_envelope={ + "id": "str", + "name": "str", + "scheduledEntries": [{"durationHours": 0, "startHourUtc": 0, "weekDay": "str"}], + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_configurations_delete(self, resource_group): + response = self.client.maintenance_configurations.delete( + resource_group_name=resource_group.name, + environment_name="str", + config_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_configurations_get(self, resource_group): + response = self.client.maintenance_configurations.get( + resource_group_name=resource_group.name, + environment_name="str", + config_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_maintenance_configurations_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_maintenance_configurations_operations_async.py new file mode 100644 index 000000000000..870e664e4223 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_maintenance_configurations_operations_async.py @@ -0,0 +1,85 @@ +# 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 pytest +from azure.mgmt.appcontainers.aio import ContainerAppsAPIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestContainerAppsAPIMaintenanceConfigurationsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ContainerAppsAPIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_configurations_list(self, resource_group): + response = self.client.maintenance_configurations.list( + resource_group_name=resource_group.name, + environment_name="str", + api_version="2025-02-02-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_configurations_create_or_update(self, resource_group): + response = await self.client.maintenance_configurations.create_or_update( + resource_group_name=resource_group.name, + environment_name="str", + config_name="str", + maintenance_configuration_envelope={ + "id": "str", + "name": "str", + "scheduledEntries": [{"durationHours": 0, "startHourUtc": 0, "weekDay": "str"}], + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_configurations_delete(self, resource_group): + response = await self.client.maintenance_configurations.delete( + resource_group_name=resource_group.name, + environment_name="str", + config_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_configurations_get(self, resource_group): + response = await self.client.maintenance_configurations.get( + resource_group_name=resource_group.name, + environment_name="str", + config_name="str", + api_version="2025-02-02-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations.py index 15cb79a15a31..dcc23616e9cf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_certificates_get(self, resource_group): response = self.client.managed_certificates.get( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_managed_certificates_begin_create_or_update(self, resource_group): response = self.client.managed_certificates.begin_create_or_update( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -46,12 +46,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_managed_certificates_delete(self, resource_group): response = self.client.managed_certificates.delete( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -59,13 +59,13 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_managed_certificates_update(self, resource_group): response = self.client.managed_certificates.update( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", managed_certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -73,11 +73,11 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_managed_certificates_list(self, resource_group): response = self.client.managed_certificates.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations_async.py index aa2880913e1e..8f3f2bd22ad4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_certificates_get(self, resource_group): response = await self.client.managed_certificates.get( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -34,13 +34,13 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_managed_certificates_begin_create_or_update(self, resource_group): response = await ( await self.client.managed_certificates.begin_create_or_update( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -49,12 +49,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_managed_certificates_delete(self, resource_group): response = await self.client.managed_certificates.delete( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -62,13 +62,13 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_managed_certificates_update(self, resource_group): response = await self.client.managed_certificates.update( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", managed_certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -76,11 +76,11 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_managed_certificates_list(self, resource_group): response = self.client.managed_certificates.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations.py index e99594c282e9..ca6101f73b67 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_detectors(self, resource_group): + def test_managed_environment_diagnostics_list_detectors(self, resource_group): response = self.client.managed_environment_diagnostics.list_detectors( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_detector(self, resource_group): + def test_managed_environment_diagnostics_get_detector(self, resource_group): response = self.client.managed_environment_diagnostics.get_detector( resource_group_name=resource_group.name, environment_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations_async.py index b9e3e94e8464..f6fff69c4b77 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_detectors(self, resource_group): + async def test_managed_environment_diagnostics_list_detectors(self, resource_group): response = await self.client.managed_environment_diagnostics.list_detectors( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_detector(self, resource_group): + async def test_managed_environment_diagnostics_get_detector(self, resource_group): response = await self.client.managed_environment_diagnostics.get_detector( resource_group_name=resource_group.name, environment_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_endpoint_connections_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_endpoint_connections_operations.py index 44b9aa6dbcc2..ad3b4f49d7ae 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_endpoint_connections_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_endpoint_connections_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_managed_environment_private_endpoint_connections_list(self, resource_group): response = self.client.managed_environment_private_endpoint_connections.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_environment_private_endpoint_connections_get(self, resource_group): response = self.client.managed_environment_private_endpoint_connections.get( resource_group_name=resource_group.name, environment_name="str", private_endpoint_connection_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_managed_environment_private_endpoint_connections_begin_create_or_update(self, resource_group): response = self.client.managed_environment_private_endpoint_connections.begin_create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -67,7 +67,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -75,12 +75,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_managed_environment_private_endpoint_connections_begin_delete(self, resource_group): response = self.client.managed_environment_private_endpoint_connections.begin_delete( resource_group_name=resource_group.name, environment_name="str", private_endpoint_connection_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_endpoint_connections_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_endpoint_connections_operations_async.py index ea026b11caf3..53d86ddcc7f4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_endpoint_connections_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_endpoint_connections_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_managed_environment_private_endpoint_connections_list(self, resource_group): response = self.client.managed_environment_private_endpoint_connections.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_environment_private_endpoint_connections_get(self, resource_group): response = await self.client.managed_environment_private_endpoint_connections.get( resource_group_name=resource_group.name, environment_name="str", private_endpoint_connection_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_managed_environment_private_endpoint_connections_begin_create_or_update(self, resource_group): response = await ( await self.client.managed_environment_private_endpoint_connections.begin_create_or_update( resource_group_name=resource_group.name, @@ -73,7 +73,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -82,13 +82,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_managed_environment_private_endpoint_connections_begin_delete(self, resource_group): response = await ( await self.client.managed_environment_private_endpoint_connections.begin_delete( resource_group_name=resource_group.name, environment_name="str", private_endpoint_connection_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_link_resources_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_link_resources_operations.py index 297c7238aa80..dc1565faf80e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_link_resources_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_link_resources_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_managed_environment_private_link_resources_list(self, resource_group): response = self.client.managed_environment_private_link_resources.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_link_resources_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_link_resources_operations_async.py index 74a629c4ff43..673a980203a4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_link_resources_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_private_link_resources_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_managed_environment_private_link_resources_list(self, resource_group): response = self.client.managed_environment_private_link_resources.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations.py index 849c8b722162..55332c0caa58 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_managed_environment_usages_list(self, resource_group): response = self.client.managed_environment_usages.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations_async.py index 92e527da68b4..f4b8f951cb7b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_managed_environment_usages_list(self, resource_group): response = self.client.managed_environment_usages.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations.py index 10da13959b88..36fd756459e4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_root(self, resource_group): + def test_managed_environments_diagnostics_get_root(self, resource_group): response = self.client.managed_environments_diagnostics.get_root( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations_async.py index 62bd4fd73518..6e18d3329379 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_root(self, resource_group): + async def test_managed_environments_diagnostics_get_root(self, resource_group): response = await self.client.managed_environments_diagnostics.get_root( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations.py index ca60ccd51d1a..be08093abe7d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_managed_environments_list_by_subscription(self, resource_group): response = self.client.managed_environments.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_managed_environments_list_by_resource_group(self, resource_group): response = self.client.managed_environments.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +41,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_environments_get(self, resource_group): response = self.client.managed_environments.get( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -53,7 +53,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_managed_environments_begin_create_or_update(self, resource_group): response = self.client.managed_environments.begin_create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -64,6 +64,7 @@ def test_begin_create_or_update(self, resource_group): "destination": "str", "logAnalyticsConfiguration": {"customerId": "str", "dynamicJsonColumns": bool, "sharedKey": "str"}, }, + "availabilityZones": ["str"], "customDomainConfiguration": { "certificateKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, "certificatePassword": "str", @@ -88,6 +89,13 @@ def test_begin_create_or_update(self, resource_group): "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, "infrastructureResourceGroup": "str", + "ingressConfiguration": { + "headerCountLimit": 0, + "requestIdleTimeout": 0, + "scale": {"maxReplicas": 0, "minReplicas": 0}, + "terminationGracePeriodSeconds": 0, + "workloadProfileName": "str", + }, "kedaConfiguration": {"version": "str"}, "kind": "str", "name": "str", @@ -132,6 +140,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", } ], + "privateLinkDefaultDomain": "str", "provisioningState": "str", "publicNetworkAccess": "str", "staticIp": "str", @@ -163,7 +172,7 @@ def test_begin_create_or_update(self, resource_group): ], "zoneRedundant": bool, }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -171,11 +180,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_managed_environments_begin_delete(self, resource_group): response = self.client.managed_environments.begin_delete( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -183,7 +192,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_managed_environments_begin_update(self, resource_group): response = self.client.managed_environments.begin_update( resource_group_name=resource_group.name, environment_name="str", @@ -194,6 +203,7 @@ def test_begin_update(self, resource_group): "destination": "str", "logAnalyticsConfiguration": {"customerId": "str", "dynamicJsonColumns": bool, "sharedKey": "str"}, }, + "availabilityZones": ["str"], "customDomainConfiguration": { "certificateKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, "certificatePassword": "str", @@ -218,6 +228,13 @@ def test_begin_update(self, resource_group): "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, "infrastructureResourceGroup": "str", + "ingressConfiguration": { + "headerCountLimit": 0, + "requestIdleTimeout": 0, + "scale": {"maxReplicas": 0, "minReplicas": 0}, + "terminationGracePeriodSeconds": 0, + "workloadProfileName": "str", + }, "kedaConfiguration": {"version": "str"}, "kind": "str", "name": "str", @@ -262,6 +279,7 @@ def test_begin_update(self, resource_group): "type": "str", } ], + "privateLinkDefaultDomain": "str", "provisioningState": "str", "publicNetworkAccess": "str", "staticIp": "str", @@ -293,7 +311,7 @@ def test_begin_update(self, resource_group): ], "zoneRedundant": bool, }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -301,11 +319,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_auth_token(self, resource_group): + def test_managed_environments_get_auth_token(self, resource_group): response = self.client.managed_environments.get_auth_token( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -313,11 +331,11 @@ def test_get_auth_token(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_workload_profile_states(self, resource_group): + def test_managed_environments_list_workload_profile_states(self, resource_group): response = self.client.managed_environments.list_workload_profile_states( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations_async.py index 822bdeec9d75..6488172d1d4d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_managed_environments_list_by_subscription(self, resource_group): response = self.client.managed_environments.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_managed_environments_list_by_resource_group(self, resource_group): response = self.client.managed_environments.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,11 +42,11 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_environments_get(self, resource_group): response = await self.client.managed_environments.get( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -54,7 +54,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_managed_environments_begin_create_or_update(self, resource_group): response = await ( await self.client.managed_environments.begin_create_or_update( resource_group_name=resource_group.name, @@ -70,6 +70,7 @@ async def test_begin_create_or_update(self, resource_group): "sharedKey": "str", }, }, + "availabilityZones": ["str"], "customDomainConfiguration": { "certificateKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, "certificatePassword": "str", @@ -94,6 +95,13 @@ async def test_begin_create_or_update(self, resource_group): "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, "infrastructureResourceGroup": "str", + "ingressConfiguration": { + "headerCountLimit": 0, + "requestIdleTimeout": 0, + "scale": {"maxReplicas": 0, "minReplicas": 0}, + "terminationGracePeriodSeconds": 0, + "workloadProfileName": "str", + }, "kedaConfiguration": {"version": "str"}, "kind": "str", "name": "str", @@ -138,6 +146,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", } ], + "privateLinkDefaultDomain": "str", "provisioningState": "str", "publicNetworkAccess": "str", "staticIp": "str", @@ -169,7 +178,7 @@ async def test_begin_create_or_update(self, resource_group): ], "zoneRedundant": bool, }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -178,12 +187,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_managed_environments_begin_delete(self, resource_group): response = await ( await self.client.managed_environments.begin_delete( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -192,7 +201,7 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_managed_environments_begin_update(self, resource_group): response = await ( await self.client.managed_environments.begin_update( resource_group_name=resource_group.name, @@ -208,6 +217,7 @@ async def test_begin_update(self, resource_group): "sharedKey": "str", }, }, + "availabilityZones": ["str"], "customDomainConfiguration": { "certificateKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, "certificatePassword": "str", @@ -232,6 +242,13 @@ async def test_begin_update(self, resource_group): "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, "infrastructureResourceGroup": "str", + "ingressConfiguration": { + "headerCountLimit": 0, + "requestIdleTimeout": 0, + "scale": {"maxReplicas": 0, "minReplicas": 0}, + "terminationGracePeriodSeconds": 0, + "workloadProfileName": "str", + }, "kedaConfiguration": {"version": "str"}, "kind": "str", "name": "str", @@ -276,6 +293,7 @@ async def test_begin_update(self, resource_group): "type": "str", } ], + "privateLinkDefaultDomain": "str", "provisioningState": "str", "publicNetworkAccess": "str", "staticIp": "str", @@ -307,7 +325,7 @@ async def test_begin_update(self, resource_group): ], "zoneRedundant": bool, }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -316,11 +334,11 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_auth_token(self, resource_group): + async def test_managed_environments_get_auth_token(self, resource_group): response = await self.client.managed_environments.get_auth_token( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -328,11 +346,11 @@ async def test_get_auth_token(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_workload_profile_states(self, resource_group): + async def test_managed_environments_list_workload_profile_states(self, resource_group): response = self.client.managed_environments.list_workload_profile_states( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations.py index 07d3f3d84dd2..8b6d332d8fc3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_managed_environments_storages_list(self, resource_group): response = self.client.managed_environments_storages.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_environments_storages_get(self, resource_group): response = self.client.managed_environments_storages.get( resource_group_name=resource_group.name, environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_managed_environments_storages_create_or_update(self, resource_group): response = self.client.managed_environments_storages.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -54,7 +54,13 @@ def test_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"}, + "azureFile": { + "accessMode": "str", + "accountKey": "str", + "accountKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, + "accountName": "str", + "shareName": "str", + }, "nfsAzureFile": {"accessMode": "str", "server": "str", "shareName": "str"}, }, "systemData": { @@ -67,7 +73,7 @@ def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -75,12 +81,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_managed_environments_storages_delete(self, resource_group): response = self.client.managed_environments_storages.delete( resource_group_name=resource_group.name, environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations_async.py index 5e6af988708e..cd9c72c1e9f4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_managed_environments_storages_list(self, resource_group): response = await self.client.managed_environments_storages.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_environments_storages_get(self, resource_group): response = await self.client.managed_environments_storages.get( resource_group_name=resource_group.name, environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_managed_environments_storages_create_or_update(self, resource_group): response = await self.client.managed_environments_storages.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -55,7 +55,13 @@ async def test_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"}, + "azureFile": { + "accessMode": "str", + "accountKey": "str", + "accountKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, + "accountName": "str", + "shareName": "str", + }, "nfsAzureFile": {"accessMode": "str", "server": "str", "shareName": "str"}, }, "systemData": { @@ -68,7 +74,7 @@ async def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself @@ -76,12 +82,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_managed_environments_storages_delete(self, resource_group): response = await self.client.managed_environments_storages.delete( resource_group_name=resource_group.name, environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations.py index 2c6343949e2f..786e43f4553c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_check_name_availability(self, resource_group): + def test_namespaces_check_name_availability(self, resource_group): response = self.client.namespaces.check_name_availability( resource_group_name=resource_group.name, environment_name="str", check_name_availability_request={"name": "str", "type": "str"}, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations_async.py index 4d7d402a20d7..42c9399d0144 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_check_name_availability(self, resource_group): + async def test_namespaces_check_name_availability(self, resource_group): response = await self.client.namespaces.check_name_availability( resource_group_name=resource_group.name, environment_name="str", check_name_availability_request={"name": "str", "type": "str"}, - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations.py index a6f1201eb482..73535a565377 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations_async.py index 79e186721f08..383c0df36abf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations.py index 04acf42ae22d..f9c17ac44750 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations.py @@ -20,10 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_usages_list(self, resource_group): response = self.client.usages.list( location="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations_async.py index d463d34828e8..dcca0b95f7ed 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations_async.py @@ -21,10 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_usages_list(self, resource_group): response = self.client.usages.list( location="str", - api_version="2024-08-02-preview", + api_version="2025-02-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/setup.py b/sdk/appcontainers/azure-mgmt-appcontainers/setup.py index 2f3300f3cf4f..5183ce1a9963 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/setup.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/setup.py @@ -22,11 +22,9 @@ # Version extraction inspired from 'requests' with open( - ( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py") - ), + os.path.join(package_folder_path, "version.py") + if os.path.exists(os.path.join(package_folder_path, "version.py")) + else os.path.join(package_folder_path, "_version.py"), "r", ) as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -55,7 +53,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -81,5 +78,5 @@ "azure-common>=1.1", "azure-mgmt-core>=1.3.2", ], - python_requires=">=3.8", + python_requires=">=3.9", )