diff --git a/sdk/appplatform/azure-mgmt-appplatform/CHANGELOG.md b/sdk/appplatform/azure-mgmt-appplatform/CHANGELOG.md index c93a9cab5c85..a0f6de6d3ae8 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/CHANGELOG.md +++ b/sdk/appplatform/azure-mgmt-appplatform/CHANGELOG.md @@ -1,5 +1,100 @@ # Release History +## 10.1.0b1 (2025-04-17) + +### Features Added + + - Client `AppPlatformManagementClient` added operation group `eureka_servers` + - Client `AppPlatformManagementClient` added operation group `jobs` + - Client `AppPlatformManagementClient` added operation group `job` + - Client `AppPlatformManagementClient` added operation group `job_execution` + - Client `AppPlatformManagementClient` added operation group `job_executions` + - Model `AppResourceProperties` added property `secrets` + - Model `AppResourceProperties` added property `workload_profile_name` + - Model `AppResourceProperties` added property `test_endpoint_auth_state` + - Enum `BindingType` added member `CA_CERTIFICATES` + - Model `BuildpackProperties` added property `version` + - Model `ClusterResourceProperties` added property `maintenance_schedule_configuration` + - Model `ClusterResourceProperties` added property `managed_environment_id` + - Model `ClusterResourceProperties` added property `infra_resource_group` + - Model `ConfigServerProperties` added property `resource_requests` + - Model `ConfigServerProperties` added property `instances` + - Model `ConfigServerProperties` added property `enabled_state` + - Enum `ConfigServerState` added member `CREATING` + - Enum `ConfigServerState` added member `DELETING` + - Model `ConfigurationServiceSettings` added property `refresh_interval_in_seconds` + - Model `DeploymentSettings` added property `scale` + - Model `GatewayProperties` added property `apm_types` + - Model `GatewayProperties` added property `addon_configs` + - Model `GatewayProperties` added property `response_cache_properties` + - Model `ServiceResource` added property `identity` + - Model `ServiceVNetAddons` added property `private_storage_access` + - Model `ServiceVNetAddons` added property `private_dns_zone_id` + - Model `SupportedBuildpackResourceProperties` added property `version` + - Enum `SupportedRuntimeValue` added member `JAVA21` + - Added enum `ApmType` + - Added enum `ConfigServerEnabledState` + - Added model `ConfigServerInstance` + - Added model `ConfigServerResourceCollection` + - Added model `ConfigServerResourceRequests` + - Added model `CustomScaleRule` + - Added model `EnvSecretsCollection` + - Added model `EnvVar` + - Added enum `EurekaServerEnabledState` + - Added model `EurekaServerProperties` + - Added model `EurekaServerResource` + - Added model `EurekaServerResourceCollection` + - Added enum `EurekaServerState` + - Added enum `Frequency` + - Added model `GatewayLocalResponseCachePerInstanceProperties` + - Added model `GatewayLocalResponseCachePerRouteProperties` + - Added model `GatewayResponseCacheProperties` + - Added model `HttpScaleRule` + - Added model `JobExecution` + - Added model `JobExecutionCollection` + - Added enum `JobExecutionRunningState` + - Added model `JobExecutionTemplate` + - Added model `JobResource` + - Added model `JobResourceCollection` + - Added model `JobResourceProperties` + - Added enum `JobResourceProvisioningState` + - Added model `JobResourceRequests` + - Added model `JobTriggerConfig` + - Added model `MaintenanceScheduleConfiguration` + - Added model `ManagedComponentReference` + - Added model `ManualJobTriggerConfig` + - Added enum `PrivateStorageAccess` + - Added model `QueueScaleRule` + - Added model `Scale` + - Added model `ScaleRule` + - Added model `ScaleRuleAuth` + - Added model `Secret` + - Added model `SystemAssignedServiceIdentity` + - Added enum `SystemAssignedServiceIdentityType` + - Added model `TcpScaleRule` + - Added enum `TestEndpointAuthState` + - Added enum `TriggerType` + - Added enum `WeekDay` + - Added model `WeeklyMaintenanceScheduleConfiguration` + - Model `ConfigServersOperations` added method `begin_delete` + - Model `ConfigServersOperations` added method `list` + - Model `GatewaysOperations` added method `begin_update_capacity` + - Added model `EurekaServersOperations` + - Added model `JobExecutionOperations` + - Added model `JobExecutionsOperations` + - Added model `JobOperations` + - Added model `JobsOperations` + - Method `GatewaysOperations.begin_update_capacity` has a new overload `def begin_update_capacity(self: None, resource_group_name: str, service_name: str, gateway_name: str, gateway_capacity_resource: SkuObject, content_type: str)` + - Method `GatewaysOperations.begin_update_capacity` has a new overload `def begin_update_capacity(self: None, resource_group_name: str, service_name: str, gateway_name: str, gateway_capacity_resource: IO[bytes], content_type: str)` + - Method `EurekaServersOperations.begin_update_patch` has a new overload `def begin_update_patch(self: None, resource_group_name: str, service_name: str, eureka_server_resource: EurekaServerResource, content_type: str)` + - Method `EurekaServersOperations.begin_update_patch` has a new overload `def begin_update_patch(self: None, resource_group_name: str, service_name: str, eureka_server_resource: IO[bytes], content_type: str)` + - Method `EurekaServersOperations.begin_update_put` has a new overload `def begin_update_put(self: None, resource_group_name: str, service_name: str, eureka_server_resource: EurekaServerResource, content_type: str)` + - Method `EurekaServersOperations.begin_update_put` has a new overload `def begin_update_put(self: None, resource_group_name: str, service_name: str, eureka_server_resource: IO[bytes], content_type: str)` + - Method `JobOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, service_name: str, job_name: str, job_resource: JobResource, content_type: str)` + - Method `JobOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, service_name: str, job_name: str, job_resource: IO[bytes], content_type: str)` + - Method `JobOperations.begin_start` has a new overload `def begin_start(self: None, resource_group_name: str, service_name: str, job_name: str, template: Optional[JobExecutionTemplate], content_type: str)` + - Method `JobOperations.begin_start` has a new overload `def begin_start(self: None, resource_group_name: str, service_name: str, job_name: str, template: Optional[IO[bytes]], content_type: str)` + ## 10.0.0 (2024-10-29) ### Breaking Changes diff --git a/sdk/appplatform/azure-mgmt-appplatform/README.md b/sdk/appplatform/azure-mgmt-appplatform/README.md index 90270f62e19d..c5bb5ffb34d9 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/README.md +++ b/sdk/appplatform/azure-mgmt-appplatform/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure App Platform 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/appplatform/azure-mgmt-appplatform/_meta.json b/sdk/appplatform/azure-mgmt-appplatform/_meta.json index c545f9050926..047db2c2813e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/_meta.json +++ b/sdk/appplatform/azure-mgmt-appplatform/_meta.json @@ -1,11 +1,11 @@ { - "commit": "71341bf84d11e4cf6c3d3c6aa9d1615238b20e90", + "commit": "025ed7c8f2766398935e005e36d4a753805ed215", "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/appplatform/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 --tag=package-2023-12 --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/appplatform/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/appplatform/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/__init__.py index d0d782a6deec..4e825e679f97 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/__init__.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/__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 ._app_platform_management_client import AppPlatformManagementClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._app_platform_management_client import AppPlatformManagementClient # 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__ = [ "AppPlatformManagementClient", ] -__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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_app_platform_management_client.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_app_platform_management_client.py index ee7d0d515466..3a7c0ad94d6e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_app_platform_management_client.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_app_platform_management_client.py @@ -38,9 +38,14 @@ CustomizedAcceleratorsOperations, DeploymentsOperations, DevToolPortalsOperations, + EurekaServersOperations, GatewayCustomDomainsOperations, GatewayRouteConfigsOperations, GatewaysOperations, + JobExecutionOperations, + JobExecutionsOperations, + JobOperations, + JobsOperations, MonitoringSettingsOperations, Operations, PredefinedAcceleratorsOperations, @@ -52,17 +57,18 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class AppPlatformManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class AppPlatformManagementClient: # pylint: disable=too-many-instance-attributes """REST API for Azure Spring Apps. :ivar services: ServicesOperations operations :vartype services: azure.mgmt.appplatform.operations.ServicesOperations :ivar apms: ApmsOperations operations :vartype apms: azure.mgmt.appplatform.operations.ApmsOperations + :ivar eureka_servers: EurekaServersOperations operations + :vartype eureka_servers: azure.mgmt.appplatform.operations.EurekaServersOperations :ivar config_servers: ConfigServersOperations operations :vartype config_servers: azure.mgmt.appplatform.operations.ConfigServersOperations :ivar configuration_services: ConfigurationServicesOperations operations @@ -127,6 +133,14 @@ class AppPlatformManagementClient: # pylint: disable=client-accepts-api-version :ivar predefined_accelerators: PredefinedAcceleratorsOperations operations :vartype predefined_accelerators: azure.mgmt.appplatform.operations.PredefinedAcceleratorsOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.appplatform.operations.JobsOperations + :ivar job: JobOperations operations + :vartype job: azure.mgmt.appplatform.operations.JobOperations + :ivar job_execution: JobExecutionOperations operations + :vartype job_execution: azure.mgmt.appplatform.operations.JobExecutionOperations + :ivar job_executions: JobExecutionsOperations operations + :vartype job_executions: azure.mgmt.appplatform.operations.JobExecutionsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Gets subscription ID which uniquely identify the Microsoft Azure @@ -134,8 +148,8 @@ class AppPlatformManagementClient: # pylint: disable=client-accepts-api-version :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-12-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-05-01-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 Retry-After header is present. @@ -177,6 +191,7 @@ def __init__( self._serialize.client_side_validation = False self.services = ServicesOperations(self._client, self._config, self._serialize, self._deserialize) self.apms = ApmsOperations(self._client, self._config, self._serialize, self._deserialize) + self.eureka_servers = EurekaServersOperations(self._client, self._config, self._serialize, self._deserialize) self.config_servers = ConfigServersOperations(self._client, self._config, self._serialize, self._deserialize) self.configuration_services = ConfigurationServicesOperations( self._client, self._config, self._serialize, self._deserialize @@ -235,6 +250,10 @@ def __init__( self.predefined_accelerators = PredefinedAcceleratorsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.job = JobOperations(self._client, self._config, self._serialize, self._deserialize) + self.job_execution = JobExecutionOperations(self._client, self._config, self._serialize, self._deserialize) + self.job_executions = JobExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_configuration.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_configuration.py index 2bcd7fc34af6..b15d5907d575 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_configuration.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_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 AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -29,13 +28,13 @@ class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-inst :param subscription_id: Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-12-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-05-01-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", "2023-12-01") + api_version: str = kwargs.pop("api_version", "2024-05-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_serialization.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_serialization.py index 8139854b97bb..f5187701d7be 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_serialization.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_version.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_version.py index 9f8bb24bdd99..b5e2ac841400 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_version.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.0.0" +VERSION = "10.1.0b1" diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/__init__.py index 99174a0dabfc..95cf71f968da 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/__init__.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/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 ._app_platform_management_client import AppPlatformManagementClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._app_platform_management_client import AppPlatformManagementClient # 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__ = [ "AppPlatformManagementClient", ] -__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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/_app_platform_management_client.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/_app_platform_management_client.py index a8b9c24bdb8e..d2dc7c08da69 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/_app_platform_management_client.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/_app_platform_management_client.py @@ -38,9 +38,14 @@ CustomizedAcceleratorsOperations, DeploymentsOperations, DevToolPortalsOperations, + EurekaServersOperations, GatewayCustomDomainsOperations, GatewayRouteConfigsOperations, GatewaysOperations, + JobExecutionOperations, + JobExecutionsOperations, + JobOperations, + JobsOperations, MonitoringSettingsOperations, Operations, PredefinedAcceleratorsOperations, @@ -52,17 +57,18 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class AppPlatformManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class AppPlatformManagementClient: # pylint: disable=too-many-instance-attributes """REST API for Azure Spring Apps. :ivar services: ServicesOperations operations :vartype services: azure.mgmt.appplatform.aio.operations.ServicesOperations :ivar apms: ApmsOperations operations :vartype apms: azure.mgmt.appplatform.aio.operations.ApmsOperations + :ivar eureka_servers: EurekaServersOperations operations + :vartype eureka_servers: azure.mgmt.appplatform.aio.operations.EurekaServersOperations :ivar config_servers: ConfigServersOperations operations :vartype config_servers: azure.mgmt.appplatform.aio.operations.ConfigServersOperations :ivar configuration_services: ConfigurationServicesOperations operations @@ -131,6 +137,14 @@ class AppPlatformManagementClient: # pylint: disable=client-accepts-api-version :ivar predefined_accelerators: PredefinedAcceleratorsOperations operations :vartype predefined_accelerators: azure.mgmt.appplatform.aio.operations.PredefinedAcceleratorsOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.appplatform.aio.operations.JobsOperations + :ivar job: JobOperations operations + :vartype job: azure.mgmt.appplatform.aio.operations.JobOperations + :ivar job_execution: JobExecutionOperations operations + :vartype job_execution: azure.mgmt.appplatform.aio.operations.JobExecutionOperations + :ivar job_executions: JobExecutionsOperations operations + :vartype job_executions: azure.mgmt.appplatform.aio.operations.JobExecutionsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Gets subscription ID which uniquely identify the Microsoft Azure @@ -138,8 +152,8 @@ class AppPlatformManagementClient: # pylint: disable=client-accepts-api-version :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-12-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-05-01-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 Retry-After header is present. @@ -181,6 +195,7 @@ def __init__( self._serialize.client_side_validation = False self.services = ServicesOperations(self._client, self._config, self._serialize, self._deserialize) self.apms = ApmsOperations(self._client, self._config, self._serialize, self._deserialize) + self.eureka_servers = EurekaServersOperations(self._client, self._config, self._serialize, self._deserialize) self.config_servers = ConfigServersOperations(self._client, self._config, self._serialize, self._deserialize) self.configuration_services = ConfigurationServicesOperations( self._client, self._config, self._serialize, self._deserialize @@ -239,6 +254,10 @@ def __init__( self.predefined_accelerators = PredefinedAcceleratorsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.job = JobOperations(self._client, self._config, self._serialize, self._deserialize) + self.job_execution = JobExecutionOperations(self._client, self._config, self._serialize, self._deserialize) + self.job_executions = JobExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/_configuration.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/_configuration.py index 5fc004262306..16e37f4bcbbc 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/_configuration.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/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 AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for AppPlatformManagementClient. Note that all parameters used to create this instance are saved as instance @@ -29,13 +28,13 @@ class AppPlatformManagementClientConfiguration: # pylint: disable=too-many-inst :param subscription_id: Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-12-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-05-01-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", "2023-12-01") + api_version: str = kwargs.pop("api_version", "2024-05-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/__init__.py index 71f15acbbfb3..291baeb1ed37 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/__init__.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/__init__.py @@ -5,45 +5,57 @@ # 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 ._services_operations import ServicesOperations -from ._apms_operations import ApmsOperations -from ._config_servers_operations import ConfigServersOperations -from ._configuration_services_operations import ConfigurationServicesOperations -from ._service_registries_operations import ServiceRegistriesOperations -from ._application_live_views_operations import ApplicationLiveViewsOperations -from ._dev_tool_portals_operations import DevToolPortalsOperations -from ._container_registries_operations import ContainerRegistriesOperations -from ._build_service_operations import BuildServiceOperations -from ._buildpack_binding_operations import BuildpackBindingOperations -from ._build_service_builder_operations import BuildServiceBuilderOperations -from ._build_service_agent_pool_operations import BuildServiceAgentPoolOperations -from ._monitoring_settings_operations import MonitoringSettingsOperations -from ._apps_operations import AppsOperations -from ._bindings_operations import BindingsOperations -from ._storages_operations import StoragesOperations -from ._certificates_operations import CertificatesOperations -from ._custom_domains_operations import CustomDomainsOperations -from ._deployments_operations import DeploymentsOperations -from ._operations import Operations -from ._runtime_versions_operations import RuntimeVersionsOperations -from ._skus_operations import SkusOperations -from ._gateways_operations import GatewaysOperations -from ._gateway_route_configs_operations import GatewayRouteConfigsOperations -from ._gateway_custom_domains_operations import GatewayCustomDomainsOperations -from ._api_portals_operations import ApiPortalsOperations -from ._api_portal_custom_domains_operations import ApiPortalCustomDomainsOperations -from ._application_accelerators_operations import ApplicationAcceleratorsOperations -from ._customized_accelerators_operations import CustomizedAcceleratorsOperations -from ._predefined_accelerators_operations import PredefinedAcceleratorsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._services_operations import ServicesOperations # type: ignore +from ._apms_operations import ApmsOperations # type: ignore +from ._eureka_servers_operations import EurekaServersOperations # type: ignore +from ._config_servers_operations import ConfigServersOperations # type: ignore +from ._configuration_services_operations import ConfigurationServicesOperations # type: ignore +from ._service_registries_operations import ServiceRegistriesOperations # type: ignore +from ._application_live_views_operations import ApplicationLiveViewsOperations # type: ignore +from ._dev_tool_portals_operations import DevToolPortalsOperations # type: ignore +from ._container_registries_operations import ContainerRegistriesOperations # type: ignore +from ._build_service_operations import BuildServiceOperations # type: ignore +from ._buildpack_binding_operations import BuildpackBindingOperations # type: ignore +from ._build_service_builder_operations import BuildServiceBuilderOperations # type: ignore +from ._build_service_agent_pool_operations import BuildServiceAgentPoolOperations # type: ignore +from ._monitoring_settings_operations import MonitoringSettingsOperations # type: ignore +from ._apps_operations import AppsOperations # type: ignore +from ._bindings_operations import BindingsOperations # type: ignore +from ._storages_operations import StoragesOperations # type: ignore +from ._certificates_operations import CertificatesOperations # type: ignore +from ._custom_domains_operations import CustomDomainsOperations # type: ignore +from ._deployments_operations import DeploymentsOperations # type: ignore +from ._operations import Operations # type: ignore +from ._runtime_versions_operations import RuntimeVersionsOperations # type: ignore +from ._skus_operations import SkusOperations # type: ignore +from ._gateways_operations import GatewaysOperations # type: ignore +from ._gateway_route_configs_operations import GatewayRouteConfigsOperations # type: ignore +from ._gateway_custom_domains_operations import GatewayCustomDomainsOperations # type: ignore +from ._api_portals_operations import ApiPortalsOperations # type: ignore +from ._api_portal_custom_domains_operations import ApiPortalCustomDomainsOperations # type: ignore +from ._application_accelerators_operations import ApplicationAcceleratorsOperations # type: ignore +from ._customized_accelerators_operations import CustomizedAcceleratorsOperations # type: ignore +from ._predefined_accelerators_operations import PredefinedAcceleratorsOperations # type: ignore +from ._jobs_operations import JobsOperations # type: ignore +from ._job_operations import JobOperations # type: ignore +from ._job_execution_operations import JobExecutionOperations # type: ignore +from ._job_executions_operations import JobExecutionsOperations # 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__ = [ "ServicesOperations", "ApmsOperations", + "EurekaServersOperations", "ConfigServersOperations", "ConfigurationServicesOperations", "ServiceRegistriesOperations", @@ -72,6 +84,10 @@ "ApplicationAcceleratorsOperations", "CustomizedAcceleratorsOperations", "PredefinedAcceleratorsOperations", + "JobsOperations", + "JobOperations", + "JobExecutionOperations", + "JobExecutionsOperations", ] -__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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_api_portal_custom_domains_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_api_portal_custom_domains_operations.py index aaccc2419e32..69fb7e5213e0 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_api_portal_custom_domains_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_api_portal_custom_domains_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._api_portal_custom_domains_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class ApiPortalCustomDomainsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -85,7 +85,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +138,7 @@ async def _create_or_update_initial( api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +355,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +490,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApiPortalCustomDomainResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_api_portals_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_api_portals_operations.py index 85313a125c2e..90834d603047 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_api_portals_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_api_portals_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._api_portals_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_request, build_validate_domain_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class ApiPortalsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -84,7 +84,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -135,7 +135,7 @@ async def _create_or_update_initial( api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +462,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApiPortalResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -609,7 +609,7 @@ async def validate_domain( :rtype: ~azure.mgmt.appplatform.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_apms_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_apms_operations.py index f730c01ad545..593cb4e48dbe 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_apms_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_apms_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._apms_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_request, build_list_secret_keys_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class ApmsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, **kwargs: Any) -> AsyncIterable["_models.ApmResource"]: @@ -86,7 +86,7 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApmResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +165,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -216,7 +216,7 @@ async def _create_or_update_initial( apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -415,7 +415,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +544,7 @@ async def list_secret_keys( :rtype: ~azure.mgmt.appplatform.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_application_accelerators_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_application_accelerators_operations.py index e17f50761697..c02f850a69c8 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_application_accelerators_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_application_accelerators_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._application_accelerators_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class ApplicationAcceleratorsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +89,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApplicationAcceleratorResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +219,7 @@ async def _create_or_update_initial( application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -425,7 +425,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, application_accelerator_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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_application_live_views_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_application_live_views_operations.py index d8840ee679b4..57edc0a85963 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_application_live_views_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_application_live_views_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._application_live_views_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class ApplicationLiveViewsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +89,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApplicationLiveViewResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +219,7 @@ async def _create_or_update_initial( application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -423,7 +423,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, application_live_view_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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_apps_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_apps_operations.py index bc67eb48f0c1..b7f93a0ff722 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_apps_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_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._apps_operations import ( build_create_or_update_request, build_delete_request, @@ -42,11 +44,8 @@ build_update_request, build_validate_domain_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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 +64,12 @@ class AppsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -94,7 +95,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,7 +147,7 @@ async def _create_or_update_initial( app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -345,7 +346,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +460,7 @@ async def _update_initial( app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -674,7 +675,7 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> As api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AppResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -753,7 +754,7 @@ async def get_resource_upload_url( :rtype: ~azure.mgmt.appplatform.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +805,7 @@ async def _set_active_deployments_initial( active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1086,7 +1087,7 @@ async def validate_domain( :rtype: ~azure.mgmt.appplatform.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_bindings_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_bindings_operations.py index b88ccf4db61c..797b3dc8840e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_bindings_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_bindings_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._bindings_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_request, build_update_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class BindingsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +86,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -139,7 +139,7 @@ async def _create_or_update_initial( binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +349,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -468,7 +468,7 @@ async def _update_initial( binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +698,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BindingResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_agent_pool_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_agent_pool_operations.py index 49c51b82d03c..78a964f9c417 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_agent_pool_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_agent_pool_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,16 +32,14 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._build_service_agent_pool_operations import ( build_get_request, build_list_request, build_update_put_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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]] @@ -60,10 +58,12 @@ class BuildServiceAgentPoolOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +90,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuildServiceAgentPoolResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +225,7 @@ async def _update_put_initial( agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_builder_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_builder_operations.py index 3ae60c25c8b8..c15a65c8b015 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_builder_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_builder_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._build_service_builder_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_deployments_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class BuildServiceBuilderOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +86,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -139,7 +139,7 @@ async def _create_or_update_initial( builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +349,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -482,7 +482,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuilderResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -564,7 +564,7 @@ async def list_deployments( :rtype: ~azure.mgmt.appplatform.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_operations.py index 09fe9370c25d..443cd42651ad 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_build_service_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._build_service_operations import ( build_create_or_update_build_request, build_create_or_update_request, @@ -49,11 +51,8 @@ build_list_supported_buildpacks_request, build_list_supported_stacks_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class BuildServiceOperations: 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: AppPlatformManagementClientConfiguration = ( + 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_build_services( @@ -98,7 +99,7 @@ def list_build_services( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuildServiceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -177,7 +178,7 @@ async def get_build_service( :rtype: ~azure.mgmt.appplatform.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -228,7 +229,7 @@ async def _create_or_update_initial( build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +450,7 @@ def list_builds( 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, @@ -531,7 +532,7 @@ async def get_build( :rtype: ~azure.mgmt.appplatform.models.Build :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -669,7 +670,7 @@ async def create_or_update_build( :rtype: ~azure.mgmt.appplatform.models.Build :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +729,7 @@ async def create_or_update_build( async def _delete_build_initial( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +870,7 @@ def list_build_results( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuildResultCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -960,7 +961,7 @@ async def get_build_result( :rtype: ~azure.mgmt.appplatform.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1032,7 +1033,7 @@ async def get_build_result_log( :rtype: ~azure.mgmt.appplatform.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1094,7 +1095,7 @@ async def get_resource_upload_url( :rtype: ~azure.mgmt.appplatform.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1154,7 +1155,7 @@ async def list_supported_buildpacks( :rtype: ~azure.mgmt.appplatform.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1216,7 +1217,7 @@ async def get_supported_buildpack( :rtype: ~azure.mgmt.appplatform.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1278,7 @@ async def list_supported_stacks( :rtype: ~azure.mgmt.appplatform.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1339,7 +1340,7 @@ async def get_supported_stack( :rtype: ~azure.mgmt.appplatform.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_buildpack_binding_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_buildpack_binding_operations.py index e98b920bd269..0c89667bd829 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_buildpack_binding_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_buildpack_binding_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._buildpack_binding_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_for_cluster_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class BuildpackBindingOperations: 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: AppPlatformManagementClientConfiguration = ( + 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_for_cluster( @@ -90,7 +90,7 @@ def list_for_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuildpackBindingResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -179,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -234,7 +234,7 @@ async def _create_or_update_initial( buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -466,7 +466,7 @@ async def _delete_initial( buildpack_binding_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,7 +613,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuildpackBindingResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_certificates_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_certificates_operations.py index d9115dcbb855..3bee2068eacc 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_certificates_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/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, 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._certificates_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -83,7 +83,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -134,7 +134,7 @@ async def _create_or_update_initial( certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +333,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -461,7 +461,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CertificateResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_config_servers_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_config_servers_operations.py index be3ddda644c9..c2737e019edf 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_config_servers_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_config_servers_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,13 @@ # 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, 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, HttpResponseError, @@ -23,23 +25,24 @@ 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._config_servers_operations import ( + build_delete_request, build_get_request, + build_list_request, build_update_patch_request, build_update_put_request, build_validate_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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 +61,12 @@ class ConfigServersOperations: 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, **kwargs: Any) -> _models.ConfigServerResource: @@ -76,7 +81,7 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :rtype: ~azure.mgmt.appplatform.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -125,7 +130,7 @@ async def _update_put_initial( config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +322,7 @@ async def _update_patch_initial( config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -502,6 +507,196 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + async def _delete_initial(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + 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 [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) + raise HttpResponseError(response=response, 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, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Disable the default Config Server, only available in Enterprise Plan. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_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, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ConfigServerResource"]: + """Handles requests to list all config server resources in a Service. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ConfigServerResource or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.models.ConfigServerResource] + :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.ConfigServerResourceCollection] = 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, + service_name=service_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("ConfigServerResourceCollection", 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + async def _validate_initial( self, resource_group_name: str, @@ -509,7 +704,7 @@ async def _validate_initial( config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_configuration_services_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_configuration_services_operations.py index 46ffc223ba1d..681ba572d570 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_configuration_services_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_configuration_services_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._configuration_services_operations import ( build_create_or_update_request, build_delete_request, @@ -40,11 +41,8 @@ build_validate_request, build_validate_resource_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class ConfigurationServicesOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -85,7 +85,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -136,7 +136,7 @@ async def _create_or_update_initial( configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +343,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +472,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConfigurationServiceResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +542,7 @@ async def _validate_initial( settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -753,7 +753,7 @@ async def _validate_resource_initial( configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_container_registries_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_container_registries_operations.py index d5c4f22697bf..8610e33c2805 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_container_registries_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_container_registries_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_registries_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_request, build_validate_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class ContainerRegistriesOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +90,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerRegistryResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ async def _create_or_update_initial( container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -425,7 +425,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -545,7 +545,7 @@ async def _validate_initial( container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_custom_domains_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_custom_domains_operations.py index 2deb7c69edfb..278169af4ccf 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_custom_domains_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_custom_domains_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._custom_domains_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_request, build_update_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class CustomDomainsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +86,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -139,7 +139,7 @@ async def _create_or_update_initial( domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +349,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -468,7 +468,7 @@ async def _update_initial( domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -700,7 +700,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CustomDomainResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_customized_accelerators_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_customized_accelerators_operations.py index cc11190a9b5f..9e0404f99073 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_customized_accelerators_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_customized_accelerators_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._customized_accelerators_operations import ( build_create_or_update_request, build_delete_request, @@ -39,11 +40,8 @@ build_list_request, build_validate_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class CustomizedAcceleratorsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -92,7 +92,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CustomizedAcceleratorResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -179,7 +179,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +232,7 @@ async def _create_or_update_initial( customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +454,7 @@ async def _delete_initial( customized_accelerator_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +582,7 @@ async def _validate_initial( properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_deployments_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_deployments_operations.py index 775dfbd6a195..22c939e63cd1 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_deployments_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_deployments_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,25 +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, - List, - Optional, - Type, - TypeVar, - Union, - cast, - overload, -) +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, 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, @@ -46,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._deployments_operations import ( build_create_or_update_request, build_delete_request, @@ -64,11 +52,8 @@ build_stop_request, build_update_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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]] @@ -87,10 +72,12 @@ class DeploymentsOperations: # 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -111,7 +98,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +151,7 @@ async def _create_or_update_initial( deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +361,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -493,7 +480,7 @@ async def _update_initial( deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,6 +694,7 @@ def list( service_name: str, app_name: str, version: Optional[List[str]] = None, + expand: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.DeploymentResource"]: """Handles requests to list all resources in an App. @@ -720,6 +708,8 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] + :param expand: The expand expression to apply on the operation. Default value is None. + :type expand: str :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.models.DeploymentResource] @@ -731,7 +721,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DeploymentResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -748,6 +738,7 @@ def prepare_request(next_link=None): app_name=app_name, subscription_id=self._config.subscription_id, version=version, + expand=expand, api_version=api_version, headers=_headers, params=_params, @@ -826,7 +817,7 @@ def list_for_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DeploymentResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -893,7 +884,7 @@ async def get_next(next_link=None): async def _start_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1006,7 +997,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1110,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _restart_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1238,7 +1229,7 @@ async def _enable_remote_debugging_initial( remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1452,7 +1443,7 @@ def get_long_running_output(pipeline_response): async def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1577,7 @@ async def get_remote_debugging_config( :rtype: ~azure.mgmt.appplatform.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1649,7 +1640,7 @@ async def get_log_file_url( :rtype: ~azure.mgmt.appplatform.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1704,7 +1695,7 @@ async def _generate_heap_dump_initial( diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1913,7 +1904,7 @@ async def _generate_thread_dump_initial( diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2122,7 +2113,7 @@ async def _start_jfr_initial( diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_dev_tool_portals_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_dev_tool_portals_operations.py index 464ec30444f6..21674d468fe7 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_dev_tool_portals_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_dev_tool_portals_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._dev_tool_portals_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class DevToolPortalsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +89,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DevToolPortalResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +219,7 @@ async def _create_or_update_initial( dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +422,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_eureka_servers_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_eureka_servers_operations.py new file mode 100644 index 000000000000..8c355c8a2dba --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_eureka_servers_operations.py @@ -0,0 +1,573 @@ +# 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, 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._eureka_servers_operations import ( + build_get_request, + build_list_request, + build_update_patch_request, + build_update_put_request, +) +from .._configuration import AppPlatformManagementClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class EurekaServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.aio.AppPlatformManagementClient`'s + :attr:`eureka_servers` 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: AppPlatformManagementClientConfiguration = ( + 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( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> _models.EurekaServerResourceCollection: + """List the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: EurekaServerResourceCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.EurekaServerResourceCollection + :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.EurekaServerResourceCollection] = kwargs.pop("cls", None) + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: + """Get the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: EurekaServerResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.EurekaServerResource + :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.EurekaServerResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EurekaServerResource", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_put_initial( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, 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(eureka_server_resource, (IOBase, bytes)): + _content = eureka_server_resource + else: + _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") + + _request = build_update_put_request( + resource_group_name=resource_group_name, + service_name=service_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + 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, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: _models.EurekaServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: ~azure.mgmt.appplatform.models.EurekaServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Is either a + EurekaServerResource type or a IO[bytes] type. Required. + :type eureka_server_resource: ~azure.mgmt.appplatform.models.EurekaServerResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = 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_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + eureka_server_resource=eureka_server_resource, + 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("EurekaServerResource", 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.EurekaServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_patch_initial( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, 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(eureka_server_resource, (IOBase, bytes)): + _content = eureka_server_resource + else: + _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") + + _request = build_update_patch_request( + resource_group_name=resource_group_name, + service_name=service_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, 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) + raise HttpResponseError(response=response, 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, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: _models.EurekaServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: ~azure.mgmt.appplatform.models.EurekaServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Is either a + EurekaServerResource type or a IO[bytes] type. Required. + :type eureka_server_resource: ~azure.mgmt.appplatform.models.EurekaServerResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either EurekaServerResource or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = 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_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + eureka_server_resource=eureka_server_resource, + 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("EurekaServerResource", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EurekaServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateway_custom_domains_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateway_custom_domains_operations.py index 64f84c181352..b7c169345431 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateway_custom_domains_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateway_custom_domains_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._gateway_custom_domains_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class GatewayCustomDomainsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -85,7 +85,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +138,7 @@ async def _create_or_update_initial( gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +355,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +490,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GatewayCustomDomainResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateway_route_configs_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateway_route_configs_operations.py index b0c9a57d84e7..f5138196b4cd 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateway_route_configs_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateway_route_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, 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._gateway_route_configs_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class GatewayRouteConfigsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -85,7 +85,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +138,7 @@ async def _create_or_update_initial( gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -357,7 +357,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -492,7 +492,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GatewayRouteConfigResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateways_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateways_operations.py index 8065c15293ed..b541b20e5236 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateways_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_gateways_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._gateways_operations import ( build_create_or_update_request, build_delete_request, @@ -39,13 +41,11 @@ build_list_env_secrets_request, build_list_request, build_restart_request, + build_update_capacity_request, build_validate_domain_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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 +64,12 @@ class GatewaysOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +88,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +139,7 @@ async def _create_or_update_initial( gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,10 +335,220 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + async def _update_capacity_initial( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: Union[_models.SkuObject, 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(gateway_capacity_resource, (IOBase, bytes)): + _content = gateway_capacity_resource + else: + _json = self._serialize.body(gateway_capacity_resource, "SkuObject") + + _request = build_update_capacity_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_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, 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) + raise HttpResponseError(response=response, 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, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: _models.SkuObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Required. + :type gateway_capacity_resource: ~azure.mgmt.appplatform.models.SkuObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Required. + :type gateway_capacity_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a + SkuObject type or a IO[bytes] type. Required. + :type gateway_capacity_resource: ~azure.mgmt.appplatform.models.SkuObject or IO[bytes] + :return: An instance of AsyncLROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayResource] = 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_capacity_initial( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + gateway_capacity_resource=gateway_capacity_resource, + 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("GatewayResource", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.GatewayResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + async def _delete_initial( self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +671,7 @@ async def list_env_secrets( :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +717,7 @@ async def list_env_secrets( async def _restart_initial( self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -638,7 +850,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GatewayResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -785,7 +997,7 @@ async def validate_domain( :rtype: ~azure.mgmt.appplatform.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_job_execution_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_job_execution_operations.py new file mode 100644 index 000000000000..a08bcd738c70 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_job_execution_operations.py @@ -0,0 +1,306 @@ +# 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, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast + +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._job_execution_operations import ( + build_cancel_request, + build_get_request, + build_list_env_secrets_request, +) +from .._configuration import AppPlatformManagementClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class JobExecutionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.aio.AppPlatformManagementClient`'s + :attr:`job_execution` 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: AppPlatformManagementClientConfiguration = ( + 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") + + async def _cancel_initial( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_cancel_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + 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 [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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + 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, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_cancel( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Terminate execution of a running Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._cancel_initial( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_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 + + @distributed_trace_async + async def get( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> _models.JobExecution: + """Get details of an execution of an Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :return: JobExecution or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.JobExecution + :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.JobExecution] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobExecution", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_env_secrets( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> _models.EnvSecretsCollection: + """List sensitive environment variables of Job execution. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :return: EnvSecretsCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.EnvSecretsCollection + :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.EnvSecretsCollection] = kwargs.pop("cls", None) + + _request = build_list_env_secrets_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EnvSecretsCollection", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_job_executions_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_job_executions_operations.py new file mode 100644 index 000000000000..385591f164f1 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_job_executions_operations.py @@ -0,0 +1,142 @@ +# 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.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._serialization import Deserializer, Serializer +from ...operations._job_executions_operations import build_list_request +from .._configuration import AppPlatformManagementClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class JobExecutionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.aio.AppPlatformManagementClient`'s + :attr:`job_executions` 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, job_name: str, **kwargs: Any + ) -> AsyncIterable["_models.JobExecution"]: + """Get executions of a Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: An iterator like instance of either JobExecution or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.models.JobExecution] + :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.JobExecutionCollection] = 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, + service_name=service_name, + job_name=job_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("JobExecutionCollection", 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_job_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_job_operations.py new file mode 100644 index 000000000000..5a13d9e7fe59 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_job_operations.py @@ -0,0 +1,721 @@ +# 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, 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._job_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_env_secrets_request, + build_start_request, +) +from .._configuration import AppPlatformManagementClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class JobOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.aio.AppPlatformManagementClient`'s + :attr:`job` 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, job_name: str, **kwargs: Any + ) -> _models.JobResource: + """Get a Job and its properties. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.JobResource + :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.JobResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobResource", 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, + service_name: str, + job_name: str, + job_resource: Union[_models.JobResource, 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(job_resource, (IOBase, bytes)): + _content = job_resource + else: + _json = self._serialize.body(job_resource, "JobResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_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) + raise HttpResponseError(response=response, 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 begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Required. + :type job_resource: ~azure.mgmt.appplatform.models.JobResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Required. + :type job_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: Union[_models.JobResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Is either a JobResource + type or a IO[bytes] type. Required. + :type job_resource: ~azure.mgmt.appplatform.models.JobResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobResource] = 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, + service_name=service_name, + job_name=job_name, + job_resource=job_resource, + 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("JobResource", 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, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + 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 [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) + raise HttpResponseError(response=response, 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, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Operation to delete a Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_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, **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 _start_initial( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, 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(template, (IOBase, bytes)): + _content = template + else: + if template is not None: + _json = self._serialize.body(template, "JobExecutionTemplate") + else: + _json = None + + _request = build_start_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_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, 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) + raise HttpResponseError(response=response, 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, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[_models.JobExecutionTemplate] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Default value is None. + :type template: ~azure.mgmt.appplatform.models.JobExecutionTemplate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either JobExecution or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Default value is None. + :type template: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either JobExecution or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, IO[bytes]]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Is either a JobExecutionTemplate type + or a IO[bytes] type. Default value is None. + :type template: ~azure.mgmt.appplatform.models.JobExecutionTemplate or IO[bytes] + :return: An instance of AsyncLROPoller that returns either JobExecution or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + template=template, + 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("JobExecution", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobExecution].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobExecution]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def list_env_secrets( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> _models.EnvSecretsCollection: + """List sensitive environment variables of the Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: EnvSecretsCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.EnvSecretsCollection + :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.EnvSecretsCollection] = kwargs.pop("cls", None) + + _request = build_list_env_secrets_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EnvSecretsCollection", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_jobs_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_jobs_operations.py new file mode 100644 index 000000000000..9bc1a45283cc --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_jobs_operations.py @@ -0,0 +1,137 @@ +# 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.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._serialization import Deserializer, Serializer +from ...operations._jobs_operations import build_list_request +from .._configuration import AppPlatformManagementClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.aio.AppPlatformManagementClient`'s + :attr:`jobs` 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, **kwargs: Any) -> AsyncIterable["_models.JobResource"]: + """Get the Azure Spring Apps Jobs in a given service. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either JobResource or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appplatform.models.JobResource] + :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.JobResourceCollection] = 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, + service_name=service_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("JobResourceCollection", 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_monitoring_settings_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_monitoring_settings_operations.py index 251d55f3137e..e4d3f8dcb467 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_monitoring_settings_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_monitoring_settings_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,16 +29,14 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._monitoring_settings_operations import ( build_get_request, build_update_patch_request, build_update_put_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class MonitoringSettingsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -77,7 +77,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -126,7 +126,7 @@ async def _update_put_initial( monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +322,7 @@ async def _update_patch_initial( monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_operations.py index 4b27b57294a8..1e7602597401 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/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 AppPlatformManagementClientConfiguration -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,12 @@ 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: AppPlatformManagementClientConfiguration = ( + 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"]: @@ -69,7 +69,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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_predefined_accelerators_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_predefined_accelerators_operations.py index 7e01cdc13851..9a808969e817 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_predefined_accelerators_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_predefined_accelerators_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, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union, cast +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,17 +31,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._predefined_accelerators_operations import ( build_disable_request, build_enable_request, build_get_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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]] @@ -60,10 +58,12 @@ class PredefinedAcceleratorsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +90,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PredefinedAcceleratorResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -177,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +229,7 @@ async def _disable_initial( predefined_accelerator_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -356,7 +356,7 @@ async def _enable_initial( predefined_accelerator_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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_runtime_versions_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_runtime_versions_operations.py index 74087fc64011..f22b31f2ef28 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_runtime_versions_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_runtime_versions_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._runtime_versions_operations import build_list_runtime_versions_request +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class RuntimeVersionsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: @@ -61,7 +61,7 @@ async def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntime :rtype: ~azure.mgmt.appplatform.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_service_registries_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_service_registries_operations.py index 85d95941e4c9..3ef8e6316bf6 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_service_registries_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_service_registries_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, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union, cast +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,17 +31,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._serialization import Deserializer, Serializer from ...operations._service_registries_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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]] @@ -60,10 +58,12 @@ class ServiceRegistriesOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -82,7 +82,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -128,7 +128,7 @@ async def get( async def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +243,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +372,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServiceRegistryResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_services_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_services_operations.py index 9366008f16a2..224d13553e71 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_services_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_services_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._services_operations import ( build_check_name_availability_request, build_create_or_update_request, @@ -53,11 +55,8 @@ build_stop_request, build_update_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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]] @@ -76,10 +75,12 @@ class ServicesOperations: # 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, **kwargs: Any) -> _models.ServiceResource: @@ -94,7 +95,7 @@ async def get(self, resource_group_name: str, service_name: str, **kwargs: Any) :rtype: ~azure.mgmt.appplatform.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +144,7 @@ async def _create_or_update_initial( resource: Union[_models.ServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -329,7 +330,7 @@ def get_long_running_output(pipeline_response): ) async def _delete_initial(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +437,7 @@ async def _update_initial( resource: Union[_models.ServiceResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +635,7 @@ async def list_test_keys(self, resource_group_name: str, service_name: str, **kw :rtype: ~azure.mgmt.appplatform.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -754,7 +755,7 @@ async def regenerate_test_key( :rtype: ~azure.mgmt.appplatform.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -809,9 +810,7 @@ async def regenerate_test_key( return deserialized # type: ignore @distributed_trace_async - async def disable_test_endpoint( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, service_name: str, **kwargs: Any - ) -> None: + async def disable_test_endpoint(self, resource_group_name: str, service_name: str, **kwargs: Any) -> None: """Disable test endpoint functionality for a Service. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -823,7 +822,7 @@ async def disable_test_endpoint( # pylint: disable=inconsistent-return-statemen :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -876,7 +875,7 @@ async def enable_test_endpoint( :rtype: ~azure.mgmt.appplatform.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -919,17 +918,11 @@ async def enable_test_endpoint( return deserialized # type: ignore async def _stop_initial(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - 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), - ), - 409: cast( - Type[HttpResponseError], - lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -962,7 +955,7 @@ async def _stop_initial(self, resource_group_name: str, service_name: str, **kwa 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) # type: ignore + map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -1026,17 +1019,11 @@ 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 async def _start_initial(self, resource_group_name: str, service_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - 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), - ), - 409: cast( - Type[HttpResponseError], - lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -1069,7 +1056,7 @@ async def _start_initial(self, resource_group_name: str, service_name: str, **kw 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) # type: ignore + map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -1135,7 +1122,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _flush_vnet_dns_setting_initial( self, resource_group_name: str, service_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1264,7 +1251,7 @@ def list_supported_apm_types( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SupportedApmTypes] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1341,7 +1328,7 @@ async def list_globally_enabled_apms( :rtype: ~azure.mgmt.appplatform.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1386,7 +1373,7 @@ async def list_globally_enabled_apms( async def _enable_apm_globally_initial( self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1570,7 +1557,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _disable_apm_globally_initial( self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1816,7 +1803,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.appplatform.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1883,7 +1870,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ServiceR api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1960,7 +1947,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2044,7 +2031,7 @@ def list_supported_server_versions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SupportedServerVersions] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_skus_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_skus_operations.py index eac0149874ab..1d86c4fab3a4 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_skus_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_skus_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._skus_operations import build_list_request +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class SkusOperations: 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: AppPlatformManagementClientConfiguration = ( + 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.ResourceSku"]: @@ -69,7 +69,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ResourceSkuCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_storages_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_storages_operations.py index 9079988b75d8..ae069dff52a9 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_storages_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/aio/operations/_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,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._storages_operations import ( build_create_or_update_request, build_delete_request, build_get_request, build_list_request, ) +from .._configuration import AppPlatformManagementClientConfiguration -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,12 @@ class StoragesOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -83,7 +83,7 @@ async def get( :rtype: ~azure.mgmt.appplatform.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -134,7 +134,7 @@ async def _create_or_update_initial( storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +333,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -460,7 +460,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/__init__.py index d524d3aa1d68..191052bf0147 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/__init__.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/__init__.py @@ -5,302 +5,357 @@ # 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 AcceleratorAuthSetting -from ._models_py3 import AcceleratorBasicAuthSetting -from ._models_py3 import AcceleratorGitRepository -from ._models_py3 import AcceleratorPublicSetting -from ._models_py3 import AcceleratorSshSetting -from ._models_py3 import ActiveDeploymentCollection -from ._models_py3 import ApiPortalCustomDomainProperties -from ._models_py3 import ApiPortalCustomDomainResource -from ._models_py3 import ApiPortalCustomDomainResourceCollection -from ._models_py3 import ApiPortalInstance -from ._models_py3 import ApiPortalProperties -from ._models_py3 import ApiPortalResource -from ._models_py3 import ApiPortalResourceCollection -from ._models_py3 import ApiPortalResourceRequests -from ._models_py3 import ApmProperties -from ._models_py3 import ApmReference -from ._models_py3 import ApmResource -from ._models_py3 import ApmResourceCollection -from ._models_py3 import ApmSecretKeys -from ._models_py3 import AppResource -from ._models_py3 import AppResourceCollection -from ._models_py3 import AppResourceProperties -from ._models_py3 import AppVNetAddons -from ._models_py3 import ApplicationAcceleratorComponent -from ._models_py3 import ApplicationAcceleratorInstance -from ._models_py3 import ApplicationAcceleratorProperties -from ._models_py3 import ApplicationAcceleratorResource -from ._models_py3 import ApplicationAcceleratorResourceCollection -from ._models_py3 import ApplicationAcceleratorResourceRequests -from ._models_py3 import ApplicationInsightsAgentVersions -from ._models_py3 import ApplicationLiveViewComponent -from ._models_py3 import ApplicationLiveViewInstance -from ._models_py3 import ApplicationLiveViewProperties -from ._models_py3 import ApplicationLiveViewResource -from ._models_py3 import ApplicationLiveViewResourceCollection -from ._models_py3 import ApplicationLiveViewResourceRequests -from ._models_py3 import AvailableOperations -from ._models_py3 import AvailableRuntimeVersions -from ._models_py3 import AzureFileVolume -from ._models_py3 import BindingResource -from ._models_py3 import BindingResourceCollection -from ._models_py3 import BindingResourceProperties -from ._models_py3 import Build -from ._models_py3 import BuildCollection -from ._models_py3 import BuildProperties -from ._models_py3 import BuildResourceRequests -from ._models_py3 import BuildResult -from ._models_py3 import BuildResultCollection -from ._models_py3 import BuildResultLog -from ._models_py3 import BuildResultProperties -from ._models_py3 import BuildResultUserSourceInfo -from ._models_py3 import BuildService -from ._models_py3 import BuildServiceAgentPoolProperties -from ._models_py3 import BuildServiceAgentPoolResource -from ._models_py3 import BuildServiceAgentPoolResourceCollection -from ._models_py3 import BuildServiceAgentPoolSizeProperties -from ._models_py3 import BuildServiceCollection -from ._models_py3 import BuildServiceProperties -from ._models_py3 import BuildServicePropertiesResourceRequests -from ._models_py3 import BuildStageProperties -from ._models_py3 import BuilderProperties -from ._models_py3 import BuilderResource -from ._models_py3 import BuilderResourceCollection -from ._models_py3 import BuildpackBindingLaunchProperties -from ._models_py3 import BuildpackBindingProperties -from ._models_py3 import BuildpackBindingResource -from ._models_py3 import BuildpackBindingResourceCollection -from ._models_py3 import BuildpackProperties -from ._models_py3 import BuildpacksGroupProperties -from ._models_py3 import CertificateProperties -from ._models_py3 import CertificateReference -from ._models_py3 import CertificateResource -from ._models_py3 import CertificateResourceCollection -from ._models_py3 import CloudErrorBody -from ._models_py3 import ClusterResourceProperties -from ._models_py3 import ConfigServerGitProperty -from ._models_py3 import ConfigServerProperties -from ._models_py3 import ConfigServerResource -from ._models_py3 import ConfigServerSettings -from ._models_py3 import ConfigServerSettingsErrorRecord -from ._models_py3 import ConfigServerSettingsValidateResult -from ._models_py3 import ConfigurationServiceGitProperty -from ._models_py3 import ConfigurationServiceGitPropertyValidateResult -from ._models_py3 import ConfigurationServiceGitRepository -from ._models_py3 import ConfigurationServiceInstance -from ._models_py3 import ConfigurationServiceProperties -from ._models_py3 import ConfigurationServiceResource -from ._models_py3 import ConfigurationServiceResourceCollection -from ._models_py3 import ConfigurationServiceResourceRequests -from ._models_py3 import ConfigurationServiceSettings -from ._models_py3 import ConfigurationServiceSettingsValidateResult -from ._models_py3 import ContainerProbeSettings -from ._models_py3 import ContainerRegistryBasicCredentials -from ._models_py3 import ContainerRegistryCredentials -from ._models_py3 import ContainerRegistryProperties -from ._models_py3 import ContainerRegistryResource -from ._models_py3 import ContainerRegistryResourceCollection -from ._models_py3 import ContainerRegistryValidateResult -from ._models_py3 import ContentCertificateProperties -from ._models_py3 import CustomContainer -from ._models_py3 import CustomContainerUserSourceInfo -from ._models_py3 import CustomDomainProperties -from ._models_py3 import CustomDomainResource -from ._models_py3 import CustomDomainResourceCollection -from ._models_py3 import CustomDomainValidatePayload -from ._models_py3 import CustomDomainValidateResult -from ._models_py3 import CustomPersistentDiskProperties -from ._models_py3 import CustomPersistentDiskResource -from ._models_py3 import CustomizedAcceleratorProperties -from ._models_py3 import CustomizedAcceleratorResource -from ._models_py3 import CustomizedAcceleratorResourceCollection -from ._models_py3 import CustomizedAcceleratorValidateResult -from ._models_py3 import DeploymentInstance -from ._models_py3 import DeploymentList -from ._models_py3 import DeploymentResource -from ._models_py3 import DeploymentResourceCollection -from ._models_py3 import DeploymentResourceProperties -from ._models_py3 import DeploymentSettings -from ._models_py3 import DevToolPortalComponent -from ._models_py3 import DevToolPortalFeatureDetail -from ._models_py3 import DevToolPortalFeatureSettings -from ._models_py3 import DevToolPortalInstance -from ._models_py3 import DevToolPortalProperties -from ._models_py3 import DevToolPortalResource -from ._models_py3 import DevToolPortalResourceCollection -from ._models_py3 import DevToolPortalResourceRequests -from ._models_py3 import DevToolPortalSsoProperties -from ._models_py3 import DiagnosticParameters -from ._models_py3 import Error -from ._models_py3 import ExecAction -from ._models_py3 import GatewayApiMetadataProperties -from ._models_py3 import GatewayApiRoute -from ._models_py3 import GatewayCorsProperties -from ._models_py3 import GatewayCustomDomainProperties -from ._models_py3 import GatewayCustomDomainResource -from ._models_py3 import GatewayCustomDomainResourceCollection -from ._models_py3 import GatewayInstance -from ._models_py3 import GatewayOperatorProperties -from ._models_py3 import GatewayOperatorResourceRequests -from ._models_py3 import GatewayProperties -from ._models_py3 import GatewayPropertiesClientAuth -from ._models_py3 import GatewayPropertiesEnvironmentVariables -from ._models_py3 import GatewayResource -from ._models_py3 import GatewayResourceCollection -from ._models_py3 import GatewayResourceRequests -from ._models_py3 import GatewayRouteConfigOpenApiProperties -from ._models_py3 import GatewayRouteConfigProperties -from ._models_py3 import GatewayRouteConfigResource -from ._models_py3 import GatewayRouteConfigResourceCollection -from ._models_py3 import GitPatternRepository -from ._models_py3 import GloballyEnabledApms -from ._models_py3 import HTTPGetAction -from ._models_py3 import ImageRegistryCredential -from ._models_py3 import IngressConfig -from ._models_py3 import IngressSettings -from ._models_py3 import IngressSettingsClientAuth -from ._models_py3 import JarUploadedUserSourceInfo -from ._models_py3 import KeyVaultCertificateProperties -from ._models_py3 import LoadedCertificate -from ._models_py3 import LogFileUrlResponse -from ._models_py3 import LogSpecification -from ._models_py3 import ManagedIdentityProperties -from ._models_py3 import MarketplaceResource -from ._models_py3 import MetricDimension -from ._models_py3 import MetricSpecification -from ._models_py3 import MonitoringSettingProperties -from ._models_py3 import MonitoringSettingResource -from ._models_py3 import NameAvailability -from ._models_py3 import NameAvailabilityParameters -from ._models_py3 import NetCoreZipUploadedUserSourceInfo -from ._models_py3 import NetworkProfile -from ._models_py3 import NetworkProfileOutboundIPs -from ._models_py3 import OperationDetail -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationProperties -from ._models_py3 import PersistentDisk -from ._models_py3 import PredefinedAcceleratorProperties -from ._models_py3 import PredefinedAcceleratorResource -from ._models_py3 import PredefinedAcceleratorResourceCollection -from ._models_py3 import Probe -from ._models_py3 import ProbeAction -from ._models_py3 import ProxyResource -from ._models_py3 import RegenerateTestKeyRequestPayload -from ._models_py3 import RemoteDebugging -from ._models_py3 import RemoteDebuggingPayload -from ._models_py3 import RequiredTraffic -from ._models_py3 import Resource -from ._models_py3 import ResourceRequests -from ._models_py3 import ResourceSku -from ._models_py3 import ResourceSkuCapabilities -from ._models_py3 import ResourceSkuCollection -from ._models_py3 import ResourceSkuLocationInfo -from ._models_py3 import ResourceSkuRestrictionInfo -from ._models_py3 import ResourceSkuRestrictions -from ._models_py3 import ResourceSkuZoneDetails -from ._models_py3 import ResourceUploadDefinition -from ._models_py3 import ServiceRegistryInstance -from ._models_py3 import ServiceRegistryProperties -from ._models_py3 import ServiceRegistryResource -from ._models_py3 import ServiceRegistryResourceCollection -from ._models_py3 import ServiceRegistryResourceRequests -from ._models_py3 import ServiceResource -from ._models_py3 import ServiceResourceList -from ._models_py3 import ServiceSpecification -from ._models_py3 import ServiceVNetAddons -from ._models_py3 import Sku -from ._models_py3 import SkuCapacity -from ._models_py3 import SkuObject -from ._models_py3 import SourceUploadedUserSourceInfo -from ._models_py3 import SsoProperties -from ._models_py3 import StackProperties -from ._models_py3 import StorageAccount -from ._models_py3 import StorageProperties -from ._models_py3 import StorageResource -from ._models_py3 import StorageResourceCollection -from ._models_py3 import SupportedApmType -from ._models_py3 import SupportedApmTypes -from ._models_py3 import SupportedBuildpackResource -from ._models_py3 import SupportedBuildpackResourceProperties -from ._models_py3 import SupportedBuildpacksCollection -from ._models_py3 import SupportedRuntimeVersion -from ._models_py3 import SupportedServerVersion -from ._models_py3 import SupportedServerVersions -from ._models_py3 import SupportedStackResource -from ._models_py3 import SupportedStackResourceProperties -from ._models_py3 import SupportedStacksCollection -from ._models_py3 import SystemData -from ._models_py3 import TCPSocketAction -from ._models_py3 import TemporaryDisk -from ._models_py3 import TestKeys -from ._models_py3 import TrackedResource -from ._models_py3 import TriggeredBuildResult -from ._models_py3 import UploadedUserSourceInfo -from ._models_py3 import UserAssignedManagedIdentity -from ._models_py3 import UserSourceInfo -from ._models_py3 import ValidationMessages -from ._models_py3 import WarUploadedUserSourceInfo +from typing import TYPE_CHECKING -from ._app_platform_management_client_enums import ActionType -from ._app_platform_management_client_enums import ApiPortalApiTryOutEnabledState -from ._app_platform_management_client_enums import ApiPortalProvisioningState -from ._app_platform_management_client_enums import ApmProvisioningState -from ._app_platform_management_client_enums import AppResourceProvisioningState -from ._app_platform_management_client_enums import ApplicationAcceleratorProvisioningState -from ._app_platform_management_client_enums import ApplicationLiveViewProvisioningState -from ._app_platform_management_client_enums import BackendProtocol -from ._app_platform_management_client_enums import BindingType -from ._app_platform_management_client_enums import BuildProvisioningState -from ._app_platform_management_client_enums import BuildResultProvisioningState -from ._app_platform_management_client_enums import BuildServiceProvisioningState -from ._app_platform_management_client_enums import BuilderProvisioningState -from ._app_platform_management_client_enums import BuildpackBindingProvisioningState -from ._app_platform_management_client_enums import CertificateResourceProvisioningState -from ._app_platform_management_client_enums import ConfigServerState -from ._app_platform_management_client_enums import ConfigurationServiceGeneration -from ._app_platform_management_client_enums import ConfigurationServiceProvisioningState -from ._app_platform_management_client_enums import ContainerRegistryProvisioningState -from ._app_platform_management_client_enums import CreatedByType -from ._app_platform_management_client_enums import CustomDomainResourceProvisioningState -from ._app_platform_management_client_enums import CustomizedAcceleratorProvisioningState -from ._app_platform_management_client_enums import CustomizedAcceleratorType -from ._app_platform_management_client_enums import CustomizedAcceleratorValidateResultState -from ._app_platform_management_client_enums import DeploymentResourceProvisioningState -from ._app_platform_management_client_enums import DeploymentResourceStatus -from ._app_platform_management_client_enums import DevToolPortalFeatureState -from ._app_platform_management_client_enums import DevToolPortalProvisioningState -from ._app_platform_management_client_enums import GatewayCertificateVerification -from ._app_platform_management_client_enums import GatewayProvisioningState -from ._app_platform_management_client_enums import GatewayRouteConfigProtocol -from ._app_platform_management_client_enums import GitImplementation -from ._app_platform_management_client_enums import HTTPSchemeType -from ._app_platform_management_client_enums import KPackBuildStageProvisioningState -from ._app_platform_management_client_enums import KeyVaultCertificateAutoSync -from ._app_platform_management_client_enums import LastModifiedByType -from ._app_platform_management_client_enums import ManagedIdentityType -from ._app_platform_management_client_enums import MonitoringSettingState -from ._app_platform_management_client_enums import PowerState -from ._app_platform_management_client_enums import PredefinedAcceleratorProvisioningState -from ._app_platform_management_client_enums import PredefinedAcceleratorState -from ._app_platform_management_client_enums import ProbeActionType -from ._app_platform_management_client_enums import ProvisioningState -from ._app_platform_management_client_enums import ResourceSkuRestrictionsReasonCode -from ._app_platform_management_client_enums import ResourceSkuRestrictionsType -from ._app_platform_management_client_enums import ServiceRegistryProvisioningState -from ._app_platform_management_client_enums import SessionAffinity -from ._app_platform_management_client_enums import SkuScaleType -from ._app_platform_management_client_enums import StorageType -from ._app_platform_management_client_enums import SupportedRuntimePlatform -from ._app_platform_management_client_enums import SupportedRuntimeValue -from ._app_platform_management_client_enums import TestKeyType -from ._app_platform_management_client_enums import TrafficDirection -from ._app_platform_management_client_enums import TriggeredBuildResultProvisioningState -from ._app_platform_management_client_enums import Type +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models_py3 import ( # type: ignore + AcceleratorAuthSetting, + AcceleratorBasicAuthSetting, + AcceleratorGitRepository, + AcceleratorPublicSetting, + AcceleratorSshSetting, + ActiveDeploymentCollection, + ApiPortalCustomDomainProperties, + ApiPortalCustomDomainResource, + ApiPortalCustomDomainResourceCollection, + ApiPortalInstance, + ApiPortalProperties, + ApiPortalResource, + ApiPortalResourceCollection, + ApiPortalResourceRequests, + ApmProperties, + ApmReference, + ApmResource, + ApmResourceCollection, + ApmSecretKeys, + AppResource, + AppResourceCollection, + AppResourceProperties, + AppVNetAddons, + ApplicationAcceleratorComponent, + ApplicationAcceleratorInstance, + ApplicationAcceleratorProperties, + ApplicationAcceleratorResource, + ApplicationAcceleratorResourceCollection, + ApplicationAcceleratorResourceRequests, + ApplicationInsightsAgentVersions, + ApplicationLiveViewComponent, + ApplicationLiveViewInstance, + ApplicationLiveViewProperties, + ApplicationLiveViewResource, + ApplicationLiveViewResourceCollection, + ApplicationLiveViewResourceRequests, + AvailableOperations, + AvailableRuntimeVersions, + AzureFileVolume, + BindingResource, + BindingResourceCollection, + BindingResourceProperties, + Build, + BuildCollection, + BuildProperties, + BuildResourceRequests, + BuildResult, + BuildResultCollection, + BuildResultLog, + BuildResultProperties, + BuildResultUserSourceInfo, + BuildService, + BuildServiceAgentPoolProperties, + BuildServiceAgentPoolResource, + BuildServiceAgentPoolResourceCollection, + BuildServiceAgentPoolSizeProperties, + BuildServiceCollection, + BuildServiceProperties, + BuildServicePropertiesResourceRequests, + BuildStageProperties, + BuilderProperties, + BuilderResource, + BuilderResourceCollection, + BuildpackBindingLaunchProperties, + BuildpackBindingProperties, + BuildpackBindingResource, + BuildpackBindingResourceCollection, + BuildpackProperties, + BuildpacksGroupProperties, + CertificateProperties, + CertificateReference, + CertificateResource, + CertificateResourceCollection, + CloudErrorBody, + ClusterResourceProperties, + ConfigServerGitProperty, + ConfigServerInstance, + ConfigServerProperties, + ConfigServerResource, + ConfigServerResourceCollection, + ConfigServerResourceRequests, + ConfigServerSettings, + ConfigServerSettingsErrorRecord, + ConfigServerSettingsValidateResult, + ConfigurationServiceGitProperty, + ConfigurationServiceGitPropertyValidateResult, + ConfigurationServiceGitRepository, + ConfigurationServiceInstance, + ConfigurationServiceProperties, + ConfigurationServiceResource, + ConfigurationServiceResourceCollection, + ConfigurationServiceResourceRequests, + ConfigurationServiceSettings, + ConfigurationServiceSettingsValidateResult, + ContainerProbeSettings, + ContainerRegistryBasicCredentials, + ContainerRegistryCredentials, + ContainerRegistryProperties, + ContainerRegistryResource, + ContainerRegistryResourceCollection, + ContainerRegistryValidateResult, + ContentCertificateProperties, + CustomContainer, + CustomContainerUserSourceInfo, + CustomDomainProperties, + CustomDomainResource, + CustomDomainResourceCollection, + CustomDomainValidatePayload, + CustomDomainValidateResult, + CustomPersistentDiskProperties, + CustomPersistentDiskResource, + CustomScaleRule, + CustomizedAcceleratorProperties, + CustomizedAcceleratorResource, + CustomizedAcceleratorResourceCollection, + CustomizedAcceleratorValidateResult, + DeploymentInstance, + DeploymentList, + DeploymentResource, + DeploymentResourceCollection, + DeploymentResourceProperties, + DeploymentSettings, + DevToolPortalComponent, + DevToolPortalFeatureDetail, + DevToolPortalFeatureSettings, + DevToolPortalInstance, + DevToolPortalProperties, + DevToolPortalResource, + DevToolPortalResourceCollection, + DevToolPortalResourceRequests, + DevToolPortalSsoProperties, + DiagnosticParameters, + EnvSecretsCollection, + EnvVar, + Error, + EurekaServerProperties, + EurekaServerResource, + EurekaServerResourceCollection, + ExecAction, + GatewayApiMetadataProperties, + GatewayApiRoute, + GatewayCorsProperties, + GatewayCustomDomainProperties, + GatewayCustomDomainResource, + GatewayCustomDomainResourceCollection, + GatewayInstance, + GatewayLocalResponseCachePerInstanceProperties, + GatewayLocalResponseCachePerRouteProperties, + GatewayOperatorProperties, + GatewayOperatorResourceRequests, + GatewayProperties, + GatewayPropertiesClientAuth, + GatewayPropertiesEnvironmentVariables, + GatewayResource, + GatewayResourceCollection, + GatewayResourceRequests, + GatewayResponseCacheProperties, + GatewayRouteConfigOpenApiProperties, + GatewayRouteConfigProperties, + GatewayRouteConfigResource, + GatewayRouteConfigResourceCollection, + GitPatternRepository, + GloballyEnabledApms, + HTTPGetAction, + HttpScaleRule, + ImageRegistryCredential, + IngressConfig, + IngressSettings, + IngressSettingsClientAuth, + JarUploadedUserSourceInfo, + JobExecution, + JobExecutionCollection, + JobExecutionTemplate, + JobResource, + JobResourceCollection, + JobResourceProperties, + JobResourceRequests, + JobTriggerConfig, + KeyVaultCertificateProperties, + LoadedCertificate, + LogFileUrlResponse, + LogSpecification, + MaintenanceScheduleConfiguration, + ManagedComponentReference, + ManagedIdentityProperties, + ManualJobTriggerConfig, + MarketplaceResource, + MetricDimension, + MetricSpecification, + MonitoringSettingProperties, + MonitoringSettingResource, + NameAvailability, + NameAvailabilityParameters, + NetCoreZipUploadedUserSourceInfo, + NetworkProfile, + NetworkProfileOutboundIPs, + OperationDetail, + OperationDisplay, + OperationProperties, + PersistentDisk, + PredefinedAcceleratorProperties, + PredefinedAcceleratorResource, + PredefinedAcceleratorResourceCollection, + Probe, + ProbeAction, + ProxyResource, + QueueScaleRule, + RegenerateTestKeyRequestPayload, + RemoteDebugging, + RemoteDebuggingPayload, + RequiredTraffic, + Resource, + ResourceRequests, + ResourceSku, + ResourceSkuCapabilities, + ResourceSkuCollection, + ResourceSkuLocationInfo, + ResourceSkuRestrictionInfo, + ResourceSkuRestrictions, + ResourceSkuZoneDetails, + ResourceUploadDefinition, + Scale, + ScaleRule, + ScaleRuleAuth, + Secret, + ServiceRegistryInstance, + ServiceRegistryProperties, + ServiceRegistryResource, + ServiceRegistryResourceCollection, + ServiceRegistryResourceRequests, + ServiceResource, + ServiceResourceList, + ServiceSpecification, + ServiceVNetAddons, + Sku, + SkuCapacity, + SkuObject, + SourceUploadedUserSourceInfo, + SsoProperties, + StackProperties, + StorageAccount, + StorageProperties, + StorageResource, + StorageResourceCollection, + SupportedApmType, + SupportedApmTypes, + SupportedBuildpackResource, + SupportedBuildpackResourceProperties, + SupportedBuildpacksCollection, + SupportedRuntimeVersion, + SupportedServerVersion, + SupportedServerVersions, + SupportedStackResource, + SupportedStackResourceProperties, + SupportedStacksCollection, + SystemAssignedServiceIdentity, + SystemData, + TCPSocketAction, + TcpScaleRule, + TemporaryDisk, + TestKeys, + TrackedResource, + TriggeredBuildResult, + UploadedUserSourceInfo, + UserAssignedManagedIdentity, + UserSourceInfo, + ValidationMessages, + WarUploadedUserSourceInfo, + WeeklyMaintenanceScheduleConfiguration, +) + +from ._app_platform_management_client_enums import ( # type: ignore + ActionType, + ApiPortalApiTryOutEnabledState, + ApiPortalProvisioningState, + ApmProvisioningState, + ApmType, + AppResourceProvisioningState, + ApplicationAcceleratorProvisioningState, + ApplicationLiveViewProvisioningState, + BackendProtocol, + BindingType, + BuildProvisioningState, + BuildResultProvisioningState, + BuildServiceProvisioningState, + BuilderProvisioningState, + BuildpackBindingProvisioningState, + CertificateResourceProvisioningState, + ConfigServerEnabledState, + ConfigServerState, + ConfigurationServiceGeneration, + ConfigurationServiceProvisioningState, + ContainerRegistryProvisioningState, + CreatedByType, + CustomDomainResourceProvisioningState, + CustomizedAcceleratorProvisioningState, + CustomizedAcceleratorType, + CustomizedAcceleratorValidateResultState, + DeploymentResourceProvisioningState, + DeploymentResourceStatus, + DevToolPortalFeatureState, + DevToolPortalProvisioningState, + EurekaServerEnabledState, + EurekaServerState, + Frequency, + GatewayCertificateVerification, + GatewayProvisioningState, + GatewayRouteConfigProtocol, + GitImplementation, + HTTPSchemeType, + JobExecutionRunningState, + JobResourceProvisioningState, + KPackBuildStageProvisioningState, + KeyVaultCertificateAutoSync, + LastModifiedByType, + ManagedIdentityType, + MonitoringSettingState, + PowerState, + PredefinedAcceleratorProvisioningState, + PredefinedAcceleratorState, + PrivateStorageAccess, + ProbeActionType, + ProvisioningState, + ResourceSkuRestrictionsReasonCode, + ResourceSkuRestrictionsType, + ServiceRegistryProvisioningState, + SessionAffinity, + SkuScaleType, + StorageType, + SupportedRuntimePlatform, + SupportedRuntimeValue, + SystemAssignedServiceIdentityType, + TestEndpointAuthState, + TestKeyType, + TrafficDirection, + TriggerType, + TriggeredBuildResultProvisioningState, + Type, + WeekDay, +) 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__ = [ @@ -380,8 +435,11 @@ "CloudErrorBody", "ClusterResourceProperties", "ConfigServerGitProperty", + "ConfigServerInstance", "ConfigServerProperties", "ConfigServerResource", + "ConfigServerResourceCollection", + "ConfigServerResourceRequests", "ConfigServerSettings", "ConfigServerSettingsErrorRecord", "ConfigServerSettingsValidateResult", @@ -412,6 +470,7 @@ "CustomDomainValidateResult", "CustomPersistentDiskProperties", "CustomPersistentDiskResource", + "CustomScaleRule", "CustomizedAcceleratorProperties", "CustomizedAcceleratorResource", "CustomizedAcceleratorResourceCollection", @@ -432,7 +491,12 @@ "DevToolPortalResourceRequests", "DevToolPortalSsoProperties", "DiagnosticParameters", + "EnvSecretsCollection", + "EnvVar", "Error", + "EurekaServerProperties", + "EurekaServerResource", + "EurekaServerResourceCollection", "ExecAction", "GatewayApiMetadataProperties", "GatewayApiRoute", @@ -441,6 +505,8 @@ "GatewayCustomDomainResource", "GatewayCustomDomainResourceCollection", "GatewayInstance", + "GatewayLocalResponseCachePerInstanceProperties", + "GatewayLocalResponseCachePerRouteProperties", "GatewayOperatorProperties", "GatewayOperatorResourceRequests", "GatewayProperties", @@ -449,6 +515,7 @@ "GatewayResource", "GatewayResourceCollection", "GatewayResourceRequests", + "GatewayResponseCacheProperties", "GatewayRouteConfigOpenApiProperties", "GatewayRouteConfigProperties", "GatewayRouteConfigResource", @@ -456,16 +523,28 @@ "GitPatternRepository", "GloballyEnabledApms", "HTTPGetAction", + "HttpScaleRule", "ImageRegistryCredential", "IngressConfig", "IngressSettings", "IngressSettingsClientAuth", "JarUploadedUserSourceInfo", + "JobExecution", + "JobExecutionCollection", + "JobExecutionTemplate", + "JobResource", + "JobResourceCollection", + "JobResourceProperties", + "JobResourceRequests", + "JobTriggerConfig", "KeyVaultCertificateProperties", "LoadedCertificate", "LogFileUrlResponse", "LogSpecification", + "MaintenanceScheduleConfiguration", + "ManagedComponentReference", "ManagedIdentityProperties", + "ManualJobTriggerConfig", "MarketplaceResource", "MetricDimension", "MetricSpecification", @@ -486,6 +565,7 @@ "Probe", "ProbeAction", "ProxyResource", + "QueueScaleRule", "RegenerateTestKeyRequestPayload", "RemoteDebugging", "RemoteDebuggingPayload", @@ -500,6 +580,10 @@ "ResourceSkuRestrictions", "ResourceSkuZoneDetails", "ResourceUploadDefinition", + "Scale", + "ScaleRule", + "ScaleRuleAuth", + "Secret", "ServiceRegistryInstance", "ServiceRegistryProperties", "ServiceRegistryResource", @@ -530,8 +614,10 @@ "SupportedStackResource", "SupportedStackResourceProperties", "SupportedStacksCollection", + "SystemAssignedServiceIdentity", "SystemData", "TCPSocketAction", + "TcpScaleRule", "TemporaryDisk", "TestKeys", "TrackedResource", @@ -541,10 +627,12 @@ "UserSourceInfo", "ValidationMessages", "WarUploadedUserSourceInfo", + "WeeklyMaintenanceScheduleConfiguration", "ActionType", "ApiPortalApiTryOutEnabledState", "ApiPortalProvisioningState", "ApmProvisioningState", + "ApmType", "AppResourceProvisioningState", "ApplicationAcceleratorProvisioningState", "ApplicationLiveViewProvisioningState", @@ -556,6 +644,7 @@ "BuilderProvisioningState", "BuildpackBindingProvisioningState", "CertificateResourceProvisioningState", + "ConfigServerEnabledState", "ConfigServerState", "ConfigurationServiceGeneration", "ConfigurationServiceProvisioningState", @@ -569,11 +658,16 @@ "DeploymentResourceStatus", "DevToolPortalFeatureState", "DevToolPortalProvisioningState", + "EurekaServerEnabledState", + "EurekaServerState", + "Frequency", "GatewayCertificateVerification", "GatewayProvisioningState", "GatewayRouteConfigProtocol", "GitImplementation", "HTTPSchemeType", + "JobExecutionRunningState", + "JobResourceProvisioningState", "KPackBuildStageProvisioningState", "KeyVaultCertificateAutoSync", "LastModifiedByType", @@ -582,6 +676,7 @@ "PowerState", "PredefinedAcceleratorProvisioningState", "PredefinedAcceleratorState", + "PrivateStorageAccess", "ProbeActionType", "ProvisioningState", "ResourceSkuRestrictionsReasonCode", @@ -592,10 +687,14 @@ "StorageType", "SupportedRuntimePlatform", "SupportedRuntimeValue", + "SystemAssignedServiceIdentityType", + "TestEndpointAuthState", "TestKeyType", "TrafficDirection", + "TriggerType", "TriggeredBuildResultProvisioningState", "Type", + "WeekDay", ] -__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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/_app_platform_management_client_enums.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/_app_platform_management_client_enums.py index d313358c1657..0798f5d85f16 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/_app_platform_management_client_enums.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/_app_platform_management_client_enums.py @@ -47,6 +47,16 @@ class ApmProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): CANCELED = "Canceled" +class ApmType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of application performance monitoring.""" + + APPLICATION_INSIGHTS = "ApplicationInsights" + APP_DYNAMICS = "AppDynamics" + DYNATRACE = "Dynatrace" + NEW_RELIC = "NewRelic" + ELASTIC_APM = "ElasticAPM" + + class ApplicationAcceleratorProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the application accelerator.""" @@ -95,6 +105,7 @@ class BindingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): DYNATRACE = "Dynatrace" NEW_RELIC = "NewRelic" ELASTIC_APM = "ElasticAPM" + CA_CERTIFICATES = "CACertificates" class BuilderProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -157,14 +168,25 @@ class CertificateResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveE DELETING = "Deleting" +class ConfigServerEnabledState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enabled state of the config server. This is only used in Consumption tier.""" + + ENABLED = "Enabled" + """Enable the config server.""" + DISABLED = "Disabled" + """Disable the config server.""" + + class ConfigServerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the config server.""" NOT_AVAILABLE = "NotAvailable" + CREATING = "Creating" DELETED = "Deleted" FAILED = "Failed" SUCCEEDED = "Succeeded" UPDATING = "Updating" + DELETING = "Deleting" class ConfigurationServiceGeneration(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -277,6 +299,30 @@ class DevToolPortalProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMet CANCELED = "Canceled" +class EurekaServerEnabledState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enabled state of the eureka server. This is only used in Consumption tier.""" + + ENABLED = "Enabled" + """Enable the eureka server.""" + DISABLED = "Disabled" + """Disable the eureka server.""" + + +class EurekaServerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the eureka server.""" + + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + CANCELED = "Canceled" + + +class Frequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The frequency to run the maintenance job.""" + + WEEKLY = "Weekly" + + class GatewayCertificateVerification(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Whether to enable certificate verification or not.""" @@ -324,6 +370,27 @@ class HTTPSchemeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): HTTPS = "HTTPS" +class JobExecutionRunningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current state of the job execution.""" + + RUNNING = "Running" + PENDING = "Pending" + CANCELED = "Canceled" + FAILED = "Failed" + COMPLETED = "Completed" + + +class JobResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the Job.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + CANCELED = "Canceled" + + class KeyVaultCertificateAutoSync(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates whether to automatically synchronize certificate from key vault or not.""" @@ -393,6 +460,15 @@ class PredefinedAcceleratorState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Disable the predefined accelerator.""" +class PrivateStorageAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates whether the vnet injection service enables private links for backend storage account + and container registry. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + + class ProbeActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of the action to take to perform the health check.""" @@ -477,9 +553,26 @@ class SupportedRuntimeValue(str, Enum, metaclass=CaseInsensitiveEnumMeta): JAVA8 = "Java_8" JAVA11 = "Java_11" JAVA17 = "Java_17" + JAVA21 = "Java_21" NET_CORE31 = "NetCore_31" +class SystemAssignedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (either system assigned, or none).""" + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + + +class TestEndpointAuthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of test endpoint auth.""" + + ENABLED = "Enabled" + """Enable test endpoint auth.""" + DISABLED = "Disabled" + """Disable test endpoint auth""" + + class TestKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the test key.""" @@ -505,7 +598,25 @@ class TriggeredBuildResultProvisioningState(str, Enum, metaclass=CaseInsensitive CANCELED = "Canceled" +class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of job trigger.""" + + MANUAL = "Manual" + + class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of the underlying resource to mount as a persistent disk.""" AZURE_FILE_VOLUME = "AzureFileVolume" + + +class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The day to run the maintenance job.""" + + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + SUNDAY = "Sunday" diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/_models_py3.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/_models_py3.py index 497b1d54a1a6..1b2613c5fcd8 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/_models_py3.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/models/_models_py3.py @@ -1,5 +1,5 @@ -# coding=utf-8 # pylint: disable=too-many-lines +# 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. @@ -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, 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 AcceleratorAuthSetting(_serialization.Model): @@ -330,10 +324,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): @@ -455,8 +449,8 @@ class ApiPortalInstance(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.status = None + self.name: Optional[str] = None + self.status: Optional[str] = None class ApiPortalProperties(_serialization.Model): @@ -541,15 +535,15 @@ def __init__( ~azure.mgmt.appplatform.models.ApiPortalApiTryOutEnabledState """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.ApiPortalProvisioningState"]] = None self.public = public - self.url = None + self.url: Optional[str] = None self.https_only = https_only self.gateway_ids = gateway_ids self.source_urls = source_urls self.sso_properties = sso_properties - self.resource_requests = None - self.instances = None + self.resource_requests: Optional["_models.ApiPortalResourceRequests"] = None + self.instances: Optional[List["_models.ApiPortalInstance"]] = None self.api_try_out_enabled_state = api_try_out_enabled_state @@ -645,7 +639,7 @@ class ApiPortalResourceRequests(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar cpu: Cpu allocated to each API portal instance. + :ivar cpu: CPU allocated to each API portal instance. :vartype cpu: str :ivar memory: Memory allocated to each API portal instance. :vartype memory: str @@ -664,8 +658,8 @@ class ApiPortalResourceRequests(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.cpu = None - self.memory = None + self.cpu: Optional[str] = None + self.memory: Optional[str] = None class ApmProperties(_serialization.Model): @@ -716,7 +710,7 @@ def __init__( """ super().__init__(**kwargs) self.type = type - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.ApmProvisioningState"]] = None self.properties = properties self.secrets = secrets @@ -872,9 +866,9 @@ def __init__( ~azure.mgmt.appplatform.models.ApplicationAcceleratorResourceRequests """ super().__init__(**kwargs) - self.name = None + self.name: Optional[str] = None self.resource_requests = resource_requests - self.instances = None + self.instances: Optional[List["_models.ApplicationAcceleratorInstance"]] = None class ApplicationAcceleratorInstance(_serialization.Model): @@ -902,8 +896,8 @@ class ApplicationAcceleratorInstance(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.status = None + self.name: Optional[str] = None + self.status: Optional[str] = None class ApplicationAcceleratorProperties(_serialization.Model): @@ -932,8 +926,8 @@ class ApplicationAcceleratorProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_state = None - self.components = None + self.provisioning_state: Optional[Union[str, "_models.ApplicationAcceleratorProvisioningState"]] = None + self.components: Optional[List["_models.ApplicationAcceleratorComponent"]] = None class ApplicationAcceleratorResource(ProxyResource): @@ -1029,7 +1023,7 @@ class ApplicationAcceleratorResourceRequests(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar cpu: Cpu allocated to each application accelerator component. 1 core can be represented + :ivar cpu: CPU allocated to each application accelerator component. 1 core can be represented by 1 or 1000m. :vartype cpu: str :ivar memory: Memory allocated to each application accelerator component. 1 GB can be @@ -1054,9 +1048,9 @@ class ApplicationAcceleratorResourceRequests(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.cpu = None - self.memory = None - self.instance_count = None + self.cpu: Optional[str] = None + self.memory: Optional[str] = None + self.instance_count: Optional[int] = None class ApplicationInsightsAgentVersions(_serialization.Model): @@ -1079,7 +1073,7 @@ class ApplicationInsightsAgentVersions(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.java = None + self.java: Optional[str] = None class ApplicationLiveViewComponent(_serialization.Model): @@ -1110,9 +1104,9 @@ class ApplicationLiveViewComponent(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.resource_requests = None - self.instances = None + self.name: Optional[Any] = None + self.resource_requests: Optional["_models.ApplicationLiveViewResourceRequests"] = None + self.instances: Optional[List["_models.ApplicationLiveViewInstance"]] = None class ApplicationLiveViewInstance(_serialization.Model): @@ -1140,8 +1134,8 @@ class ApplicationLiveViewInstance(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.status = None + self.name: Optional[str] = None + self.status: Optional[str] = None class ApplicationLiveViewProperties(_serialization.Model): @@ -1170,8 +1164,8 @@ class ApplicationLiveViewProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_state = None - self.components = None + self.provisioning_state: Optional[Union[str, "_models.ApplicationLiveViewProvisioningState"]] = None + self.components: Optional[List["_models.ApplicationLiveViewComponent"]] = None class ApplicationLiveViewResource(ProxyResource): @@ -1280,9 +1274,9 @@ class ApplicationLiveViewResourceRequests(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.cpu = None - self.memory = None - self.instance_count = None + self.cpu: Optional[str] = None + self.memory: Optional[str] = None + self.instance_count: Optional[int] = None class AppResource(ProxyResource): @@ -1376,7 +1370,7 @@ def __init__( self.next_link = next_link -class AppResourceProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes +class AppResourceProperties(_serialization.Model): """App resource properties payload. Variables are only populated by the server, and will be ignored when sending a request. @@ -1409,6 +1403,14 @@ class AppResourceProperties(_serialization.Model): # pylint: disable=too-many-i :vartype vnet_addons: ~azure.mgmt.appplatform.models.AppVNetAddons :ivar ingress_settings: App ingress settings payload. :vartype ingress_settings: ~azure.mgmt.appplatform.models.IngressSettings + :ivar secrets: Collection of auth secrets. + :vartype secrets: list[~azure.mgmt.appplatform.models.Secret] + :ivar workload_profile_name: The workload profile used for this app. Supported for Consumption + + Dedicated plan. + :vartype workload_profile_name: str + :ivar test_endpoint_auth_state: State of test endpoint auth. Known values are: "Enabled" and + "Disabled". + :vartype test_endpoint_auth_state: str or ~azure.mgmt.appplatform.models.TestEndpointAuthState """ _validation = { @@ -1431,6 +1433,9 @@ class AppResourceProperties(_serialization.Model): # pylint: disable=too-many-i "loaded_certificates": {"key": "loadedCertificates", "type": "[LoadedCertificate]"}, "vnet_addons": {"key": "vnetAddons", "type": "AppVNetAddons"}, "ingress_settings": {"key": "ingressSettings", "type": "IngressSettings"}, + "secrets": {"key": "secrets", "type": "[Secret]"}, + "workload_profile_name": {"key": "workloadProfileName", "type": "str"}, + "test_endpoint_auth_state": {"key": "testEndpointAuthState", "type": "str"}, } def __init__( @@ -1446,6 +1451,9 @@ def __init__( loaded_certificates: Optional[List["_models.LoadedCertificate"]] = None, vnet_addons: Optional["_models.AppVNetAddons"] = None, ingress_settings: Optional["_models.IngressSettings"] = None, + secrets: Optional[List["_models.Secret"]] = None, + workload_profile_name: Optional[str] = None, + test_endpoint_auth_state: Union[str, "_models.TestEndpointAuthState"] = "Enabled", **kwargs: Any ) -> None: """ @@ -1470,13 +1478,22 @@ def __init__( :paramtype vnet_addons: ~azure.mgmt.appplatform.models.AppVNetAddons :keyword ingress_settings: App ingress settings payload. :paramtype ingress_settings: ~azure.mgmt.appplatform.models.IngressSettings + :keyword secrets: Collection of auth secrets. + :paramtype secrets: list[~azure.mgmt.appplatform.models.Secret] + :keyword workload_profile_name: The workload profile used for this app. Supported for + Consumption + Dedicated plan. + :paramtype workload_profile_name: str + :keyword test_endpoint_auth_state: State of test endpoint auth. Known values are: "Enabled" and + "Disabled". + :paramtype test_endpoint_auth_state: str or + ~azure.mgmt.appplatform.models.TestEndpointAuthState """ super().__init__(**kwargs) self.public = public - self.url = None + self.url: Optional[str] = None self.addon_configs = addon_configs - self.provisioning_state = None - self.fqdn = None + self.provisioning_state: Optional[Union[str, "_models.AppResourceProvisioningState"]] = None + self.fqdn: Optional[str] = None self.https_only = https_only self.temporary_disk = temporary_disk self.persistent_disk = persistent_disk @@ -1485,6 +1502,9 @@ def __init__( self.loaded_certificates = loaded_certificates self.vnet_addons = vnet_addons self.ingress_settings = ingress_settings + self.secrets = secrets + self.workload_profile_name = workload_profile_name + self.test_endpoint_auth_state = test_endpoint_auth_state class AppVNetAddons(_serialization.Model): @@ -1517,7 +1537,7 @@ def __init__(self, *, public_endpoint: bool = False, **kwargs: Any) -> None: """ super().__init__(**kwargs) self.public_endpoint = public_endpoint - self.public_endpoint_url = None + self.public_endpoint_url: Optional[str] = None class AvailableOperations(_serialization.Model): @@ -1570,7 +1590,7 @@ class AvailableRuntimeVersions(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None + self.value: Optional[List["_models.SupportedRuntimeVersion"]] = None class CustomPersistentDiskProperties(_serialization.Model): @@ -1838,14 +1858,14 @@ def __init__( :paramtype binding_parameters: dict[str, str] """ super().__init__(**kwargs) - self.resource_name = None - self.resource_type = None + self.resource_name: Optional[str] = None + self.resource_type: Optional[str] = None self.resource_id = resource_id self.key = key self.binding_parameters = binding_parameters - self.generated_properties = None - self.created_at = None - self.updated_at = None + self.generated_properties: Optional[str] = None + self.created_at: Optional[str] = None + self.updated_at: Optional[str] = None class Build(ProxyResource): @@ -1957,7 +1977,7 @@ def __init__( :paramtype buildpack_groups: list[~azure.mgmt.appplatform.models.BuildpacksGroupProperties] """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.BuilderProvisioningState"]] = None self.stack = stack self.buildpack_groups = buildpack_groups @@ -2067,7 +2087,7 @@ class BuildpackBindingProperties(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar binding_type: Buildpack Binding Type. Known values are: "ApplicationInsights", - "ApacheSkyWalking", "AppDynamics", "Dynatrace", "NewRelic", and "ElasticAPM". + "ApacheSkyWalking", "AppDynamics", "Dynatrace", "NewRelic", "ElasticAPM", and "CACertificates". :vartype binding_type: str or ~azure.mgmt.appplatform.models.BindingType :ivar provisioning_state: State of the Buildpack Binding. Known values are: "Creating", "Updating", "Succeeded", "Failed", and "Deleting". @@ -2096,14 +2116,14 @@ def __init__( ) -> None: """ :keyword binding_type: Buildpack Binding Type. Known values are: "ApplicationInsights", - "ApacheSkyWalking", "AppDynamics", "Dynatrace", "NewRelic", and "ElasticAPM". + "ApacheSkyWalking", "AppDynamics", "Dynatrace", "NewRelic", "ElasticAPM", and "CACertificates". :paramtype binding_type: str or ~azure.mgmt.appplatform.models.BindingType :keyword launch_properties: The object describes the buildpack binding launch properties. :paramtype launch_properties: ~azure.mgmt.appplatform.models.BuildpackBindingLaunchProperties """ super().__init__(**kwargs) self.binding_type = binding_type - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.BuildpackBindingProvisioningState"]] = None self.launch_properties = launch_properties @@ -2185,12 +2205,21 @@ def __init__( class BuildpackProperties(_serialization.Model): """Buildpack properties payload. + Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: Id of the buildpack. :vartype id: str + :ivar version: Version of the buildpack. + :vartype version: str """ + _validation = { + "version": {"readonly": True}, + } + _attribute_map = { "id": {"key": "id", "type": "str"}, + "version": {"key": "version", "type": "str"}, } def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin @@ -2200,6 +2229,7 @@ def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylin """ super().__init__(**kwargs) self.id = id + self.version: Optional[str] = None class BuildpacksGroupProperties(_serialization.Model): @@ -2309,11 +2339,11 @@ def __init__( self.relative_path = relative_path self.builder = builder self.agent_pool = agent_pool - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.BuildProvisioningState"]] = None self.env = env self.apms = apms self.certificates = certificates - self.triggered_build_result = None + self.triggered_build_result: Optional["_models.TriggeredBuildResult"] = None self.resource_requests = resource_requests @@ -2496,15 +2526,15 @@ def __init__( """ super().__init__(**kwargs) self.name = name - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.BuildResultProvisioningState"]] = None self.error = error self.build_pod_name = build_pod_name - self.build_stages = None - self.image = None + self.build_stages: Optional[List["_models.BuildStageProperties"]] = None + self.image: Optional[str] = None class UserSourceInfo(_serialization.Model): - """Source information for a deployment. + """Source information for a deployment or a job. You probably want to use the sub-classes and not this class directly. Known sub-classes are: BuildResultUserSourceInfo, CustomContainerUserSourceInfo, UploadedUserSourceInfo @@ -2650,7 +2680,7 @@ def __init__( :paramtype pool_size: ~azure.mgmt.appplatform.models.BuildServiceAgentPoolSizeProperties """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[str] = None self.pool_size = pool_size @@ -2763,8 +2793,8 @@ def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ super().__init__(**kwargs) self.name = name - self.cpu = None - self.memory = None + self.cpu: Optional[str] = None + self.memory: Optional[str] = None class BuildServiceCollection(_serialization.Model): @@ -2844,8 +2874,8 @@ def __init__( """ super().__init__(**kwargs) self.container_registry = container_registry - self.k_pack_version = None - self.provisioning_state = None + self.k_pack_version: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.BuildServiceProvisioningState"]] = None self.resource_requests = resource_requests @@ -2873,8 +2903,8 @@ class BuildServicePropertiesResourceRequests(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.cpu = None - self.memory = None + self.cpu: Optional[str] = None + self.memory: Optional[str] = None class BuildStageProperties(_serialization.Model): @@ -2910,10 +2940,10 @@ class BuildStageProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.status = None - self.exit_code = None - self.reason = None + self.name: Optional[str] = None + self.status: Optional[Union[str, "_models.KPackBuildStageProvisioningState"]] = None + self.exit_code: Optional[str] = None + self.reason: Optional[str] = None class CertificateProperties(_serialization.Model): @@ -2983,14 +3013,14 @@ def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type: Optional[str] = None - self.thumbprint = None - self.issuer = None - self.issued_date = None - self.expiration_date = None - self.activate_date = None - self.subject_name = None - self.dns_names = None - self.provisioning_state = None + self.thumbprint: Optional[str] = None + self.issuer: Optional[str] = None + self.issued_date: Optional[str] = None + self.expiration_date: Optional[str] = None + self.activate_date: Optional[str] = None + self.subject_name: Optional[str] = None + self.dns_names: Optional[List[str]] = None + self.provisioning_state: Optional[Union[str, "_models.CertificateResourceProvisioningState"]] = None class CertificateReference(_serialization.Model): @@ -3157,10 +3187,19 @@ class ClusterResourceProperties(_serialization.Model): :vartype network_profile: ~azure.mgmt.appplatform.models.NetworkProfile :ivar vnet_addons: Additional Service settings in vnet injection instance. :vartype vnet_addons: ~azure.mgmt.appplatform.models.ServiceVNetAddons + :ivar maintenance_schedule_configuration: Additional Service settings for planned maintenance. + :vartype maintenance_schedule_configuration: + ~azure.mgmt.appplatform.models.MaintenanceScheduleConfiguration :ivar version: Version of the Service. :vartype version: int :ivar service_id: ServiceInstanceEntity Id which uniquely identifies a created resource. :vartype service_id: str + :ivar managed_environment_id: The resource Id of the Managed Environment that the Spring Apps + instance builds on. + :vartype managed_environment_id: str + :ivar infra_resource_group: The name of the resource group that contains the infrastructure + resources. + :vartype infra_resource_group: str :ivar power_state: Power state of the Service. Known values are: "Running" and "Stopped". :vartype power_state: str or ~azure.mgmt.appplatform.models.PowerState :ivar zone_redundant: @@ -3183,8 +3222,14 @@ class ClusterResourceProperties(_serialization.Model): "provisioning_state": {"key": "provisioningState", "type": "str"}, "network_profile": {"key": "networkProfile", "type": "NetworkProfile"}, "vnet_addons": {"key": "vnetAddons", "type": "ServiceVNetAddons"}, + "maintenance_schedule_configuration": { + "key": "maintenanceScheduleConfiguration", + "type": "MaintenanceScheduleConfiguration", + }, "version": {"key": "version", "type": "int"}, "service_id": {"key": "serviceId", "type": "str"}, + "managed_environment_id": {"key": "managedEnvironmentId", "type": "str"}, + "infra_resource_group": {"key": "infraResourceGroup", "type": "str"}, "power_state": {"key": "powerState", "type": "str"}, "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, "fqdn": {"key": "fqdn", "type": "str"}, @@ -3196,6 +3241,9 @@ def __init__( *, network_profile: Optional["_models.NetworkProfile"] = None, vnet_addons: Optional["_models.ServiceVNetAddons"] = None, + maintenance_schedule_configuration: Optional["_models.MaintenanceScheduleConfiguration"] = None, + managed_environment_id: Optional[str] = None, + infra_resource_group: Optional[str] = None, zone_redundant: bool = False, marketplace_resource: Optional["_models.MarketplaceResource"] = None, **kwargs: Any @@ -3205,20 +3253,33 @@ def __init__( :paramtype network_profile: ~azure.mgmt.appplatform.models.NetworkProfile :keyword vnet_addons: Additional Service settings in vnet injection instance. :paramtype vnet_addons: ~azure.mgmt.appplatform.models.ServiceVNetAddons + :keyword maintenance_schedule_configuration: Additional Service settings for planned + maintenance. + :paramtype maintenance_schedule_configuration: + ~azure.mgmt.appplatform.models.MaintenanceScheduleConfiguration + :keyword managed_environment_id: The resource Id of the Managed Environment that the Spring + Apps instance builds on. + :paramtype managed_environment_id: str + :keyword infra_resource_group: The name of the resource group that contains the infrastructure + resources. + :paramtype infra_resource_group: str :keyword zone_redundant: :paramtype zone_redundant: bool :keyword marketplace_resource: Purchasing 3rd party product of the Service resource. :paramtype marketplace_resource: ~azure.mgmt.appplatform.models.MarketplaceResource """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None self.network_profile = network_profile self.vnet_addons = vnet_addons - self.version = None - self.service_id = None - self.power_state = None + self.maintenance_schedule_configuration = maintenance_schedule_configuration + self.version: Optional[int] = None + self.service_id: Optional[str] = None + self.managed_environment_id = managed_environment_id + self.infra_resource_group = infra_resource_group + self.power_state: Optional[Union[str, "_models.PowerState"]] = None self.zone_redundant = zone_redundant - self.fqdn = None + self.fqdn: Optional[str] = None self.marketplace_resource = marketplace_resource @@ -3316,27 +3377,69 @@ def __init__( self.strict_host_key_checking = strict_host_key_checking +class ConfigServerInstance(_serialization.Model): + """Collection of instances belong to the Config Server, only available in Enterprise Plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Config Server instance. + :vartype name: str + :ivar status: Status of the Config Server instance. + :vartype status: str + """ + + _validation = { + "name": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name: Optional[str] = None + self.status: Optional[str] = None + + class ConfigServerProperties(_serialization.Model): """Config server git properties payload. Variables are only populated by the server, and will be ignored when sending a request. :ivar provisioning_state: State of the config server. Known values are: "NotAvailable", - "Deleted", "Failed", "Succeeded", and "Updating". + "Creating", "Deleted", "Failed", "Succeeded", "Updating", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.appplatform.models.ConfigServerState + :ivar resource_requests: The requested resource quantity for required CPU and Memory, only + available in Enterprise Plan. + :vartype resource_requests: ~azure.mgmt.appplatform.models.ConfigServerResourceRequests + :ivar instances: Collection of instances belong to Config Server, only available in Enterprise + Plan. + :vartype instances: list[~azure.mgmt.appplatform.models.ConfigServerInstance] :ivar error: Error when apply config server settings. :vartype error: ~azure.mgmt.appplatform.models.Error + :ivar enabled_state: Enabled state of the config server. This is only used in Consumption tier. + Known values are: "Enabled" and "Disabled". + :vartype enabled_state: str or ~azure.mgmt.appplatform.models.ConfigServerEnabledState :ivar config_server: Settings of config server. :vartype config_server: ~azure.mgmt.appplatform.models.ConfigServerSettings """ _validation = { "provisioning_state": {"readonly": True}, + "resource_requests": {"readonly": True}, + "instances": {"readonly": True}, } _attribute_map = { "provisioning_state": {"key": "provisioningState", "type": "str"}, + "resource_requests": {"key": "resourceRequests", "type": "ConfigServerResourceRequests"}, + "instances": {"key": "instances", "type": "[ConfigServerInstance]"}, "error": {"key": "error", "type": "Error"}, + "enabled_state": {"key": "enabledState", "type": "str"}, "config_server": {"key": "configServer", "type": "ConfigServerSettings"}, } @@ -3344,18 +3447,25 @@ def __init__( self, *, error: Optional["_models.Error"] = None, + enabled_state: Optional[Union[str, "_models.ConfigServerEnabledState"]] = None, config_server: Optional["_models.ConfigServerSettings"] = None, **kwargs: Any ) -> None: """ :keyword error: Error when apply config server settings. :paramtype error: ~azure.mgmt.appplatform.models.Error + :keyword enabled_state: Enabled state of the config server. This is only used in Consumption + tier. Known values are: "Enabled" and "Disabled". + :paramtype enabled_state: str or ~azure.mgmt.appplatform.models.ConfigServerEnabledState :keyword config_server: Settings of config server. :paramtype config_server: ~azure.mgmt.appplatform.models.ConfigServerSettings """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.ConfigServerState"]] = None + self.resource_requests: Optional["_models.ConfigServerResourceRequests"] = None + self.instances: Optional[List["_models.ConfigServerInstance"]] = None self.error = error + self.enabled_state = enabled_state self.config_server = config_server @@ -3400,6 +3510,73 @@ def __init__(self, *, properties: Optional["_models.ConfigServerProperties"] = N self.properties = properties +class ConfigServerResourceCollection(_serialization.Model): + """Object that includes an array of config server resources and a possible link for next set. + + :ivar value: Collection of config server resources. + :vartype value: list[~azure.mgmt.appplatform.models.ConfigServerResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[ConfigServerResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.ConfigServerResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of config server resources. + :paramtype value: list[~azure.mgmt.appplatform.models.ConfigServerResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ConfigServerResourceRequests(_serialization.Model): + """Resource request payload of Config Server, only available in Enterprise Plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: CPU allocated to each Config Server instance. + :vartype cpu: str + :ivar memory: Memory allocated to each Config Server instance. + :vartype memory: str + :ivar instance_count: Instance count of the Config Server. + :vartype instance_count: int + """ + + _validation = { + "cpu": {"readonly": True}, + "memory": {"readonly": True}, + "instance_count": {"readonly": True}, + } + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cpu: Optional[str] = None + self.memory: Optional[str] = None + self.instance_count: Optional[int] = None + + class ConfigServerSettings(_serialization.Model): """The settings of config server. @@ -3545,7 +3722,7 @@ def __init__( self.git_repos_validation_result = git_repos_validation_result -class ConfigurationServiceGitRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes +class ConfigurationServiceGitRepository(_serialization.Model): """Git repository property payload for Application Configuration Service. All required parameters must be populated in order to send to server. @@ -3689,8 +3866,8 @@ class ConfigurationServiceInstance(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.status = None + self.name: Optional[str] = None + self.status: Optional[str] = None class ConfigurationServiceProperties(_serialization.Model): @@ -3742,10 +3919,10 @@ def __init__( :paramtype settings: ~azure.mgmt.appplatform.models.ConfigurationServiceSettings """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.ConfigurationServiceProvisioningState"]] = None self.generation = generation - self.resource_requests = None - self.instances = None + self.resource_requests: Optional["_models.ConfigurationServiceResourceRequests"] = None + self.instances: Optional[List["_models.ConfigurationServiceInstance"]] = None self.settings = settings @@ -3830,7 +4007,7 @@ class ConfigurationServiceResourceRequests(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar cpu: Cpu allocated to each Application Configuration Service instance. + :ivar cpu: CPU allocated to each Application Configuration Service instance. :vartype cpu: str :ivar memory: Memory allocated to each Application Configuration Service instance. :vartype memory: str @@ -3853,9 +4030,9 @@ class ConfigurationServiceResourceRequests(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.cpu = None - self.memory = None - self.instance_count = None + self.cpu: Optional[str] = None + self.memory: Optional[str] = None + self.instance_count: Optional[int] = None class ConfigurationServiceSettings(_serialization.Model): @@ -3863,21 +4040,33 @@ class ConfigurationServiceSettings(_serialization.Model): :ivar git_property: Property of git environment. :vartype git_property: ~azure.mgmt.appplatform.models.ConfigurationServiceGitProperty + :ivar refresh_interval_in_seconds: How often (in seconds) to check repository updates. Minimum + value is 0. + :vartype refresh_interval_in_seconds: int """ _attribute_map = { "git_property": {"key": "gitProperty", "type": "ConfigurationServiceGitProperty"}, + "refresh_interval_in_seconds": {"key": "refreshIntervalInSeconds", "type": "int"}, } def __init__( - self, *, git_property: Optional["_models.ConfigurationServiceGitProperty"] = None, **kwargs: Any + self, + *, + git_property: Optional["_models.ConfigurationServiceGitProperty"] = None, + refresh_interval_in_seconds: Optional[int] = None, + **kwargs: Any ) -> None: """ :keyword git_property: Property of git environment. :paramtype git_property: ~azure.mgmt.appplatform.models.ConfigurationServiceGitProperty + :keyword refresh_interval_in_seconds: How often (in seconds) to check repository updates. + Minimum value is 0. + :paramtype refresh_interval_in_seconds: int """ super().__init__(**kwargs) self.git_property = git_property + self.refresh_interval_in_seconds = refresh_interval_in_seconds class ConfigurationServiceSettingsValidateResult(_serialization.Model): # pylint: disable=name-too-long @@ -4035,7 +4224,7 @@ def __init__(self, *, credentials: "_models.ContainerRegistryCredentials", **kwa """ super().__init__(**kwargs) self.credentials = credentials - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.ContainerRegistryProvisioningState"]] = None class ContainerRegistryResource(ProxyResource): @@ -4209,7 +4398,7 @@ class CustomContainer(_serialization.Model): :ivar server: The name of the registry that contains the container image. :vartype server: str :ivar container_image: Container image of the custom container. This should be in the form of - :code:``::code:`` without the server name of the registry. + :code:``:\\ :code:`` without the server name of the registry. :vartype container_image: str :ivar command: Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. @@ -4248,7 +4437,7 @@ def __init__( :keyword server: The name of the registry that contains the container image. :paramtype server: str :keyword container_image: Container image of the custom container. This should be in the form - of :code:``::code:`` without the server name of the registry. + of :code:``:\\ :code:`` without the server name of the registry. :paramtype container_image: str :keyword command: Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. @@ -4350,9 +4539,9 @@ def __init__(self, *, thumbprint: Optional[str] = None, cert_name: Optional[str] """ super().__init__(**kwargs) self.thumbprint = thumbprint - self.app_name = None + self.app_name: Optional[str] = None self.cert_name = cert_name - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.CustomDomainResourceProvisioningState"]] = None class CustomDomainResource(ProxyResource): @@ -4552,13 +4741,13 @@ def __init__( :paramtype git_repository: ~azure.mgmt.appplatform.models.AcceleratorGitRepository """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.CustomizedAcceleratorProvisioningState"]] = None self.accelerator_type = accelerator_type self.display_name = display_name self.description = description self.icon_url = icon_url self.accelerator_tags = accelerator_tags - self.imports = None + self.imports: Optional[List[str]] = None self.git_repository = git_repository @@ -4727,6 +4916,47 @@ def __init__( self.storage_id = storage_id +class CustomScaleRule(_serialization.Model): + """Azure Spring Apps App Instance Custom scaling rule. + + :ivar type: Type of the custom scale rule + eg: azure-servicebus, redis etc. + :vartype type: str + :ivar metadata: Metadata properties to describe custom scale rule. + :vartype metadata: dict[str, str] + :ivar auth: Authentication secrets for the custom scale rule. + :vartype auth: list[~azure.mgmt.appplatform.models.ScaleRuleAuth] + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "metadata": {"key": "metadata", "type": "{str}"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + metadata: Optional[Dict[str, str]] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword type: Type of the custom scale rule + eg: azure-servicebus, redis etc. + :paramtype type: str + :keyword metadata: Metadata properties to describe custom scale rule. + :paramtype metadata: dict[str, str] + :keyword auth: Authentication secrets for the custom scale rule. + :paramtype auth: list[~azure.mgmt.appplatform.models.ScaleRuleAuth] + """ + super().__init__(**kwargs) + self.type = type + self.metadata = metadata + self.auth = auth + + class DeploymentInstance(_serialization.Model): """Deployment instance payload. @@ -4767,12 +4997,12 @@ class DeploymentInstance(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.status = None - self.reason = None - self.discovery_status = None - self.start_time = None - self.zone = None + self.name: Optional[str] = None + self.status: Optional[str] = None + self.reason: Optional[str] = None + self.discovery_status: Optional[str] = None + self.start_time: Optional[str] = None + self.zone: Optional[str] = None class DeploymentList(_serialization.Model): @@ -4937,10 +5167,10 @@ def __init__( super().__init__(**kwargs) self.source = source self.deployment_settings = deployment_settings - self.provisioning_state = None - self.status = None + self.provisioning_state: Optional[Union[str, "_models.DeploymentResourceProvisioningState"]] = None + self.status: Optional[Union[str, "_models.DeploymentResourceStatus"]] = None self.active = active - self.instances = None + self.instances: Optional[List["_models.DeploymentInstance"]] = None class DeploymentSettings(_serialization.Model): @@ -4980,6 +5210,8 @@ class DeploymentSettings(_serialization.Model): signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 90 seconds. :vartype termination_grace_period_seconds: int + :ivar scale: Scaling properties for the Azure Spring Apps App Instance. + :vartype scale: ~azure.mgmt.appplatform.models.Scale :ivar container_probe_settings: Container liveness and readiness probe settings. :vartype container_probe_settings: ~azure.mgmt.appplatform.models.ContainerProbeSettings """ @@ -4993,6 +5225,7 @@ class DeploymentSettings(_serialization.Model): "readiness_probe": {"key": "readinessProbe", "type": "Probe"}, "startup_probe": {"key": "startupProbe", "type": "Probe"}, "termination_grace_period_seconds": {"key": "terminationGracePeriodSeconds", "type": "int"}, + "scale": {"key": "scale", "type": "Scale"}, "container_probe_settings": {"key": "containerProbeSettings", "type": "ContainerProbeSettings"}, } @@ -5007,6 +5240,7 @@ def __init__( readiness_probe: Optional["_models.Probe"] = None, startup_probe: Optional["_models.Probe"] = None, termination_grace_period_seconds: int = 90, + scale: Optional["_models.Scale"] = None, container_probe_settings: Optional["_models.ContainerProbeSettings"] = None, **kwargs: Any ) -> None: @@ -5045,6 +5279,8 @@ def __init__( signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 90 seconds. :paramtype termination_grace_period_seconds: int + :keyword scale: Scaling properties for the Azure Spring Apps App Instance. + :paramtype scale: ~azure.mgmt.appplatform.models.Scale :keyword container_probe_settings: Container liveness and readiness probe settings. :paramtype container_probe_settings: ~azure.mgmt.appplatform.models.ContainerProbeSettings """ @@ -5057,6 +5293,7 @@ def __init__( self.readiness_probe = readiness_probe self.startup_probe = startup_probe self.termination_grace_period_seconds = termination_grace_period_seconds + self.scale = scale self.container_probe_settings = container_probe_settings @@ -5088,9 +5325,9 @@ class DevToolPortalComponent(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.resource_requests = None - self.instances = None + self.name: Optional[str] = None + self.resource_requests: Optional["_models.DevToolPortalResourceRequests"] = None + self.instances: Optional[List["_models.DevToolPortalInstance"]] = None class DevToolPortalFeatureDetail(_serialization.Model): @@ -5120,7 +5357,7 @@ def __init__(self, *, state: Union[str, "_models.DevToolPortalFeatureState"] = " """ super().__init__(**kwargs) self.state = state - self.route = None + self.route: Optional[str] = None class DevToolPortalFeatureSettings(_serialization.Model): @@ -5180,8 +5417,8 @@ class DevToolPortalInstance(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.status = None + self.name: Optional[str] = None + self.status: Optional[str] = None class DevToolPortalProperties(_serialization.Model): @@ -5237,10 +5474,10 @@ def __init__( :paramtype features: ~azure.mgmt.appplatform.models.DevToolPortalFeatureSettings """ super().__init__(**kwargs) - self.provisioning_state = None - self.components = None + self.provisioning_state: Optional[Union[str, "_models.DevToolPortalProvisioningState"]] = None + self.components: Optional[List["_models.DevToolPortalComponent"]] = None self.public = public - self.url = None + self.url: Optional[str] = None self.sso_properties = sso_properties self.features = features @@ -5350,9 +5587,9 @@ class DevToolPortalResourceRequests(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.cpu = None - self.memory = None - self.instance_count = None + self.cpu: Optional[str] = None + self.memory: Optional[str] = None + self.instance_count: Optional[int] = None class DevToolPortalSsoProperties(_serialization.Model): @@ -5442,6 +5679,71 @@ def __init__( self.duration = duration +class EnvSecretsCollection(_serialization.Model): + """Secret environment variable collection. + + All required parameters must be populated in order to send to server. + + :ivar value: Collection of resources. Required. + :vartype value: list[~azure.mgmt.appplatform.models.Secret] + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Secret]"}, + } + + def __init__(self, *, value: List["_models.Secret"], **kwargs: Any) -> None: + """ + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appplatform.models.Secret] + """ + super().__init__(**kwargs) + self.value = value + + +class EnvVar(_serialization.Model): + """Azure Spring Apps components' environment variable. + + :ivar name: Environment variable name. + :vartype name: str + :ivar value: Non-secret environment variable value. + :vartype value: str + :ivar secret_value: secret environment variable value. + :vartype secret_value: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "secret_value": {"key": "secretValue", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + secret_value: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Environment variable name. + :paramtype name: str + :keyword value: Non-secret environment variable value. + :paramtype value: str + :keyword secret_value: secret environment variable value. + :paramtype secret_value: str + """ + super().__init__(**kwargs) + self.name = name + self.value = value + self.secret_value = secret_value + + class Error(_serialization.Model): """The error code compose of code and message. @@ -5468,6 +5770,126 @@ def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, self.message = message +class EurekaServerProperties(_serialization.Model): + """Eureka server properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the eureka server. Known values are: "Failed", "Succeeded", + "Updating", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.appplatform.models.EurekaServerState + :ivar enabled_state: Enabled state of the eureka server. This is only used in Consumption tier. + Known values are: "Enabled" and "Disabled". + :vartype enabled_state: str or ~azure.mgmt.appplatform.models.EurekaServerEnabledState + :ivar error: Error when applying eureka server settings. + :vartype error: ~azure.mgmt.appplatform.models.Error + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "enabled_state": {"key": "enabledState", "type": "str"}, + "error": {"key": "error", "type": "Error"}, + } + + def __init__( + self, + *, + enabled_state: Optional[Union[str, "_models.EurekaServerEnabledState"]] = None, + error: Optional["_models.Error"] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled_state: Enabled state of the eureka server. This is only used in Consumption + tier. Known values are: "Enabled" and "Disabled". + :paramtype enabled_state: str or ~azure.mgmt.appplatform.models.EurekaServerEnabledState + :keyword error: Error when applying eureka server settings. + :paramtype error: ~azure.mgmt.appplatform.models.Error + """ + super().__init__(**kwargs) + self.provisioning_state: Optional[Union[str, "_models.EurekaServerState"]] = None + self.enabled_state = enabled_state + self.error = error + + +class EurekaServerResource(ProxyResource): + """Eureka server 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. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.models.SystemData + :ivar properties: Properties of the eureka server resource. + :vartype properties: ~azure.mgmt.appplatform.models.EurekaServerProperties + """ + + _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": "EurekaServerProperties"}, + } + + def __init__(self, *, properties: Optional["_models.EurekaServerProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the eureka server resource. + :paramtype properties: ~azure.mgmt.appplatform.models.EurekaServerProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class EurekaServerResourceCollection(_serialization.Model): + """Object that includes an array of Eureka server resources and a possible link for next set. + + :ivar value: Collection of Eureka server resources. + :vartype value: list[~azure.mgmt.appplatform.models.EurekaServerResource] + :ivar next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[EurekaServerResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.EurekaServerResource"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Eureka server resources. + :paramtype value: list[~azure.mgmt.appplatform.models.EurekaServerResource] + :keyword next_link: URL client should use to fetch the next page (per server side paging). + It's null for now, added for future use. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + class ProbeAction(_serialization.Model): """The action of the probe. @@ -5890,36 +6312,145 @@ class GatewayInstance(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.status = None + self.name: Optional[str] = None + self.status: Optional[str] = None -class GatewayOperatorProperties(_serialization.Model): - """Properties of the Spring Cloud Gateway Operator. +class GatewayResponseCacheProperties(_serialization.Model): + """Spring Cloud Gateway response cache properties. - Variables are only populated by the server, and will be ignored when sending a request. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + GatewayLocalResponseCachePerInstanceProperties, GatewayLocalResponseCachePerRouteProperties - :ivar resource_requests: The requested resource quantity for required CPU and Memory. - :vartype resource_requests: ~azure.mgmt.appplatform.models.GatewayOperatorResourceRequests - :ivar instances: Collection of instances belong to Spring Cloud Gateway operator. - :vartype instances: list[~azure.mgmt.appplatform.models.GatewayInstance] + All required parameters must be populated in order to send to server. + + :ivar response_cache_type: The type of the response cache. Required. + :vartype response_cache_type: str """ _validation = { - "resource_requests": {"readonly": True}, - "instances": {"readonly": True}, + "response_cache_type": {"required": True}, } _attribute_map = { - "resource_requests": {"key": "resourceRequests", "type": "GatewayOperatorResourceRequests"}, + "response_cache_type": {"key": "responseCacheType", "type": "str"}, + } + + _subtype_map = { + "response_cache_type": { + "LocalCachePerInstance": "GatewayLocalResponseCachePerInstanceProperties", + "LocalCachePerRoute": "GatewayLocalResponseCachePerRouteProperties", + } + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.response_cache_type: Optional[str] = None + + +class GatewayLocalResponseCachePerInstanceProperties(GatewayResponseCacheProperties): # pylint: disable=name-too-long + """Spring Cloud Gateway local response cache per instance properties. + + All required parameters must be populated in order to send to server. + + :ivar response_cache_type: The type of the response cache. Required. + :vartype response_cache_type: str + :ivar size: Maximum size of cache (10MB, 900KB, 1GB...) to determine if the cache needs to + evict some entries. + :vartype size: str + :ivar time_to_live: Time before a cached entry is expired (300s, 5m, 1h...). + :vartype time_to_live: str + """ + + _validation = { + "response_cache_type": {"required": True}, + } + + _attribute_map = { + "response_cache_type": {"key": "responseCacheType", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "time_to_live": {"key": "timeToLive", "type": "str"}, + } + + def __init__(self, *, size: Optional[str] = None, time_to_live: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword size: Maximum size of cache (10MB, 900KB, 1GB...) to determine if the cache needs to + evict some entries. + :paramtype size: str + :keyword time_to_live: Time before a cached entry is expired (300s, 5m, 1h...). + :paramtype time_to_live: str + """ + super().__init__(**kwargs) + self.response_cache_type: str = "LocalCachePerInstance" + self.size = size + self.time_to_live = time_to_live + + +class GatewayLocalResponseCachePerRouteProperties(GatewayResponseCacheProperties): # pylint: disable=name-too-long + """Spring Cloud Gateway local response cache per route properties. + + All required parameters must be populated in order to send to server. + + :ivar response_cache_type: The type of the response cache. Required. + :vartype response_cache_type: str + :ivar size: Maximum size of cache (10MB, 900KB, 1GB...) to determine if the cache needs to + evict some entries. + :vartype size: str + :ivar time_to_live: Time before a cached entry is expired (300s, 5m, 1h...). + :vartype time_to_live: str + """ + + _validation = { + "response_cache_type": {"required": True}, + } + + _attribute_map = { + "response_cache_type": {"key": "responseCacheType", "type": "str"}, + "size": {"key": "size", "type": "str"}, + "time_to_live": {"key": "timeToLive", "type": "str"}, + } + + def __init__(self, *, size: Optional[str] = None, time_to_live: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword size: Maximum size of cache (10MB, 900KB, 1GB...) to determine if the cache needs to + evict some entries. + :paramtype size: str + :keyword time_to_live: Time before a cached entry is expired (300s, 5m, 1h...). + :paramtype time_to_live: str + """ + super().__init__(**kwargs) + self.response_cache_type: str = "LocalCachePerRoute" + self.size = size + self.time_to_live = time_to_live + + +class GatewayOperatorProperties(_serialization.Model): + """Properties of the Spring Cloud Gateway Operator. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_requests: The requested resource quantity for required CPU and Memory. + :vartype resource_requests: ~azure.mgmt.appplatform.models.GatewayOperatorResourceRequests + :ivar instances: Collection of instances belong to Spring Cloud Gateway operator. + :vartype instances: list[~azure.mgmt.appplatform.models.GatewayInstance] + """ + + _validation = { + "resource_requests": {"readonly": True}, + "instances": {"readonly": True}, + } + + _attribute_map = { + "resource_requests": {"key": "resourceRequests", "type": "GatewayOperatorResourceRequests"}, "instances": {"key": "instances", "type": "[GatewayInstance]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.resource_requests = None - self.instances = None + self.resource_requests: Optional["_models.GatewayOperatorResourceRequests"] = None + self.instances: Optional[List["_models.GatewayInstance"]] = None class GatewayOperatorResourceRequests(_serialization.Model): @@ -5927,7 +6458,7 @@ class GatewayOperatorResourceRequests(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar cpu: Cpu allocated to each Spring Cloud Gateway Operator instance. + :ivar cpu: CPU allocated to each Spring Cloud Gateway Operator instance. :vartype cpu: str :ivar memory: Memory allocated to each Spring Cloud Gateway Operator instance. :vartype memory: str @@ -5950,12 +6481,12 @@ class GatewayOperatorResourceRequests(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.cpu = None - self.memory = None - self.instance_count = None + self.cpu: Optional[str] = None + self.memory: Optional[str] = None + self.instance_count: Optional[int] = None -class GatewayProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes +class GatewayProperties(_serialization.Model): """Spring Cloud Gateway properties payload. Variables are only populated by the server, and will be ignored when sending a request. @@ -5977,6 +6508,8 @@ class GatewayProperties(_serialization.Model): # pylint: disable=too-many-insta :vartype cors_properties: ~azure.mgmt.appplatform.models.GatewayCorsProperties :ivar client_auth: Client-Certification Authentication. :vartype client_auth: ~azure.mgmt.appplatform.models.GatewayPropertiesClientAuth + :ivar apm_types: Collection of APM type used in Spring Cloud Gateway. + :vartype apm_types: list[str or ~azure.mgmt.appplatform.models.ApmType] :ivar apms: Collection of ApmReferences in service level. :vartype apms: list[~azure.mgmt.appplatform.models.ApmReference] :ivar environment_variables: Environment variables of Spring Cloud Gateway. @@ -5984,15 +6517,22 @@ class GatewayProperties(_serialization.Model): # pylint: disable=too-many-insta ~azure.mgmt.appplatform.models.GatewayPropertiesEnvironmentVariables :ivar resource_requests: The requested resource quantity for required CPU and Memory. :vartype resource_requests: ~azure.mgmt.appplatform.models.GatewayResourceRequests + :ivar addon_configs: Collection of addons for Spring Cloud Gateway. + :vartype addon_configs: dict[str, JSON] :ivar instances: Collection of instances belong to Spring Cloud Gateway. :vartype instances: list[~azure.mgmt.appplatform.models.GatewayInstance] :ivar operator_properties: Properties of the Spring Cloud Gateway Operator. :vartype operator_properties: ~azure.mgmt.appplatform.models.GatewayOperatorProperties + :ivar response_cache_properties: The properties to configure different types of response cache + for Spring Cloud Gateway. + :vartype response_cache_properties: + ~azure.mgmt.appplatform.models.GatewayResponseCacheProperties """ _validation = { "provisioning_state": {"readonly": True}, "url": {"readonly": True}, + "apm_types": {"unique": True}, "instances": {"readonly": True}, "operator_properties": {"readonly": True}, } @@ -6006,11 +6546,14 @@ class GatewayProperties(_serialization.Model): # pylint: disable=too-many-insta "api_metadata_properties": {"key": "apiMetadataProperties", "type": "GatewayApiMetadataProperties"}, "cors_properties": {"key": "corsProperties", "type": "GatewayCorsProperties"}, "client_auth": {"key": "clientAuth", "type": "GatewayPropertiesClientAuth"}, + "apm_types": {"key": "apmTypes", "type": "[str]"}, "apms": {"key": "apms", "type": "[ApmReference]"}, "environment_variables": {"key": "environmentVariables", "type": "GatewayPropertiesEnvironmentVariables"}, "resource_requests": {"key": "resourceRequests", "type": "GatewayResourceRequests"}, + "addon_configs": {"key": "addonConfigs", "type": "{object}"}, "instances": {"key": "instances", "type": "[GatewayInstance]"}, "operator_properties": {"key": "operatorProperties", "type": "GatewayOperatorProperties"}, + "response_cache_properties": {"key": "responseCacheProperties", "type": "GatewayResponseCacheProperties"}, } def __init__( @@ -6022,9 +6565,12 @@ def __init__( api_metadata_properties: Optional["_models.GatewayApiMetadataProperties"] = None, cors_properties: Optional["_models.GatewayCorsProperties"] = None, client_auth: Optional["_models.GatewayPropertiesClientAuth"] = None, + apm_types: Optional[List[Union[str, "_models.ApmType"]]] = None, apms: Optional[List["_models.ApmReference"]] = None, environment_variables: Optional["_models.GatewayPropertiesEnvironmentVariables"] = None, resource_requests: Optional["_models.GatewayResourceRequests"] = None, + addon_configs: Optional[Dict[str, JSON]] = None, + response_cache_properties: Optional["_models.GatewayResponseCacheProperties"] = None, **kwargs: Any ) -> None: """ @@ -6040,6 +6586,8 @@ def __init__( :paramtype cors_properties: ~azure.mgmt.appplatform.models.GatewayCorsProperties :keyword client_auth: Client-Certification Authentication. :paramtype client_auth: ~azure.mgmt.appplatform.models.GatewayPropertiesClientAuth + :keyword apm_types: Collection of APM type used in Spring Cloud Gateway. + :paramtype apm_types: list[str or ~azure.mgmt.appplatform.models.ApmType] :keyword apms: Collection of ApmReferences in service level. :paramtype apms: list[~azure.mgmt.appplatform.models.ApmReference] :keyword environment_variables: Environment variables of Spring Cloud Gateway. @@ -6047,21 +6595,30 @@ def __init__( ~azure.mgmt.appplatform.models.GatewayPropertiesEnvironmentVariables :keyword resource_requests: The requested resource quantity for required CPU and Memory. :paramtype resource_requests: ~azure.mgmt.appplatform.models.GatewayResourceRequests + :keyword addon_configs: Collection of addons for Spring Cloud Gateway. + :paramtype addon_configs: dict[str, JSON] + :keyword response_cache_properties: The properties to configure different types of response + cache for Spring Cloud Gateway. + :paramtype response_cache_properties: + ~azure.mgmt.appplatform.models.GatewayResponseCacheProperties """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.GatewayProvisioningState"]] = None self.public = public - self.url = None + self.url: Optional[str] = None self.https_only = https_only self.sso_properties = sso_properties self.api_metadata_properties = api_metadata_properties self.cors_properties = cors_properties self.client_auth = client_auth + self.apm_types = apm_types self.apms = apms self.environment_variables = environment_variables self.resource_requests = resource_requests - self.instances = None - self.operator_properties = None + self.addon_configs = addon_configs + self.instances: Optional[List["_models.GatewayInstance"]] = None + self.operator_properties: Optional["_models.GatewayOperatorProperties"] = None + self.response_cache_properties = response_cache_properties class GatewayPropertiesClientAuth(_serialization.Model): @@ -6218,7 +6775,7 @@ def __init__( class GatewayResourceRequests(_serialization.Model): """Resource request payload of Spring Cloud Gateway. - :ivar cpu: Cpu allocated to each Spring Cloud Gateway instance. + :ivar cpu: CPU allocated to each Spring Cloud Gateway instance. :vartype cpu: str :ivar memory: Memory allocated to each Spring Cloud Gateway instance. :vartype memory: str @@ -6231,7 +6788,7 @@ class GatewayResourceRequests(_serialization.Model): def __init__(self, *, cpu: str = "1", memory: str = "2Gi", **kwargs: Any) -> None: """ - :keyword cpu: Cpu allocated to each Spring Cloud Gateway instance. + :keyword cpu: CPU allocated to each Spring Cloud Gateway instance. :paramtype cpu: str :keyword memory: Memory allocated to each Spring Cloud Gateway instance. :paramtype memory: str @@ -6343,7 +6900,7 @@ def __init__( :paramtype filters: list[str] """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.GatewayProvisioningState"]] = None self.app_resource_id = app_resource_id self.open_api = open_api self.protocol = protocol @@ -6429,7 +6986,7 @@ def __init__( self.next_link = next_link -class GitPatternRepository(_serialization.Model): # pylint: disable=too-many-instance-attributes +class GitPatternRepository(_serialization.Model): """Git repository property payload for config server. All required parameters must be populated in order to send to server. @@ -6608,6 +7165,38 @@ def __init__( self.scheme = scheme +class HttpScaleRule(_serialization.Model): + """Azure Spring Apps App Instance Http scaling rule. + + :ivar metadata: Metadata properties to describe http scale rule. + :vartype metadata: dict[str, str] + :ivar auth: Authentication secrets for the custom scale rule. + :vartype auth: list[~azure.mgmt.appplatform.models.ScaleRuleAuth] + """ + + _attribute_map = { + "metadata": {"key": "metadata", "type": "{str}"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword metadata: Metadata properties to describe http scale rule. + :paramtype metadata: dict[str, str] + :keyword auth: Authentication secrets for the custom scale rule. + :paramtype auth: list[~azure.mgmt.appplatform.models.ScaleRuleAuth] + """ + super().__init__(**kwargs) + self.metadata = metadata + self.auth = auth + + class ImageRegistryCredential(_serialization.Model): """Credential of the image registry. @@ -6840,7 +7429,322 @@ def __init__( self.jvm_options = jvm_options -class KeyVaultCertificateProperties(CertificateProperties): # pylint: disable=too-many-instance-attributes +class JobExecution(_serialization.Model): + """Azure Spring Apps Job execution. + + :ivar name: Job execution Name. + :vartype name: str + :ivar status: Current state of the job execution. Known values are: "Running", "Pending", + "Canceled", "Failed", and "Completed". + :vartype status: str or ~azure.mgmt.appplatform.models.JobExecutionRunningState + :ivar start_time: Job execution start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Job execution end time. + :vartype end_time: ~datetime.datetime + :ivar template: The template which is applied for the execution of the Job. + :vartype template: ~azure.mgmt.appplatform.models.JobExecutionTemplate + :ivar job_snapshot: The snapshot of job configuration. + :vartype job_snapshot: ~azure.mgmt.appplatform.models.JobResourceProperties + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "template": {"key": "template", "type": "JobExecutionTemplate"}, + "job_snapshot": {"key": "jobSnapshot", "type": "JobResourceProperties"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + status: Optional[Union[str, "_models.JobExecutionRunningState"]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + template: Optional["_models.JobExecutionTemplate"] = None, + job_snapshot: Optional["_models.JobResourceProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Job execution Name. + :paramtype name: str + :keyword status: Current state of the job execution. Known values are: "Running", "Pending", + "Canceled", "Failed", and "Completed". + :paramtype status: str or ~azure.mgmt.appplatform.models.JobExecutionRunningState + :keyword start_time: Job execution start time. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Job execution end time. + :paramtype end_time: ~datetime.datetime + :keyword template: The template which is applied for the execution of the Job. + :paramtype template: ~azure.mgmt.appplatform.models.JobExecutionTemplate + :keyword job_snapshot: The snapshot of job configuration. + :paramtype job_snapshot: ~azure.mgmt.appplatform.models.JobResourceProperties + """ + super().__init__(**kwargs) + self.name = name + self.status = status + self.start_time = start_time + self.end_time = end_time + self.template = template + self.job_snapshot = job_snapshot + + +class JobExecutionCollection(_serialization.Model): + """Azure Spring App Job executions collection. + + All required parameters must be populated in order to send to server. + + :ivar value: Collection of Job executions. Required. + :vartype value: list[~azure.mgmt.appplatform.models.JobExecution] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[JobExecution]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.JobExecution"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: Collection of Job executions. Required. + :paramtype value: list[~azure.mgmt.appplatform.models.JobExecution] + :keyword next_link: Link to next page of resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class JobExecutionTemplate(_serialization.Model): + """Job's execution template, containing configuration for an execution. + + :ivar environment_variables: Environment variables of Job execution. + :vartype environment_variables: list[~azure.mgmt.appplatform.models.EnvVar] + :ivar args: Arguments for the Job execution. + :vartype args: list[str] + :ivar resource_requests: The requested resource quantity for required CPU and Memory. + :vartype resource_requests: ~azure.mgmt.appplatform.models.JobResourceRequests + """ + + _attribute_map = { + "environment_variables": {"key": "environmentVariables", "type": "[EnvVar]"}, + "args": {"key": "args", "type": "[str]"}, + "resource_requests": {"key": "resourceRequests", "type": "JobResourceRequests"}, + } + + def __init__( + self, + *, + environment_variables: Optional[List["_models.EnvVar"]] = None, + args: Optional[List[str]] = None, + resource_requests: Optional["_models.JobResourceRequests"] = None, + **kwargs: Any + ) -> None: + """ + :keyword environment_variables: Environment variables of Job execution. + :paramtype environment_variables: list[~azure.mgmt.appplatform.models.EnvVar] + :keyword args: Arguments for the Job execution. + :paramtype args: list[str] + :keyword resource_requests: The requested resource quantity for required CPU and Memory. + :paramtype resource_requests: ~azure.mgmt.appplatform.models.JobResourceRequests + """ + super().__init__(**kwargs) + self.environment_variables = environment_variables + self.args = args + self.resource_requests = resource_requests + + +class JobResource(ProxyResource): + """Job resource payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.models.SystemData + :ivar properties: Properties of the Job resource. + :vartype properties: ~azure.mgmt.appplatform.models.JobResourceProperties + """ + + _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": "JobResourceProperties"}, + } + + def __init__(self, *, properties: Optional["_models.JobResourceProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Properties of the Job resource. + :paramtype properties: ~azure.mgmt.appplatform.models.JobResourceProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class JobResourceCollection(_serialization.Model): + """List of Azure Spring Apps Jobs and a possible link for next set. + + :ivar value: Collection of Job resources. + :vartype value: list[~azure.mgmt.appplatform.models.JobResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[JobResource]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.JobResource"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: Collection of Job resources. + :paramtype value: list[~azure.mgmt.appplatform.models.JobResource] + :keyword next_link: Link to next page of resources. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class JobResourceProperties(_serialization.Model): + """Job resource properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: Provisioning state of the Job. Known values are: "Succeeded", + "Failed", "Creating", "Updating", "Deleting", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.appplatform.models.JobResourceProvisioningState + :ivar template: The template which is applied for all executions of the Job. + :vartype template: ~azure.mgmt.appplatform.models.JobExecutionTemplate + :ivar source: Uploaded source information of the Job. + :vartype source: ~azure.mgmt.appplatform.models.UserSourceInfo + :ivar managed_component_references: Referenced managed components collection. + :vartype managed_component_references: + list[~azure.mgmt.appplatform.models.ManagedComponentReference] + :ivar trigger_config: The Job trigger related configuration. + :vartype trigger_config: ~azure.mgmt.appplatform.models.JobTriggerConfig + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "template": {"key": "template", "type": "JobExecutionTemplate"}, + "source": {"key": "source", "type": "UserSourceInfo"}, + "managed_component_references": {"key": "managedComponentReferences", "type": "[ManagedComponentReference]"}, + "trigger_config": {"key": "triggerConfig", "type": "JobTriggerConfig"}, + } + + def __init__( + self, + *, + template: Optional["_models.JobExecutionTemplate"] = None, + source: Optional["_models.UserSourceInfo"] = None, + managed_component_references: Optional[List["_models.ManagedComponentReference"]] = None, + trigger_config: Optional["_models.JobTriggerConfig"] = None, + **kwargs: Any + ) -> None: + """ + :keyword template: The template which is applied for all executions of the Job. + :paramtype template: ~azure.mgmt.appplatform.models.JobExecutionTemplate + :keyword source: Uploaded source information of the Job. + :paramtype source: ~azure.mgmt.appplatform.models.UserSourceInfo + :keyword managed_component_references: Referenced managed components collection. + :paramtype managed_component_references: + list[~azure.mgmt.appplatform.models.ManagedComponentReference] + :keyword trigger_config: The Job trigger related configuration. + :paramtype trigger_config: ~azure.mgmt.appplatform.models.JobTriggerConfig + """ + super().__init__(**kwargs) + self.provisioning_state: Optional[Union[str, "_models.JobResourceProvisioningState"]] = None + self.template = template + self.source = source + self.managed_component_references = managed_component_references + self.trigger_config = trigger_config + + +class JobResourceRequests(_serialization.Model): + """Job resource request payload. + + :ivar cpu: CPU allocated to each job execution instance. + :vartype cpu: str + :ivar memory: Memory allocated to each job execution instance. + :vartype memory: str + """ + + _attribute_map = { + "cpu": {"key": "cpu", "type": "str"}, + "memory": {"key": "memory", "type": "str"}, + } + + def __init__(self, *, cpu: str = "1", memory: str = "2Gi", **kwargs: Any) -> None: + """ + :keyword cpu: CPU allocated to each job execution instance. + :paramtype cpu: str + :keyword memory: Memory allocated to each job execution instance. + :paramtype memory: str + """ + super().__init__(**kwargs) + self.cpu = cpu + self.memory = memory + + +class JobTriggerConfig(_serialization.Model): + """Configuration for different trigger types. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ManualJobTriggerConfig + + All required parameters must be populated in order to send to server. + + :ivar trigger_type: Type of job trigger. "Manual" + :vartype trigger_type: str or ~azure.mgmt.appplatform.models.TriggerType + """ + + _validation = { + "trigger_type": {"required": True}, + } + + _attribute_map = { + "trigger_type": {"key": "triggerType", "type": "str"}, + } + + _subtype_map = {"trigger_type": {"Manual": "ManualJobTriggerConfig"}} + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.trigger_type: Optional[str] = None + + +class KeyVaultCertificateProperties(CertificateProperties): """Properties of certificate imported from key vault. Variables are only populated by the server, and will be ignored when sending a request. @@ -7044,6 +7948,60 @@ def __init__( self.blob_duration = blob_duration +class MaintenanceScheduleConfiguration(_serialization.Model): + """Configuration for the planned maintenance. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + WeeklyMaintenanceScheduleConfiguration + + All required parameters must be populated in order to send to server. + + :ivar frequency: The frequency to run the maintenance job. Required. "Weekly" + :vartype frequency: str or ~azure.mgmt.appplatform.models.Frequency + """ + + _validation = { + "frequency": {"required": True}, + } + + _attribute_map = { + "frequency": {"key": "frequency", "type": "str"}, + } + + _subtype_map = {"frequency": {"Weekly": "WeeklyMaintenanceScheduleConfiguration"}} + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.frequency: Optional[str] = None + + +class ManagedComponentReference(_serialization.Model): + """A reference to the managed component like Config Server. + + All required parameters must be populated in order to send to server. + + :ivar resource_id: Resource Id of the managed component. Required. + :vartype resource_id: str + """ + + _validation = { + "resource_id": {"required": True}, + } + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + } + + def __init__(self, *, resource_id: str, **kwargs: Any) -> None: + """ + :keyword resource_id: Resource Id of the managed component. Required. + :paramtype resource_id: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + + class ManagedIdentityProperties(_serialization.Model): """Managed identity properties retrieved from ARM request headers. @@ -7094,6 +8052,55 @@ def __init__( self.user_assigned_identities = user_assigned_identities +class ManualJobTriggerConfig(JobTriggerConfig): + """Configuration for manual triggered job. + + All required parameters must be populated in order to send to server. + + :ivar trigger_type: Type of job trigger. "Manual" + :vartype trigger_type: str or ~azure.mgmt.appplatform.models.TriggerType + :ivar parallelism: Number of parallel replicas of a job execution can run. + :vartype parallelism: int + :ivar timeout_in_seconds: Maximum number of seconds an execution is allowed to run. + :vartype timeout_in_seconds: int + :ivar retry_limit: Maximum number of retries before failing the job. + :vartype retry_limit: int + """ + + _validation = { + "trigger_type": {"required": True}, + } + + _attribute_map = { + "trigger_type": {"key": "triggerType", "type": "str"}, + "parallelism": {"key": "parallelism", "type": "int"}, + "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, + "retry_limit": {"key": "retryLimit", "type": "int"}, + } + + def __init__( + self, + *, + parallelism: Optional[int] = None, + timeout_in_seconds: Optional[int] = None, + retry_limit: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword parallelism: Number of parallel replicas of a job execution can run. + :paramtype parallelism: int + :keyword timeout_in_seconds: Maximum number of seconds an execution is allowed to run. + :paramtype timeout_in_seconds: int + :keyword retry_limit: Maximum number of retries before failing the job. + :paramtype retry_limit: int + """ + super().__init__(**kwargs) + self.trigger_type: str = "Manual" + self.parallelism = parallelism + self.timeout_in_seconds = timeout_in_seconds + self.retry_limit = retry_limit + + class MarketplaceResource(_serialization.Model): """Purchasing 3rd Party product for one Azure Spring Apps instance. @@ -7174,7 +8181,7 @@ def __init__( self.to_be_exported_for_shoebox = to_be_exported_for_shoebox -class MetricSpecification(_serialization.Model): # pylint: disable=too-many-instance-attributes +class MetricSpecification(_serialization.Model): """Specifications of the Metrics for Azure Monitoring. :ivar name: Name of the metric. @@ -7342,7 +8349,7 @@ def __init__( ~azure.mgmt.appplatform.models.ApplicationInsightsAgentVersions """ super().__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.MonitoringSettingState"]] = None self.error = error self.trace_enabled = trace_enabled self.app_insights_instrumentation_key = app_insights_instrumentation_key @@ -7601,8 +8608,8 @@ def __init__( self.service_cidr = service_cidr self.service_runtime_network_resource_group = service_runtime_network_resource_group self.app_network_resource_group = app_network_resource_group - self.outbound_i_ps = None - self.required_traffics = None + self.outbound_i_ps: Optional["_models.NetworkProfileOutboundIPs"] = None + self.required_traffics: Optional[List["_models.RequiredTraffic"]] = None self.ingress_config = ingress_config self.outbound_type = outbound_type @@ -7627,7 +8634,7 @@ class NetworkProfileOutboundIPs(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.public_i_ps = None + self.public_i_ps: Optional[List[str]] = None class OperationDetail(_serialization.Model): @@ -7689,7 +8696,7 @@ def __init__( self.name = name self.is_data_action = is_data_action self.display = display - self.action_type = None + self.action_type: Optional[Union[str, "_models.ActionType"]] = None self.origin = origin self.properties = properties @@ -7795,7 +8802,7 @@ def __init__(self, *, size_in_gb: Optional[int] = None, mount_path: Optional[str """ super().__init__(**kwargs) self.size_in_gb = size_in_gb - self.used_in_gb = None + self.used_in_gb: Optional[int] = None self.mount_path = mount_path @@ -7844,11 +8851,11 @@ def __init__(self, *, state: Union[str, "_models.PredefinedAcceleratorState"] = :paramtype state: str or ~azure.mgmt.appplatform.models.PredefinedAcceleratorState """ super().__init__(**kwargs) - self.provisioning_state = None - self.display_name = None - self.description = None - self.icon_url = None - self.accelerator_tags = None + self.provisioning_state: Optional[Union[str, "_models.PredefinedAcceleratorProvisioningState"]] = None + self.display_name: Optional[str] = None + self.description: Optional[str] = None + self.icon_url: Optional[str] = None + self.accelerator_tags: Optional[List[str]] = None self.state = state @@ -8020,6 +9027,45 @@ def __init__( self.success_threshold = success_threshold +class QueueScaleRule(_serialization.Model): + """Azure Spring Apps App Instance Azure Queue based scaling rule. + + :ivar queue_name: Queue name. + :vartype queue_name: str + :ivar queue_length: Queue length. + :vartype queue_length: int + :ivar auth: Authentication secrets for the queue scale rule. + :vartype auth: list[~azure.mgmt.appplatform.models.ScaleRuleAuth] + """ + + _attribute_map = { + "queue_name": {"key": "queueName", "type": "str"}, + "queue_length": {"key": "queueLength", "type": "int"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + } + + def __init__( + self, + *, + queue_name: Optional[str] = None, + queue_length: Optional[int] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword queue_name: Queue name. + :paramtype queue_name: str + :keyword queue_length: Queue length. + :paramtype queue_length: int + :keyword auth: Authentication secrets for the queue scale rule. + :paramtype auth: list[~azure.mgmt.appplatform.models.ScaleRuleAuth] + """ + super().__init__(**kwargs) + self.queue_name = queue_name + self.queue_length = queue_length + self.auth = auth + + class RegenerateTestKeyRequestPayload(_serialization.Model): """Regenerate test key request payload. @@ -8128,11 +9174,11 @@ class RequiredTraffic(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.protocol = None - self.port = None - self.ips = None - self.fqdns = None - self.direction = None + self.protocol: Optional[str] = None + self.port: Optional[int] = None + self.ips: Optional[List[str]] = None + self.fqdns: Optional[List[str]] = None + self.direction: Optional[Union[str, "_models.TrafficDirection"]] = None class ResourceRequests(_serialization.Model): @@ -8475,6 +9521,155 @@ def __init__(self, *, relative_path: Optional[str] = None, upload_url: Optional[ self.upload_url = upload_url +class Scale(_serialization.Model): + """Azure Spring Apps scaling configurations. + + :ivar min_replicas: Optional. Minimum number of container replicas. + :vartype min_replicas: int + :ivar max_replicas: Optional. Maximum number of container replicas. Defaults to 10 if not set. + :vartype max_replicas: int + :ivar rules: Scaling rules. + :vartype rules: list[~azure.mgmt.appplatform.models.ScaleRule] + """ + + _attribute_map = { + "min_replicas": {"key": "minReplicas", "type": "int"}, + "max_replicas": {"key": "maxReplicas", "type": "int"}, + "rules": {"key": "rules", "type": "[ScaleRule]"}, + } + + def __init__( + self, + *, + min_replicas: Optional[int] = None, + max_replicas: int = 10, + rules: Optional[List["_models.ScaleRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword min_replicas: Optional. Minimum number of container replicas. + :paramtype min_replicas: int + :keyword max_replicas: Optional. Maximum number of container replicas. Defaults to 10 if not + set. + :paramtype max_replicas: int + :keyword rules: Scaling rules. + :paramtype rules: list[~azure.mgmt.appplatform.models.ScaleRule] + """ + super().__init__(**kwargs) + self.min_replicas = min_replicas + self.max_replicas = max_replicas + self.rules = rules + + +class ScaleRule(_serialization.Model): + """Azure Spring Apps App Instance scaling rule. + + :ivar name: Scale Rule Name. + :vartype name: str + :ivar azure_queue: Azure Queue based scaling. + :vartype azure_queue: ~azure.mgmt.appplatform.models.QueueScaleRule + :ivar custom: Custom scale rule. + :vartype custom: ~azure.mgmt.appplatform.models.CustomScaleRule + :ivar http: HTTP requests based scaling. + :vartype http: ~azure.mgmt.appplatform.models.HttpScaleRule + :ivar tcp: Tcp requests based scaling. + :vartype tcp: ~azure.mgmt.appplatform.models.TcpScaleRule + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "azure_queue": {"key": "azureQueue", "type": "QueueScaleRule"}, + "custom": {"key": "custom", "type": "CustomScaleRule"}, + "http": {"key": "http", "type": "HttpScaleRule"}, + "tcp": {"key": "tcp", "type": "TcpScaleRule"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + azure_queue: Optional["_models.QueueScaleRule"] = None, + custom: Optional["_models.CustomScaleRule"] = None, + http: Optional["_models.HttpScaleRule"] = None, + tcp: Optional["_models.TcpScaleRule"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Scale Rule Name. + :paramtype name: str + :keyword azure_queue: Azure Queue based scaling. + :paramtype azure_queue: ~azure.mgmt.appplatform.models.QueueScaleRule + :keyword custom: Custom scale rule. + :paramtype custom: ~azure.mgmt.appplatform.models.CustomScaleRule + :keyword http: HTTP requests based scaling. + :paramtype http: ~azure.mgmt.appplatform.models.HttpScaleRule + :keyword tcp: Tcp requests based scaling. + :paramtype tcp: ~azure.mgmt.appplatform.models.TcpScaleRule + """ + super().__init__(**kwargs) + self.name = name + self.azure_queue = azure_queue + self.custom = custom + self.http = http + self.tcp = tcp + + +class ScaleRuleAuth(_serialization.Model): + """Auth Secrets for Azure Spring Apps App Instance Scale Rule. + + :ivar secret_ref: Name of the Azure Spring Apps App Instance secret from which to pull the auth + params. + :vartype secret_ref: str + :ivar trigger_parameter: Trigger Parameter that uses the secret. + :vartype trigger_parameter: str + """ + + _attribute_map = { + "secret_ref": {"key": "secretRef", "type": "str"}, + "trigger_parameter": {"key": "triggerParameter", "type": "str"}, + } + + def __init__( + self, *, secret_ref: Optional[str] = None, trigger_parameter: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword secret_ref: Name of the Azure Spring Apps App Instance secret from which to pull the + auth params. + :paramtype secret_ref: str + :keyword trigger_parameter: Trigger Parameter that uses the secret. + :paramtype trigger_parameter: str + """ + super().__init__(**kwargs) + self.secret_ref = secret_ref + self.trigger_parameter = trigger_parameter + + +class Secret(_serialization.Model): + """Secret definition. + + :ivar name: Secret Name. + :vartype name: str + :ivar value: Secret Value. + :vartype value: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Secret Name. + :paramtype name: str + :keyword value: Secret Value. + :paramtype value: str + """ + super().__init__(**kwargs) + self.name = name + self.value = value + + class ServiceRegistryInstance(_serialization.Model): """Collection of instances belong to the Service Registry. @@ -8499,8 +9694,8 @@ class ServiceRegistryInstance(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.status = None + self.name: Optional[str] = None + self.status: Optional[str] = None class ServiceRegistryProperties(_serialization.Model): @@ -8533,9 +9728,9 @@ class ServiceRegistryProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provisioning_state = None - self.resource_requests = None - self.instances = None + self.provisioning_state: Optional[Union[str, "_models.ServiceRegistryProvisioningState"]] = None + self.resource_requests: Optional["_models.ServiceRegistryResourceRequests"] = None + self.instances: Optional[List["_models.ServiceRegistryInstance"]] = None class ServiceRegistryResource(ProxyResource): @@ -8618,7 +9813,7 @@ class ServiceRegistryResourceRequests(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar cpu: Cpu allocated to each Service Registry instance. + :ivar cpu: CPU allocated to each Service Registry instance. :vartype cpu: str :ivar memory: Memory allocated to each Service Registry instance. :vartype memory: str @@ -8641,9 +9836,9 @@ class ServiceRegistryResourceRequests(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.cpu = None - self.memory = None - self.instance_count = None + self.cpu: Optional[str] = None + self.memory: Optional[str] = None + self.instance_count: Optional[int] = None class TrackedResource(Resource): @@ -8713,6 +9908,8 @@ class ServiceResource(TrackedResource): :vartype tags: dict[str, str] :ivar properties: Properties of the Service resource. :vartype properties: ~azure.mgmt.appplatform.models.ClusterResourceProperties + :ivar identity: Managed Identity of the Service resource. + :vartype identity: ~azure.mgmt.appplatform.models.SystemAssignedServiceIdentity :ivar sku: Sku of the Service resource. :vartype sku: ~azure.mgmt.appplatform.models.Sku """ @@ -8732,6 +9929,7 @@ class ServiceResource(TrackedResource): "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, "properties": {"key": "properties", "type": "ClusterResourceProperties"}, + "identity": {"key": "identity", "type": "SystemAssignedServiceIdentity"}, "sku": {"key": "sku", "type": "Sku"}, } @@ -8741,6 +9939,7 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, properties: Optional["_models.ClusterResourceProperties"] = None, + identity: Optional["_models.SystemAssignedServiceIdentity"] = None, sku: Optional["_models.Sku"] = None, **kwargs: Any ) -> None: @@ -8752,11 +9951,14 @@ def __init__( :paramtype tags: dict[str, str] :keyword properties: Properties of the Service resource. :paramtype properties: ~azure.mgmt.appplatform.models.ClusterResourceProperties + :keyword identity: Managed Identity of the Service resource. + :paramtype identity: ~azure.mgmt.appplatform.models.SystemAssignedServiceIdentity :keyword sku: Sku of the Service resource. :paramtype sku: ~azure.mgmt.appplatform.models.Sku """ super().__init__(location=location, tags=tags, **kwargs) self.properties = properties + self.identity = identity self.sku = sku @@ -8831,15 +10033,30 @@ class ServiceVNetAddons(_serialization.Model): :ivar data_plane_public_endpoint: Indicates whether the data plane components(log stream, app connect, remote debugging) in vnet injection instance could be accessed from internet. :vartype data_plane_public_endpoint: bool + :ivar private_storage_access: Indicates whether the vnet injection service enables private + links for backend storage account and container registry. Known values are: "Enabled" and + "Disabled". + :vartype private_storage_access: str or ~azure.mgmt.appplatform.models.PrivateStorageAccess + :ivar private_dns_zone_id: Fully qualified resource Id of the Private DNS zone to link with the + customer virtual network. + :vartype private_dns_zone_id: str """ _attribute_map = { "log_stream_public_endpoint": {"key": "logStreamPublicEndpoint", "type": "bool"}, "data_plane_public_endpoint": {"key": "dataPlanePublicEndpoint", "type": "bool"}, + "private_storage_access": {"key": "privateStorageAccess", "type": "str"}, + "private_dns_zone_id": {"key": "privateDnsZoneId", "type": "str"}, } def __init__( - self, *, log_stream_public_endpoint: bool = False, data_plane_public_endpoint: bool = False, **kwargs: Any + self, + *, + log_stream_public_endpoint: bool = False, + data_plane_public_endpoint: bool = False, + private_storage_access: Optional[Union[str, "_models.PrivateStorageAccess"]] = None, + private_dns_zone_id: Optional[str] = None, + **kwargs: Any ) -> None: """ :keyword log_stream_public_endpoint: Indicates whether the log stream in vnet injection @@ -8848,10 +10065,19 @@ def __init__( :keyword data_plane_public_endpoint: Indicates whether the data plane components(log stream, app connect, remote debugging) in vnet injection instance could be accessed from internet. :paramtype data_plane_public_endpoint: bool + :keyword private_storage_access: Indicates whether the vnet injection service enables private + links for backend storage account and container registry. Known values are: "Enabled" and + "Disabled". + :paramtype private_storage_access: str or ~azure.mgmt.appplatform.models.PrivateStorageAccess + :keyword private_dns_zone_id: Fully qualified resource Id of the Private DNS zone to link with + the customer virtual network. + :paramtype private_dns_zone_id: str """ super().__init__(**kwargs) self.log_stream_public_endpoint = log_stream_public_endpoint self.data_plane_public_endpoint = data_plane_public_endpoint + self.private_storage_access = private_storage_access + self.private_dns_zone_id = private_dns_zone_id class Sku(_serialization.Model): @@ -9337,19 +10563,25 @@ class SupportedBuildpackResourceProperties(_serialization.Model): :ivar buildpack_id: The id of supported buildpack. :vartype buildpack_id: str + :ivar version: The version of supported buildpack. + :vartype version: str """ _attribute_map = { "buildpack_id": {"key": "buildpackId", "type": "str"}, + "version": {"key": "version", "type": "str"}, } - def __init__(self, *, buildpack_id: Optional[str] = None, **kwargs: Any) -> None: + def __init__(self, *, buildpack_id: Optional[str] = None, version: Optional[str] = None, **kwargs: Any) -> None: """ :keyword buildpack_id: The id of supported buildpack. :paramtype buildpack_id: str + :keyword version: The version of supported buildpack. + :paramtype version: str """ super().__init__(**kwargs) self.buildpack_id = buildpack_id + self.version = version class SupportedBuildpacksCollection(_serialization.Model): @@ -9391,7 +10623,7 @@ class SupportedRuntimeVersion(_serialization.Model): """Supported deployment runtime version descriptor. :ivar value: The raw value which could be passed to deployment CRUD operations. Known values - are: "Java_8", "Java_11", "Java_17", and "NetCore_31". + are: "Java_8", "Java_11", "Java_17", "Java_21", and "NetCore_31". :vartype value: str or ~azure.mgmt.appplatform.models.SupportedRuntimeValue :ivar platform: The platform of this runtime version (possible values: "Java" or ".NET"). Known values are: "Java" and ".NET Core". @@ -9416,7 +10648,7 @@ def __init__( ) -> None: """ :keyword value: The raw value which could be passed to deployment CRUD operations. Known values - are: "Java_8", "Java_11", "Java_17", and "NetCore_31". + are: "Java_8", "Java_11", "Java_17", "Java_21", and "NetCore_31". :paramtype value: str or ~azure.mgmt.appplatform.models.SupportedRuntimeValue :keyword platform: The platform of this runtime version (possible values: "Java" or ".NET"). Known values are: "Java" and ".NET Core". @@ -9602,6 +10834,48 @@ def __init__( self.next_link = next_link +class SystemAssignedServiceIdentity(_serialization.Model): + """Managed service identity (either system assigned, or none). + + 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 principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: Type of managed service identity (either system assigned, or none). Required. Known + values are: "None" and "SystemAssigned". + :vartype type: str or ~azure.mgmt.appplatform.models.SystemAssignedServiceIdentityType + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, type: Union[str, "_models.SystemAssignedServiceIdentityType"], **kwargs: Any) -> None: + """ + :keyword type: Type of managed service identity (either system assigned, or none). Required. + Known values are: "None" and "SystemAssigned". + :paramtype type: str or ~azure.mgmt.appplatform.models.SystemAssignedServiceIdentityType + """ + super().__init__(**kwargs) + self.principal_id: Optional[str] = None + self.tenant_id: Optional[str] = None + self.type = type + + class SystemData(_serialization.Model): """Metadata pertaining to creation and last modification of the resource. @@ -9666,6 +10940,38 @@ def __init__( self.last_modified_at = last_modified_at +class TcpScaleRule(_serialization.Model): + """Azure Spring Apps App Instance Tcp scaling rule. + + :ivar metadata: Metadata properties to describe tcp scale rule. + :vartype metadata: dict[str, str] + :ivar auth: Authentication secrets for the tcp scale rule. + :vartype auth: list[~azure.mgmt.appplatform.models.ScaleRuleAuth] + """ + + _attribute_map = { + "metadata": {"key": "metadata", "type": "{str}"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword metadata: Metadata properties to describe tcp scale rule. + :paramtype metadata: dict[str, str] + :keyword auth: Authentication secrets for the tcp scale rule. + :paramtype auth: list[~azure.mgmt.appplatform.models.ScaleRuleAuth] + """ + super().__init__(**kwargs) + self.metadata = metadata + self.auth = auth + + class TCPSocketAction(ProbeAction): """TCPSocketAction describes an action based on opening a socket. @@ -9831,7 +11137,7 @@ def __init__( """ super().__init__(**kwargs) self.id = id - self.provisioning_state = None + self.provisioning_state: Optional[Union[str, "_models.TriggeredBuildResultProvisioningState"]] = None self.image = image self.last_transition_time = last_transition_time self.last_transition_reason = last_transition_reason @@ -9862,8 +11168,8 @@ class UserAssignedManagedIdentity(_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 ValidationMessages(_serialization.Model): @@ -9951,3 +11257,51 @@ def __init__( self.runtime_version = runtime_version self.jvm_options = jvm_options self.server_version = server_version + + +class WeeklyMaintenanceScheduleConfiguration(MaintenanceScheduleConfiguration): + """Weekly planned maintenance. + + 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 frequency: The frequency to run the maintenance job. Required. "Weekly" + :vartype frequency: str or ~azure.mgmt.appplatform.models.Frequency + :ivar hour: The hour to run the maintenance job. Required. + :vartype hour: int + :ivar duration: The duration time to run the maintenance job, specified in ISO8601 format, e.g. + PT8H. + :vartype duration: str + :ivar day: The day to run the maintenance job. Required. Known values are: "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". + :vartype day: str or ~azure.mgmt.appplatform.models.WeekDay + """ + + _validation = { + "frequency": {"required": True}, + "hour": {"required": True, "maximum": 23, "minimum": 0}, + "duration": {"readonly": True}, + "day": {"required": True}, + } + + _attribute_map = { + "frequency": {"key": "frequency", "type": "str"}, + "hour": {"key": "hour", "type": "int"}, + "duration": {"key": "duration", "type": "str"}, + "day": {"key": "day", "type": "str"}, + } + + def __init__(self, *, hour: int, day: Union[str, "_models.WeekDay"], **kwargs: Any) -> None: + """ + :keyword hour: The hour to run the maintenance job. Required. + :paramtype hour: int + :keyword day: The day to run the maintenance job. Required. Known values are: "Monday", + "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". + :paramtype day: str or ~azure.mgmt.appplatform.models.WeekDay + """ + super().__init__(**kwargs) + self.frequency: str = "Weekly" + self.hour = hour + self.duration: Optional[str] = None + self.day = day diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/__init__.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/__init__.py index 71f15acbbfb3..291baeb1ed37 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/__init__.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/__init__.py @@ -5,45 +5,57 @@ # 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 ._services_operations import ServicesOperations -from ._apms_operations import ApmsOperations -from ._config_servers_operations import ConfigServersOperations -from ._configuration_services_operations import ConfigurationServicesOperations -from ._service_registries_operations import ServiceRegistriesOperations -from ._application_live_views_operations import ApplicationLiveViewsOperations -from ._dev_tool_portals_operations import DevToolPortalsOperations -from ._container_registries_operations import ContainerRegistriesOperations -from ._build_service_operations import BuildServiceOperations -from ._buildpack_binding_operations import BuildpackBindingOperations -from ._build_service_builder_operations import BuildServiceBuilderOperations -from ._build_service_agent_pool_operations import BuildServiceAgentPoolOperations -from ._monitoring_settings_operations import MonitoringSettingsOperations -from ._apps_operations import AppsOperations -from ._bindings_operations import BindingsOperations -from ._storages_operations import StoragesOperations -from ._certificates_operations import CertificatesOperations -from ._custom_domains_operations import CustomDomainsOperations -from ._deployments_operations import DeploymentsOperations -from ._operations import Operations -from ._runtime_versions_operations import RuntimeVersionsOperations -from ._skus_operations import SkusOperations -from ._gateways_operations import GatewaysOperations -from ._gateway_route_configs_operations import GatewayRouteConfigsOperations -from ._gateway_custom_domains_operations import GatewayCustomDomainsOperations -from ._api_portals_operations import ApiPortalsOperations -from ._api_portal_custom_domains_operations import ApiPortalCustomDomainsOperations -from ._application_accelerators_operations import ApplicationAcceleratorsOperations -from ._customized_accelerators_operations import CustomizedAcceleratorsOperations -from ._predefined_accelerators_operations import PredefinedAcceleratorsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._services_operations import ServicesOperations # type: ignore +from ._apms_operations import ApmsOperations # type: ignore +from ._eureka_servers_operations import EurekaServersOperations # type: ignore +from ._config_servers_operations import ConfigServersOperations # type: ignore +from ._configuration_services_operations import ConfigurationServicesOperations # type: ignore +from ._service_registries_operations import ServiceRegistriesOperations # type: ignore +from ._application_live_views_operations import ApplicationLiveViewsOperations # type: ignore +from ._dev_tool_portals_operations import DevToolPortalsOperations # type: ignore +from ._container_registries_operations import ContainerRegistriesOperations # type: ignore +from ._build_service_operations import BuildServiceOperations # type: ignore +from ._buildpack_binding_operations import BuildpackBindingOperations # type: ignore +from ._build_service_builder_operations import BuildServiceBuilderOperations # type: ignore +from ._build_service_agent_pool_operations import BuildServiceAgentPoolOperations # type: ignore +from ._monitoring_settings_operations import MonitoringSettingsOperations # type: ignore +from ._apps_operations import AppsOperations # type: ignore +from ._bindings_operations import BindingsOperations # type: ignore +from ._storages_operations import StoragesOperations # type: ignore +from ._certificates_operations import CertificatesOperations # type: ignore +from ._custom_domains_operations import CustomDomainsOperations # type: ignore +from ._deployments_operations import DeploymentsOperations # type: ignore +from ._operations import Operations # type: ignore +from ._runtime_versions_operations import RuntimeVersionsOperations # type: ignore +from ._skus_operations import SkusOperations # type: ignore +from ._gateways_operations import GatewaysOperations # type: ignore +from ._gateway_route_configs_operations import GatewayRouteConfigsOperations # type: ignore +from ._gateway_custom_domains_operations import GatewayCustomDomainsOperations # type: ignore +from ._api_portals_operations import ApiPortalsOperations # type: ignore +from ._api_portal_custom_domains_operations import ApiPortalCustomDomainsOperations # type: ignore +from ._application_accelerators_operations import ApplicationAcceleratorsOperations # type: ignore +from ._customized_accelerators_operations import CustomizedAcceleratorsOperations # type: ignore +from ._predefined_accelerators_operations import PredefinedAcceleratorsOperations # type: ignore +from ._jobs_operations import JobsOperations # type: ignore +from ._job_operations import JobOperations # type: ignore +from ._job_execution_operations import JobExecutionOperations # type: ignore +from ._job_executions_operations import JobExecutionsOperations # 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__ = [ "ServicesOperations", "ApmsOperations", + "EurekaServersOperations", "ConfigServersOperations", "ConfigurationServicesOperations", "ServiceRegistriesOperations", @@ -72,6 +84,10 @@ "ApplicationAcceleratorsOperations", "CustomizedAcceleratorsOperations", "PredefinedAcceleratorsOperations", + "JobsOperations", + "JobOperations", + "JobExecutionOperations", + "JobExecutionsOperations", ] -__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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_api_portal_custom_domains_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_api_portal_custom_domains_operations.py index 791e95f0f5e2..e4ffc1758a07 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_api_portal_custom_domains_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_api_portal_custom_domains_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 AppPlatformManagementClientConfiguration +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_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -93,7 +91,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -101,7 +99,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -134,14 +132,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -167,14 +165,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -207,10 +205,12 @@ class ApiPortalCustomDomainsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -231,7 +231,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.ApiPortalCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +284,7 @@ def _create_or_update_initial( api_portal_custom_domain_resource: Union[_models.ApiPortalCustomDomainResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -501,7 +501,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, domain_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -636,7 +636,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApiPortalCustomDomainResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_api_portals_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_api_portals_operations.py index 2535eb8ceac9..91ec346ec4b3 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_api_portals_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_api_portals_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 AppPlatformManagementClientConfiguration +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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -82,7 +80,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -90,7 +88,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -117,14 +115,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -147,14 +145,14 @@ def build_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -178,7 +176,7 @@ def build_validate_domain_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -186,7 +184,7 @@ def build_validate_domain_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -221,10 +219,12 @@ class ApiPortalsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -243,7 +243,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.ApiPortalResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -294,7 +294,7 @@ def _create_or_update_initial( api_portal_resource: Union[_models.ApiPortalResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -493,7 +493,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, api_portal_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -618,7 +618,7 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApiPortalResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -765,7 +765,7 @@ def validate_domain( :rtype: ~azure.mgmt.appplatform.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apms_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apms_operations.py index acf0cea5fa94..c097f2208747 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apms_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apms_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 AppPlatformManagementClientConfiguration +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_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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.AppPlatform/Spring/{serviceName}/apms/{apmName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -146,14 +144,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -178,14 +176,14 @@ def build_list_secret_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -218,10 +216,12 @@ class ApmsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, **kwargs: Any) -> Iterable["_models.ApmResource"]: @@ -242,7 +242,7 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApmResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +319,7 @@ def get(self, resource_group_name: str, service_name: str, apm_name: str, **kwar :rtype: ~azure.mgmt.appplatform.models.ApmResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +370,7 @@ def _create_or_update_initial( apm_resource: Union[_models.ApmResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -569,7 +569,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, apm_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +698,7 @@ def list_secret_keys( :rtype: ~azure.mgmt.appplatform.models.ApmSecretKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_application_accelerators_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_application_accelerators_operations.py index 4559adc3dbe7..9a9e10c35ff4 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_application_accelerators_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_application_accelerators_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 AppPlatformManagementClientConfiguration +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_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -192,10 +190,12 @@ class ApplicationAcceleratorsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +220,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApplicationAcceleratorResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +299,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.ApplicationAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +350,7 @@ def _create_or_update_initial( application_accelerator_resource: Union[_models.ApplicationAcceleratorResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -556,7 +556,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, application_accelerator_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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_application_live_views_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_application_live_views_operations.py index fe8aa1198078..f73226943ab4 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_application_live_views_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_application_live_views_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 AppPlatformManagementClientConfiguration +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_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -192,10 +190,12 @@ class ApplicationLiveViewsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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 +220,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ApplicationLiveViewResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +299,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.ApplicationLiveViewResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -350,7 +350,7 @@ def _create_or_update_initial( application_live_view_resource: Union[_models.ApplicationLiveViewResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -554,7 +554,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, application_live_view_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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apps_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apps_operations.py index 45df5f1044f5..e6b4c72c0197 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_apps_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_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 AppPlatformManagementClientConfiguration +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]] @@ -56,14 +54,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -90,7 +88,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -98,7 +96,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -125,14 +123,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -157,7 +155,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -165,7 +163,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -190,14 +188,14 @@ def build_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -221,14 +219,14 @@ def build_get_resource_upload_url_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -253,7 +251,7 @@ def build_set_active_deployments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -261,7 +259,7 @@ def build_set_active_deployments_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -288,7 +286,7 @@ def build_validate_domain_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -296,7 +294,7 @@ def build_validate_domain_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -331,10 +329,12 @@ class AppsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -360,7 +360,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.AppResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -412,7 +412,7 @@ def _create_or_update_initial( app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -611,7 +611,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, app_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -725,7 +725,7 @@ def _update_initial( app_resource: Union[_models.AppResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -940,7 +940,7 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AppResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1019,7 +1019,7 @@ def get_resource_upload_url( :rtype: ~azure.mgmt.appplatform.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1070,7 +1070,7 @@ def _set_active_deployments_initial( active_deployment_collection: Union[_models.ActiveDeploymentCollection, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1352,7 +1352,7 @@ def validate_domain( :rtype: ~azure.mgmt.appplatform.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_bindings_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_bindings_operations.py index c274415edf53..653a9f823b66 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_bindings_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_bindings_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 AppPlatformManagementClientConfiguration +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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -119,14 +117,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -152,7 +150,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -160,7 +158,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -188,14 +186,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -228,10 +226,12 @@ class BindingsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -252,7 +252,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.BindingResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +305,7 @@ def _create_or_update_initial( binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +515,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, app_name: str, binding_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +634,7 @@ def _update_initial( binding_resource: Union[_models.BindingResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -864,7 +864,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BindingResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_agent_pool_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_agent_pool_operations.py index d0c0407e3d5b..628103fa117b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_agent_pool_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_agent_pool_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 AppPlatformManagementClientConfiguration +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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -125,7 +123,7 @@ def build_update_put_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -133,7 +131,7 @@ def build_update_put_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -169,10 +167,12 @@ class BuildServiceAgentPoolOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -199,7 +199,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuildServiceAgentPoolResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -281,7 +281,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.BuildServiceAgentPoolResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ def _update_put_initial( agent_pool_resource: Union[_models.BuildServiceAgentPoolResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_builder_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_builder_operations.py index c8ba19d73653..0f060df2b73b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_builder_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_builder_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 AppPlatformManagementClientConfiguration +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_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -93,7 +91,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -101,7 +99,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -134,14 +132,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -167,14 +165,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -204,14 +202,14 @@ def build_list_deployments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -245,10 +243,12 @@ class BuildServiceBuilderOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -269,7 +269,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.BuilderResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +322,7 @@ def _create_or_update_initial( builder_resource: Union[_models.BuilderResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -532,7 +532,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, build_service_name: str, builder_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +665,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuilderResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -747,7 +747,7 @@ def list_deployments( :rtype: ~azure.mgmt.appplatform.models.DeploymentList :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_operations.py index c6152c708bbd..6ed3dcb23f26 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_build_service_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 AppPlatformManagementClientConfiguration +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_build_services_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -81,14 +79,14 @@ def build_get_build_service_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -148,14 +146,14 @@ def build_list_builds_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -185,14 +183,14 @@ def build_get_build_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -223,7 +221,7 @@ def build_create_or_update_build_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -231,7 +229,7 @@ def build_create_or_update_build_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -264,14 +262,14 @@ def build_delete_build_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -302,14 +300,14 @@ def build_list_build_results_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -341,14 +339,14 @@ def build_get_build_result_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -381,14 +379,14 @@ def build_get_build_result_log_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -415,14 +413,14 @@ def build_get_resource_upload_url_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -447,14 +445,14 @@ def build_list_supported_buildpacks_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -484,14 +482,14 @@ def build_get_supported_buildpack_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -517,14 +515,14 @@ def build_list_supported_stacks_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -554,14 +552,14 @@ def build_get_supported_stack_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -595,10 +593,12 @@ class BuildServiceOperations: 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: AppPlatformManagementClientConfiguration = ( + 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_build_services( @@ -621,7 +621,7 @@ def list_build_services( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuildServiceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -700,7 +700,7 @@ def get_build_service( :rtype: ~azure.mgmt.appplatform.models.BuildService :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -751,7 +751,7 @@ def _create_or_update_initial( build_service: Union[_models.BuildService, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -972,7 +972,7 @@ def list_builds( 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, @@ -1054,7 +1054,7 @@ def get_build( :rtype: ~azure.mgmt.appplatform.models.Build :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1192,7 +1192,7 @@ def create_or_update_build( :rtype: ~azure.mgmt.appplatform.models.Build :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1251,7 @@ def create_or_update_build( def _delete_build_initial( self, resource_group_name: str, service_name: str, build_service_name: str, build_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1392,7 +1392,7 @@ def list_build_results( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuildResultCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1483,7 +1483,7 @@ def get_build_result( :rtype: ~azure.mgmt.appplatform.models.BuildResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1555,7 +1555,7 @@ def get_build_result_log( :rtype: ~azure.mgmt.appplatform.models.BuildResultLog :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1617,7 +1617,7 @@ def get_resource_upload_url( :rtype: ~azure.mgmt.appplatform.models.ResourceUploadDefinition :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1677,7 +1677,7 @@ def list_supported_buildpacks( :rtype: ~azure.mgmt.appplatform.models.SupportedBuildpacksCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1739,7 +1739,7 @@ def get_supported_buildpack( :rtype: ~azure.mgmt.appplatform.models.SupportedBuildpackResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1800,7 +1800,7 @@ def list_supported_stacks( :rtype: ~azure.mgmt.appplatform.models.SupportedStacksCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1862,7 +1862,7 @@ def get_supported_stack( :rtype: ~azure.mgmt.appplatform.models.SupportedStackResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_buildpack_binding_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_buildpack_binding_operations.py index f17c3855d2c1..b5e82bf6ed8b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_buildpack_binding_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_buildpack_binding_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 AppPlatformManagementClientConfiguration +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_for_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -209,14 +207,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -250,10 +248,12 @@ class BuildpackBindingOperations: 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: AppPlatformManagementClientConfiguration = ( + 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_for_cluster( @@ -277,7 +277,7 @@ def list_for_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuildpackBindingResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +366,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.BuildpackBindingResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -421,7 +421,7 @@ def _create_or_update_initial( buildpack_binding: Union[_models.BuildpackBindingResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -650,7 +650,7 @@ def _delete_initial( buildpack_binding_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -796,7 +796,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BuildpackBindingResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_certificates_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_certificates_operations.py index c075c3dea97c..c26f68709754 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_certificates_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/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, 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 AppPlatformManagementClientConfiguration +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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -82,7 +80,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -90,7 +88,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -117,14 +115,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -147,14 +145,14 @@ def build_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -186,10 +184,12 @@ 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -208,7 +208,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.CertificateResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -259,7 +259,7 @@ def _create_or_update_initial( certificate_resource: Union[_models.CertificateResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +458,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, certificate_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -585,7 +585,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CertificateResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_config_servers_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_config_servers_operations.py index 31aefc78584d..a6a76a14bb1b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_config_servers_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_config_servers_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,10 +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, 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, @@ -20,6 +22,7 @@ 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 @@ -29,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AppPlatformManagementClientConfiguration +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 +46,14 @@ def build_get_request(resource_group_name: str, service_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -77,7 +77,7 @@ def build_update_put_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -85,7 +85,7 @@ def build_update_put_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -111,7 +111,7 @@ def build_update_patch_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -119,7 +119,7 @@ def build_update_patch_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -139,13 +139,73 @@ def build_update_patch_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) +def build_delete_request( + resource_group_name: str, service_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[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, service_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[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_validate_request( resource_group_name: str, service_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -153,7 +213,7 @@ def build_validate_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -187,10 +247,12 @@ class ConfigServersOperations: 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, **kwargs: Any) -> _models.ConfigServerResource: @@ -205,7 +267,7 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.appplatform.models.ConfigServerResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +316,7 @@ def _update_put_initial( config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +508,7 @@ def _update_patch_initial( config_server_resource: Union[_models.ConfigServerResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -631,6 +693,195 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + def _delete_initial(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + 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 [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) + raise HttpResponseError(response=response, 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, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, service_name: str, **kwargs: Any) -> LROPoller[None]: + """Disable the default Config Server, only available in Enterprise Plan. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_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, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, service_name: str, **kwargs: Any + ) -> Iterable["_models.ConfigServerResource"]: + """Handles requests to list all config server resources in a Service. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either ConfigServerResource or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.models.ConfigServerResource] + :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.ConfigServerResourceCollection] = 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, + service_name=service_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("ConfigServerResourceCollection", 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + def _validate_initial( self, resource_group_name: str, @@ -638,7 +889,7 @@ def _validate_initial( config_server_settings: Union[_models.ConfigServerSettings, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_configuration_services_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_configuration_services_operations.py index 1c69f3e8e9c9..293e08817e44 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_configuration_services_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_configuration_services_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 AppPlatformManagementClientConfiguration +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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -153,14 +151,14 @@ def build_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -184,7 +182,7 @@ def build_validate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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_validate_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -221,7 +219,7 @@ def build_validate_resource_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -229,7 +227,7 @@ def build_validate_resource_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -266,10 +264,12 @@ class ConfigurationServicesOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -288,7 +288,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.ConfigurationServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +339,7 @@ def _create_or_update_initial( configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +546,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, configuration_service_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +675,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConfigurationServiceResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -745,7 +745,7 @@ def _validate_initial( settings: Union[_models.ConfigurationServiceSettings, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -956,7 +956,7 @@ def _validate_resource_initial( configuration_service_resource: Union[_models.ConfigurationServiceResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_container_registries_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_container_registries_operations.py index 34a9f20951ce..0acfff7f820f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_container_registries_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_container_registries_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 AppPlatformManagementClientConfiguration +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_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -184,7 +182,7 @@ def build_validate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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_validate_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -229,10 +227,12 @@ class ContainerRegistriesOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -256,7 +256,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerRegistryResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +335,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.ContainerRegistryResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +386,7 @@ def _create_or_update_initial( container_registry_resource: Union[_models.ContainerRegistryResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +588,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, container_registry_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -708,7 +708,7 @@ def _validate_initial( container_registry_properties: Union[_models.ContainerRegistryProperties, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_custom_domains_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_custom_domains_operations.py index ff8c0fba2c3d..c7bb8a399bfa 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_custom_domains_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_custom_domains_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 AppPlatformManagementClientConfiguration +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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -119,14 +117,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -152,7 +150,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -160,7 +158,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -188,14 +186,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -228,10 +226,12 @@ class CustomDomainsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -252,7 +252,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +305,7 @@ def _create_or_update_initial( domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +515,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, app_name: str, domain_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +634,7 @@ def _update_initial( domain_resource: Union[_models.CustomDomainResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -865,7 +865,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CustomDomainResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_customized_accelerators_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_customized_accelerators_operations.py index c57561296e52..3e7ff31624e7 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_customized_accelerators_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_customized_accelerators_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 AppPlatformManagementClientConfiguration +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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -89,14 +87,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -131,7 +129,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -139,7 +137,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -176,14 +174,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -218,7 +216,7 @@ def build_validate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -226,7 +224,7 @@ def build_validate_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -266,10 +264,12 @@ class CustomizedAcceleratorsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -296,7 +296,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CustomizedAcceleratorResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +383,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.CustomizedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +436,7 @@ def _create_or_update_initial( customized_accelerator_resource: Union[_models.CustomizedAcceleratorResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -658,7 +658,7 @@ def _delete_initial( customized_accelerator_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -786,7 +786,7 @@ def _validate_initial( properties: Union[_models.CustomizedAcceleratorProperties, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_deployments_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_deployments_operations.py index 1d09496ea69b..f15c9ad5d580 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_deployments_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_deployments_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, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, 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 AppPlatformManagementClientConfiguration +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_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -93,7 +91,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -101,7 +99,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -134,14 +132,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -172,7 +170,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -180,7 +178,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -209,19 +207,20 @@ def build_list_request( subscription_id: str, *, version: Optional[List[str]] = None, + expand: 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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -235,6 +234,8 @@ def build_list_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") if version is not None: _params["version"] = [_SERIALIZER.query("version", q, "str") if q is not None else "" for q in version] + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -254,14 +255,14 @@ def build_list_for_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -294,14 +295,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -332,14 +333,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -370,14 +371,14 @@ def build_restart_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -408,7 +409,7 @@ def build_enable_remote_debugging_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -416,7 +417,7 @@ def build_enable_remote_debugging_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -449,14 +450,14 @@ def build_disable_remote_debugging_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -487,14 +488,14 @@ def build_get_remote_debugging_config_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -525,14 +526,14 @@ def build_get_log_file_url_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -563,7 +564,7 @@ def build_generate_heap_dump_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -571,7 +572,7 @@ def build_generate_heap_dump_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -604,7 +605,7 @@ def build_generate_thread_dump_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -612,7 +613,7 @@ def build_generate_thread_dump_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -645,7 +646,7 @@ def build_start_jfr_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -653,7 +654,7 @@ def build_start_jfr_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -689,10 +690,12 @@ class DeploymentsOperations: # 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -713,7 +716,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.DeploymentResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -766,7 +769,7 @@ def _create_or_update_initial( deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -976,7 +979,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1095,7 +1098,7 @@ def _update_initial( deployment_resource: Union[_models.DeploymentResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1309,6 +1312,7 @@ def list( service_name: str, app_name: str, version: Optional[List[str]] = None, + expand: Optional[str] = None, **kwargs: Any ) -> Iterable["_models.DeploymentResource"]: """Handles requests to list all resources in an App. @@ -1322,6 +1326,8 @@ def list( :type app_name: str :param version: Version of the deployments to be listed. Default value is None. :type version: list[str] + :param expand: The expand expression to apply on the operation. Default value is None. + :type expand: str :return: An iterator like instance of either DeploymentResource or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.models.DeploymentResource] :raises ~azure.core.exceptions.HttpResponseError: @@ -1332,7 +1338,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DeploymentResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1349,6 +1355,7 @@ def prepare_request(next_link=None): app_name=app_name, subscription_id=self._config.subscription_id, version=version, + expand=expand, api_version=api_version, headers=_headers, params=_params, @@ -1426,7 +1433,7 @@ def list_for_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DeploymentResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1493,7 +1500,7 @@ def get_next(next_link=None): def _start_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1606,7 +1613,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1719,7 +1726,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _restart_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1838,7 +1845,7 @@ def _enable_remote_debugging_initial( remote_debugging_payload: Optional[Union[_models.RemoteDebuggingPayload, IO[bytes]]] = None, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2052,7 +2059,7 @@ def get_long_running_output(pipeline_response): def _disable_remote_debugging_initial( self, resource_group_name: str, service_name: str, app_name: str, deployment_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2186,7 +2193,7 @@ def get_remote_debugging_config( :rtype: ~azure.mgmt.appplatform.models.RemoteDebugging :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2249,7 +2256,7 @@ def get_log_file_url( :rtype: ~azure.mgmt.appplatform.models.LogFileUrlResponse or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2304,7 +2311,7 @@ def _generate_heap_dump_initial( diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2513,7 +2520,7 @@ def _generate_thread_dump_initial( diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2722,7 +2729,7 @@ def _start_jfr_initial( diagnostic_parameters: Union[_models.DiagnosticParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_dev_tool_portals_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_dev_tool_portals_operations.py index 6c57dd8854cd..b6982fca2dba 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_dev_tool_portals_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_dev_tool_portals_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 AppPlatformManagementClientConfiguration +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_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/devToolPortals", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -192,10 +190,12 @@ class DevToolPortalsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -219,7 +219,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DevToolPortalResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -298,7 +298,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.DevToolPortalResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +349,7 @@ def _create_or_update_initial( dev_tool_portal_resource: Union[_models.DevToolPortalResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +549,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, dev_tool_portal_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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_eureka_servers_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_eureka_servers_operations.py new file mode 100644 index 000000000000..7bbd8895c562 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_eureka_servers_operations.py @@ -0,0 +1,696 @@ +# 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, 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 .._configuration import AppPlatformManagementClientConfiguration +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, service_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[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_get_request(resource_group_name: str, service_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[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_update_put_request( + resource_group_name: str, service_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", "2024-05-01-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.AppPlatform/Spring/{serviceName}/eurekaServers/default", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[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_patch_request( + resource_group_name: str, service_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", "2024-05-01-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.AppPlatform/Spring/{serviceName}/eurekaServers/default", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +class EurekaServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.AppPlatformManagementClient`'s + :attr:`eureka_servers` 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, **kwargs: Any + ) -> _models.EurekaServerResourceCollection: + """List the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: EurekaServerResourceCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.EurekaServerResourceCollection + :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.EurekaServerResourceCollection] = kwargs.pop("cls", None) + + _request = build_list_request( + resource_group_name=resource_group_name, + service_name=service_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EurekaServerResourceCollection", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _models.EurekaServerResource: + """Get the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: EurekaServerResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.EurekaServerResource + :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.EurekaServerResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EurekaServerResource", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_put_initial( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, 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(eureka_server_resource, (IOBase, bytes)): + _content = eureka_server_resource + else: + _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") + + _request = build_update_put_request( + resource_group_name=resource_group_name, + service_name=service_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + 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, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: _models.EurekaServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: ~azure.mgmt.appplatform.models.EurekaServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_put( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Is either a + EurekaServerResource type or a IO[bytes] type. Required. + :type eureka_server_resource: ~azure.mgmt.appplatform.models.EurekaServerResource or IO[bytes] + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = 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_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + eureka_server_resource=eureka_server_resource, + 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("EurekaServerResource", 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.EurekaServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_patch_initial( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, 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(eureka_server_resource, (IOBase, bytes)): + _content = eureka_server_resource + else: + _json = self._serialize.body(eureka_server_resource, "EurekaServerResource") + + _request = build_update_patch_request( + resource_group_name=resource_group_name, + service_name=service_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, 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) + raise HttpResponseError(response=response, 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, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: _models.EurekaServerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: ~azure.mgmt.appplatform.models.EurekaServerResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Required. + :type eureka_server_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_patch( + self, + resource_group_name: str, + service_name: str, + eureka_server_resource: Union[_models.EurekaServerResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EurekaServerResource]: + """Update the eureka server settings. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param eureka_server_resource: Parameters for the update operation. Is either a + EurekaServerResource type or a IO[bytes] type. Required. + :type eureka_server_resource: ~azure.mgmt.appplatform.models.EurekaServerResource or IO[bytes] + :return: An instance of LROPoller that returns either EurekaServerResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.EurekaServerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EurekaServerResource] = 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_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + eureka_server_resource=eureka_server_resource, + 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("EurekaServerResource", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.EurekaServerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EurekaServerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateway_custom_domains_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateway_custom_domains_operations.py index 4ab7af33c130..762e23399649 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateway_custom_domains_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateway_custom_domains_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 AppPlatformManagementClientConfiguration +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_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -93,7 +91,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -101,7 +99,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -134,14 +132,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -167,14 +165,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -207,10 +205,12 @@ class GatewayCustomDomainsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -231,7 +231,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.GatewayCustomDomainResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +284,7 @@ def _create_or_update_initial( gateway_custom_domain_resource: Union[_models.GatewayCustomDomainResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -501,7 +501,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, gateway_name: str, domain_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -636,7 +636,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GatewayCustomDomainResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateway_route_configs_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateway_route_configs_operations.py index fdebe48e2ebd..175a8b9c7c2d 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateway_route_configs_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateway_route_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, 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 AppPlatformManagementClientConfiguration +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_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -93,7 +91,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -101,7 +99,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -134,14 +132,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -167,14 +165,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -207,10 +205,12 @@ class GatewayRouteConfigsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -231,7 +231,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.GatewayRouteConfigResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +284,7 @@ def _create_or_update_initial( gateway_route_config_resource: Union[_models.GatewayRouteConfigResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +503,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, gateway_name: str, route_config_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -637,7 +637,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GatewayRouteConfigResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateways_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateways_operations.py index 025a16a6b510..34278bcd0331 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateways_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_gateways_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 AppPlatformManagementClientConfiguration +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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -82,7 +80,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -90,7 +88,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -111,20 +109,55 @@ def build_create_or_update_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) +def build_update_capacity_request( + resource_group_name: str, service_name: str, gateway_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", "2024-05-01-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.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "gatewayName": _SERIALIZER.url("gateway_name", gateway_name, "str", 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + def build_delete_request( resource_group_name: str, service_name: str, gateway_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -149,14 +182,14 @@ def build_list_env_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -181,14 +214,14 @@ def build_restart_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -211,14 +244,14 @@ def build_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -242,7 +275,7 @@ def build_validate_domain_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -250,7 +283,7 @@ def build_validate_domain_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -285,10 +318,12 @@ class GatewaysOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -307,7 +342,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.GatewayResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -358,7 +393,7 @@ def _create_or_update_initial( gateway_resource: Union[_models.GatewayResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -554,10 +589,220 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + def _update_capacity_initial( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: Union[_models.SkuObject, 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(gateway_capacity_resource, (IOBase, bytes)): + _content = gateway_capacity_resource + else: + _json = self._serialize.body(gateway_capacity_resource, "SkuObject") + + _request = build_update_capacity_request( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_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, 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) + raise HttpResponseError(response=response, 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, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: _models.SkuObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Required. + :type gateway_capacity_resource: ~azure.mgmt.appplatform.models.SkuObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Required. + :type gateway_capacity_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_capacity( + self, + resource_group_name: str, + service_name: str, + gateway_name: str, + gateway_capacity_resource: Union[_models.SkuObject, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.GatewayResource]: + """Operation to update an exiting Spring Cloud Gateway capacity. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param gateway_name: The name of Spring Cloud Gateway. Required. + :type gateway_name: str + :param gateway_capacity_resource: The gateway capacity for the update operation. Is either a + SkuObject type or a IO[bytes] type. Required. + :type gateway_capacity_resource: ~azure.mgmt.appplatform.models.SkuObject or IO[bytes] + :return: An instance of LROPoller that returns either GatewayResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.GatewayResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GatewayResource] = 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_capacity_initial( + resource_group_name=resource_group_name, + service_name=service_name, + gateway_name=gateway_name, + gateway_capacity_resource=gateway_capacity_resource, + 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("GatewayResource", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.GatewayResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GatewayResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + def _delete_initial( self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +925,7 @@ def list_env_secrets( :rtype: dict[str, str] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -726,7 +971,7 @@ def list_env_secrets( def _restart_initial( self, resource_group_name: str, service_name: str, gateway_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -857,7 +1102,7 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GatewayResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1004,7 +1249,7 @@ def validate_domain( :rtype: ~azure.mgmt.appplatform.models.CustomDomainValidateResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_job_execution_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_job_execution_operations.py new file mode 100644 index 000000000000..8f95e7803c49 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_job_execution_operations.py @@ -0,0 +1,425 @@ +# 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, Iterator, Optional, TypeVar, Union, cast + +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 .._configuration import AppPlatformManagementClientConfiguration +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_cancel_request( + resource_group_name: str, + service_name: str, + job_name: str, + job_execution_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/executions/{jobExecutionName}/cancel", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobExecutionName": _SERIALIZER.url( + "job_execution_name", job_execution_name, "str", pattern=r"^[a-z][a-z0-9-]*[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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_request( + resource_group_name: str, + service_name: str, + job_name: str, + job_execution_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/executions/{jobExecutionName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobExecutionName": _SERIALIZER.url( + "job_execution_name", job_execution_name, "str", pattern=r"^[a-z][a-z0-9-]*[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_list_env_secrets_request( + resource_group_name: str, + service_name: str, + job_name: str, + job_execution_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/executions/{jobExecutionName}/listEnvSecrets", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobExecutionName": _SERIALIZER.url( + "job_execution_name", job_execution_name, "str", pattern=r"^[a-z][a-z0-9-]*[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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class JobExecutionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.AppPlatformManagementClient`'s + :attr:`job_execution` 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: AppPlatformManagementClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _cancel_initial( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_cancel_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + 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 [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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + 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, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_cancel( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Terminate execution of a running Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._cancel_initial( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_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 + + @distributed_trace + def get( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> _models.JobExecution: + """Get details of an execution of an Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :return: JobExecution or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.JobExecution + :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.JobExecution] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobExecution", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_env_secrets( + self, resource_group_name: str, service_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> _models.EnvSecretsCollection: + """List sensitive environment variables of Job execution. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_execution_name: The name of the Job execution. Required. + :type job_execution_name: str + :return: EnvSecretsCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.EnvSecretsCollection + :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.EnvSecretsCollection] = kwargs.pop("cls", None) + + _request = build_list_env_secrets_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + job_execution_name=job_execution_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EnvSecretsCollection", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_job_executions_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_job_executions_operations.py new file mode 100644 index 000000000000..d188febb4ca4 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_job_executions_operations.py @@ -0,0 +1,177 @@ +# 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 AppPlatformManagementClientConfiguration +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, service_name: str, job_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/executions", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[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) + + +class JobExecutionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.AppPlatformManagementClient`'s + :attr:`job_executions` 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, job_name: str, **kwargs: Any + ) -> Iterable["_models.JobExecution"]: + """Get executions of a Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: An iterator like instance of either JobExecution or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.models.JobExecution] + :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.JobExecutionCollection] = 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, + service_name=service_name, + job_name=job_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("JobExecutionCollection", 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_job_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_job_operations.py new file mode 100644 index 000000000000..360ba9703a1c --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_job_operations.py @@ -0,0 +1,882 @@ +# 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, 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 .._configuration import AppPlatformManagementClientConfiguration +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, service_name: str, job_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[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, service_name: str, job_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", "2024-05-01-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.AppPlatform/Spring/{serviceName}/jobs/{jobName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[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_delete_request( + resource_group_name: str, service_name: str, job_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[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_start_request( + resource_group_name: str, service_name: str, job_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", "2024-05-01-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.AppPlatform/Spring/{serviceName}/jobs/{jobName}/start", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_env_secrets_request( + resource_group_name: str, service_name: str, job_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs/{jobName}/listEnvSecrets", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[a-z0-9]$"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[a-z][a-z0-9-]*[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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class JobOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.AppPlatformManagementClient`'s + :attr:`job` 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, job_name: str, **kwargs: Any) -> _models.JobResource: + """Get a Job and its properties. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: JobResource or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.JobResource + :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.JobResource] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobResource", 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, + service_name: str, + job_name: str, + job_resource: Union[_models.JobResource, 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(job_resource, (IOBase, bytes)): + _content = job_resource + else: + _json = self._serialize.body(job_resource, "JobResource") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_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) + raise HttpResponseError(response=response, 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 begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: _models.JobResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Required. + :type job_resource: ~azure.mgmt.appplatform.models.JobResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Required. + :type job_resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + job_name: str, + job_resource: Union[_models.JobResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.JobResource]: + """Create a new Job or update an exiting Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param job_resource: Parameters for the create or update operation. Is either a JobResource + type or a IO[bytes] type. Required. + :type job_resource: ~azure.mgmt.appplatform.models.JobResource or IO[bytes] + :return: An instance of LROPoller that returns either JobResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.JobResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobResource] = 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, + service_name=service_name, + job_name=job_name, + job_resource=job_resource, + 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("JobResource", 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, **kwargs)) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + 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 [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) + raise HttpResponseError(response=response, 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, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Operation to delete a Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_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, **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 _start_initial( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, 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(template, (IOBase, bytes)): + _content = template + else: + if template is not None: + _json = self._serialize.body(template, "JobExecutionTemplate") + else: + _json = None + + _request = build_start_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_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, 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) + raise HttpResponseError(response=response, 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, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[_models.JobExecutionTemplate] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Default value is None. + :type template: ~azure.mgmt.appplatform.models.JobExecutionTemplate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either JobExecution or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Default value is None. + :type template: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either JobExecution or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_start( + self, + resource_group_name: str, + service_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, IO[bytes]]] = None, + **kwargs: Any + ) -> LROPoller[_models.JobExecution]: + """Start an Azure Spring Apps Job. + + Start an Azure Spring Apps Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :param template: Template used to start a Job execution. Is either a JobExecutionTemplate type + or a IO[bytes] type. Default value is None. + :type template: ~azure.mgmt.appplatform.models.JobExecutionTemplate or IO[bytes] + :return: An instance of LROPoller that returns either JobExecution or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_name, + template=template, + 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("JobExecution", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobExecution].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobExecution]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_env_secrets( + self, resource_group_name: str, service_name: str, job_name: str, **kwargs: Any + ) -> _models.EnvSecretsCollection: + """List sensitive environment variables of the Job. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :param job_name: The name of the Job resource. Required. + :type job_name: str + :return: EnvSecretsCollection or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.models.EnvSecretsCollection + :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.EnvSecretsCollection] = kwargs.pop("cls", None) + + _request = build_list_env_secrets_request( + resource_group_name=resource_group_name, + service_name=service_name, + job_name=job_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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("EnvSecretsCollection", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_jobs_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_jobs_operations.py new file mode 100644 index 000000000000..3257de1c5407 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_jobs_operations.py @@ -0,0 +1,169 @@ +# 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 AppPlatformManagementClientConfiguration +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, service_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", "2024-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/jobs", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serviceName": _SERIALIZER.url("service_name", service_name, "str", pattern=r"^[a-z][a-z0-9-]*[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) + + +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.appplatform.AppPlatformManagementClient`'s + :attr:`jobs` 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, **kwargs: Any) -> Iterable["_models.JobResource"]: + """Get the Azure Spring Apps Jobs in a given service. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param service_name: The name of the Service resource. Required. + :type service_name: str + :return: An iterator like instance of either JobResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appplatform.models.JobResource] + :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.JobResourceCollection] = 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, + service_name=service_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("JobResourceCollection", 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_monitoring_settings_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_monitoring_settings_operations.py index 14b88c32fcff..da8f16fac6d1 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_monitoring_settings_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_monitoring_settings_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 AppPlatformManagementClientConfiguration +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_get_request(resource_group_name: str, service_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -77,7 +75,7 @@ def build_update_put_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -85,7 +83,7 @@ def build_update_put_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -111,7 +109,7 @@ def build_update_patch_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-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_update_patch_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -153,10 +151,12 @@ class MonitoringSettingsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, **kwargs: Any) -> _models.MonitoringSettingResource: @@ -171,7 +171,7 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.appplatform.models.MonitoringSettingResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +220,7 @@ def _update_put_initial( monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -413,7 +413,7 @@ def _update_patch_initial( monitoring_setting_resource: Union[_models.MonitoringSettingResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_operations.py index 58fac6de3278..8f1c909547d2 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/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 AppPlatformManagementClientConfiguration +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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,10 +69,12 @@ 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: AppPlatformManagementClientConfiguration = ( + 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 +90,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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_predefined_accelerators_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_predefined_accelerators_operations.py index 2fb7086f3aa2..364f5b15fc4b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_predefined_accelerators_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_predefined_accelerators_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, Iterator, Optional, Type, TypeVar, Union, cast +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +31,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AppPlatformManagementClientConfiguration +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]] @@ -49,14 +47,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -88,14 +86,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -130,14 +128,14 @@ def build_disable_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -172,14 +170,14 @@ def build_enable_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -217,10 +215,12 @@ class PredefinedAcceleratorsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -247,7 +247,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PredefinedAcceleratorResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.PredefinedAcceleratorResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +386,7 @@ def _disable_initial( predefined_accelerator_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +513,7 @@ def _enable_initial( predefined_accelerator_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/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_runtime_versions_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_runtime_versions_operations.py index 27484cd3c487..4aa2ae047b32 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_runtime_versions_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_runtime_versions_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 AppPlatformManagementClientConfiguration +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,7 +38,7 @@ def build_list_runtime_versions_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,10 +67,12 @@ class RuntimeVersionsOperations: 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: AppPlatformManagementClientConfiguration = ( + 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_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersions: @@ -83,7 +82,7 @@ def list_runtime_versions(self, **kwargs: Any) -> _models.AvailableRuntimeVersio :rtype: ~azure.mgmt.appplatform.models.AvailableRuntimeVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_service_registries_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_service_registries_operations.py index bd93f2070a23..b3ec5b8b8b2e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_service_registries_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_service_registries_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, Iterator, Optional, Type, TypeVar, Union, cast +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +31,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AppPlatformManagementClientConfiguration +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]] @@ -49,14 +47,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -81,14 +79,14 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -113,14 +111,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -143,14 +141,14 @@ def build_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -182,10 +180,12 @@ class ServiceRegistriesOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -204,7 +204,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.ServiceRegistryResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -250,7 +250,7 @@ def get( def _create_or_update_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +364,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, service_registry_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -492,7 +492,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServiceRegistryResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_services_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_services_operations.py index 69e828ab33a3..49fb4968ca7b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_services_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_services_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 AppPlatformManagementClientConfiguration +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(resource_group_name: str, service_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -79,7 +77,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -87,7 +85,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -113,14 +111,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -144,7 +142,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -152,7 +150,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -178,14 +176,14 @@ def build_list_test_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -209,7 +207,7 @@ def build_regenerate_test_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -217,7 +215,7 @@ def build_regenerate_test_key_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -243,14 +241,14 @@ def build_disable_test_endpoint_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -274,14 +272,14 @@ def build_enable_test_endpoint_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -303,14 +301,14 @@ def build_stop_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -334,14 +332,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -365,14 +363,14 @@ def build_flush_vnet_dns_setting_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -396,14 +394,14 @@ def build_list_supported_apm_types_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -427,14 +425,14 @@ def build_list_globally_enabled_apms_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -458,7 +456,7 @@ def build_enable_apm_globally_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -466,7 +464,7 @@ def build_enable_apm_globally_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -492,7 +490,7 @@ def build_disable_apm_globally_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -500,7 +498,7 @@ def build_disable_apm_globally_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -524,7 +522,7 @@ def build_check_name_availability_request(location: str, subscription_id: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -532,7 +530,7 @@ def build_check_name_availability_request(location: str, subscription_id: str, * _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str"), @@ -555,7 +553,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -579,14 +577,14 @@ def build_list_request(resource_group_name: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -609,14 +607,14 @@ def build_list_supported_server_versions_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -648,10 +646,12 @@ class ServicesOperations: # 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: AppPlatformManagementClientConfiguration = ( + 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, service_name: str, **kwargs: Any) -> _models.ServiceResource: @@ -666,7 +666,7 @@ def get(self, resource_group_name: str, service_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.appplatform.models.ServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -715,7 +715,7 @@ def _create_or_update_initial( resource: Union[_models.ServiceResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -901,7 +901,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1008,7 +1008,7 @@ def _update_initial( resource: Union[_models.ServiceResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1206,7 +1206,7 @@ def list_test_keys(self, resource_group_name: str, service_name: str, **kwargs: :rtype: ~azure.mgmt.appplatform.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1326,7 +1326,7 @@ def regenerate_test_key( :rtype: ~azure.mgmt.appplatform.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1395,7 +1395,7 @@ def disable_test_endpoint( # 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, @@ -1446,7 +1446,7 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw :rtype: ~azure.mgmt.appplatform.models.TestKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1489,17 +1489,11 @@ def enable_test_endpoint(self, resource_group_name: str, service_name: str, **kw return deserialized # type: ignore def _stop_initial(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterator[bytes]: - 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), - ), - 409: cast( - Type[HttpResponseError], - lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -1532,7 +1526,7 @@ def _stop_initial(self, resource_group_name: str, service_name: str, **kwargs: A 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) # type: ignore + map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -1596,17 +1590,11 @@ 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 def _start_initial(self, resource_group_name: str, service_name: str, **kwargs: Any) -> Iterator[bytes]: - 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), - ), - 409: cast( - Type[HttpResponseError], - lambda response: ResourceExistsError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -1639,7 +1627,7 @@ def _start_initial(self, resource_group_name: str, service_name: str, **kwargs: 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) # type: ignore + map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -1705,7 +1693,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _flush_vnet_dns_setting_initial( self, resource_group_name: str, service_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1833,7 +1821,7 @@ def list_supported_apm_types( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SupportedApmTypes] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1910,7 +1898,7 @@ def list_globally_enabled_apms( :rtype: ~azure.mgmt.appplatform.models.GloballyEnabledApms :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1955,7 +1943,7 @@ def list_globally_enabled_apms( def _enable_apm_globally_initial( self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2138,7 +2126,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _disable_apm_globally_initial( self, resource_group_name: str, service_name: str, apm: Union[_models.ApmReference, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2383,7 +2371,7 @@ def check_name_availability( :rtype: ~azure.mgmt.appplatform.models.NameAvailability :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2450,7 +2438,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ServiceResour api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2527,7 +2515,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ser api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2610,7 +2598,7 @@ def list_supported_server_versions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SupportedServerVersions] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_skus_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_skus_operations.py index 691808e45173..ab68f79d9dbc 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_skus_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_skus_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 AppPlatformManagementClientConfiguration +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(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,10 +74,12 @@ class SkusOperations: 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: AppPlatformManagementClientConfiguration = ( + 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.ResourceSku"]: @@ -96,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ResourceSkuCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_storages_operations.py b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_storages_operations.py index 9e66b55a63c4..cebabe1a5650 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_storages_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/operations/_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,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 AppPlatformManagementClientConfiguration +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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -82,7 +80,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -90,7 +88,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -117,14 +115,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", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -147,14 +145,14 @@ def build_list_request(resource_group_name: str, service_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -186,10 +184,12 @@ class StoragesOperations: 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: AppPlatformManagementClientConfiguration = ( + 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( @@ -208,7 +208,7 @@ def get( :rtype: ~azure.mgmt.appplatform.models.StorageResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -259,7 +259,7 @@ def _create_or_update_initial( storage_resource: Union[_models.StorageResource, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +458,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, service_name: str, storage_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +583,7 @@ def list(self, resource_group_name: str, service_name: str, **kwargs: Any) -> It api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageResourceCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_create_or_update.py index 58f58d25d217..b9b6a7fcdc17 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_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. @@ -40,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApiPortalCustomDomains_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_delete.py index 61cf9f9e4ced..e1e326acead6 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApiPortalCustomDomains_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApiPortalCustomDomains_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_get.py index 4250799a063a..64c2951c7f38 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApiPortalCustomDomains_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApiPortalCustomDomains_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_list.py index 7c0083d2c09a..e3034db9baa9 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portal_custom_domains_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApiPortalCustomDomains_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApiPortalCustomDomains_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_create_or_update.py index d0aaf4a7bb4c..282982bf5f08 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApiPortals_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApiPortals_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_delete.py index cb16f6acf3dd..0cbf14a8d666 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApiPortals_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApiPortals_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_get.py index 095752069003..14dea8983ac6 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApiPortals_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApiPortals_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_list.py index 0fe2dd9c7d02..357fc367d8dd 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApiPortals_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApiPortals_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_validate_domain.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_validate_domain.py index f0b9914343c1..76333fef6bd9 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_validate_domain.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/api_portals_validate_domain.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApiPortals_ValidateDomain.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApiPortals_ValidateDomain.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_create_or_update.py index ce8126a99fa8..b59216826a12 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_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. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apms_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apms_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_delete.py index 9643a6e5bdc7..de7047c64d7d 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apms_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apms_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_get.py index f74b015b9e02..0b7e6153e764 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apms_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apms_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_list.py index 94f3afbdaa2b..5a1e93916ec7 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apms_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apms_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_list_secret_keys.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_list_secret_keys.py index 8b2c4d8b838d..01fd26c01f55 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_list_secret_keys.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apms_list_secret_keys.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apms_ListSecretKeys.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apms_ListSecretKeys.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_create_or_update.py index 77ffec071b86..593353155e10 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_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. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApplicationAccelerators_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApplicationAccelerators_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_delete.py index 13010bbfcdef..712b5a952611 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApplicationAccelerators_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApplicationAccelerators_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_get.py index 082a15462456..530c463bc928 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApplicationAccelerators_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApplicationAccelerators_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_list.py index 74b71ac0a36f..5a2c794a91dc 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_accelerators_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApplicationAccelerators_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApplicationAccelerators_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_view_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_view_delete.py index 589fc7d2a5ba..11b9046fd50a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_view_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_view_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApplicationLiveView_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApplicationLiveView_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_create_or_update.py index 547f34527342..59175506cc68 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_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. @@ -39,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApplicationLiveViews_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApplicationLiveViews_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_get.py index 3b5c7a8da237..7220273de931 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApplicationLiveViews_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApplicationLiveViews_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_list.py index 855fdeb05c21..d5e13e43a889 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/application_live_views_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ApplicationLiveViews_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ApplicationLiveViews_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_create_or_update.py index 0eb8ec3da1df..404ae76d6939 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/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. @@ -87,12 +88,14 @@ def main(): "persistentDisk": {"mountPath": "/mypersistentdisk", "sizeInGB": 2}, "public": True, "temporaryDisk": {"mountPath": "/mytemporarydisk", "sizeInGB": 2}, + "testEndpointAuthState": "Enabled", + "workloadProfileName": "dedicated1", }, }, ).result() print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_create_or_update_vnet_injection.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_create_or_update_vnet_injection.py index fd09c1448699..2320bfa87fdb 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_create_or_update_vnet_injection.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_create_or_update_vnet_injection.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -86,6 +87,7 @@ def main(): "persistentDisk": {"mountPath": "/mypersistentdisk", "sizeInGB": 2}, "public": True, "temporaryDisk": {"mountPath": "/mytemporarydisk", "sizeInGB": 2}, + "testEndpointAuthState": "Enabled", "vnetAddons": {"publicEndpoint": True}, }, }, @@ -93,6 +95,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_CreateOrUpdate_VNetInjection.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_CreateOrUpdate_VNetInjection.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_delete.py index cd368524ae54..21a8209a7707 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get.py index aeac632f720e..288af7605225 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get_resource_upload_url.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get_resource_upload_url.py index 5e985d90fbe3..c0b93c93759f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get_resource_upload_url.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get_resource_upload_url.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_GetResourceUploadUrl.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_GetResourceUploadUrl.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get_vnet_injection.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get_vnet_injection.py index 7c03550dc092..c9e5e4f7589a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get_vnet_injection.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_get_vnet_injection.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_Get_VNetInjection.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_Get_VNetInjection.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_list.py index 6b1dbf399d19..e07ef9680776 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_list_vnet_injection.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_list_vnet_injection.py index df495ca29200..dcffcf8b596e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_list_vnet_injection.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_list_vnet_injection.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_List_VNetInjection.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_List_VNetInjection.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_set_active_deployments.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_set_active_deployments.py index b43bf044ebc5..1094182e7c5f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_set_active_deployments.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_set_active_deployments.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_SetActiveDeployments.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_SetActiveDeployments.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_update.py index eb7da8366377..d4bc6f07876d 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,12 +69,13 @@ def main(): "persistentDisk": {"mountPath": "/mypersistentdisk", "sizeInGB": 2}, "public": True, "temporaryDisk": {"mountPath": "/mytemporarydisk", "sizeInGB": 2}, + "testEndpointAuthState": "Enabled", }, }, ).result() print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_Update.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_Update.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_update_vnet_injection.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_update_vnet_injection.py index 2e309b994142..bc174f1c33a1 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_update_vnet_injection.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_update_vnet_injection.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -68,6 +69,7 @@ def main(): "persistentDisk": {"mountPath": "/mypersistentdisk", "sizeInGB": 2}, "public": True, "temporaryDisk": {"mountPath": "/mytemporarydisk", "sizeInGB": 2}, + "testEndpointAuthState": "Enabled", "vnetAddons": {"publicEndpoint": True}, }, }, @@ -75,6 +77,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_Update_VNetInjection.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_Update_VNetInjection.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_validate_domain.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_validate_domain.py index bff73f9578cd..602d983b344e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_validate_domain.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/apps_validate_domain.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Apps_ValidateDomain.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Apps_ValidateDomain.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_create_or_update.py index b11ba2b8fa61..2fa15de6fb49 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Bindings_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Bindings_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_delete.py index aa8d3e723735..281e2f0fa86c 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Bindings_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Bindings_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_get.py index 18ba0122fa64..13c2b44e80e6 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Bindings_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Bindings_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_list.py index 93c3656c323f..ac338591afe7 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Bindings_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Bindings_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_update.py index 2e24d04154e8..dce0c82109aa 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/bindings_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Bindings_Update.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Bindings_Update.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_get.py index a67c9e30b329..a8ab1ab220c3 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildServiceAgentPool_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildServiceAgentPool_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_list.py index df7b3070d5e0..becfa7bca6d2 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildServiceAgentPool_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildServiceAgentPool_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_update_put.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_update_put.py index 68169850e2a9..6edaa297672c 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_update_put.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_agent_pool_update_put.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildServiceAgentPool_UpdatePut.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildServiceAgentPool_UpdatePut.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_create_or_update.py index a5aa49e569fe..44777387af45 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_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. @@ -45,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildServiceBuilder_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_delete.py index b9c264fc8844..58ebd7ff4550 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildServiceBuilder_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildServiceBuilder_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_get.py index 05c113d2ce83..db16810dc70d 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildServiceBuilder_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildServiceBuilder_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_list.py index a5d60d8da6bf..69c60fb78990 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildServiceBuilder_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildServiceBuilder_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_list_deployments.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_list_deployments.py index ca2ceef0ea76..bee2efd0b2ae 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_list_deployments.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_builder_list_deployments.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildServiceBuilder_ListDeployments.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildServiceBuilder_ListDeployments.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_create_or_update.py index 4f6c18a50ff6..49bae279035b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_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. @@ -43,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_create_or_update_build.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_create_or_update_build.py index a4ff3cbc4515..85e89e606a5a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_create_or_update_build.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_create_or_update_build.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_CreateOrUpdateBuild.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_CreateOrUpdateBuild.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_delete_build.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_delete_build.py index 85bee21fc727..a4978821f49f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_delete_build.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_delete_build.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_DeleteBuild.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_DeleteBuild.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build.py index a2b75a0afc55..4f9140124a54 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_GetBuild.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_GetBuild.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_result.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_result.py index e332cd4c3bc7..54e20bdad86d 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_result.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_result.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_GetBuildResult.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_GetBuildResult.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_result_log.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_result_log.py index dfdf895717b2..44780ad86672 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_result_log.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_result_log.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_GetBuildResultLog.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_GetBuildResultLog.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_service.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_service.py index a2662a92be15..4e29f8619d96 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_service.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_build_service.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_GetBuildService.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_GetBuildService.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_resource_upload_url.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_resource_upload_url.py index 190b9d73f4ad..05c7abf34b97 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_resource_upload_url.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_resource_upload_url.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_GetResourceUploadUrl.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_GetResourceUploadUrl.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_supported_buildpack.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_supported_buildpack.py index 7012f575d63f..6cc32d055ce7 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_supported_buildpack.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_supported_buildpack.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_GetSupportedBuildpack.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_GetSupportedBuildpack.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_supported_stack.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_supported_stack.py index f260c7257454..64e32efd34ea 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_supported_stack.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_get_supported_stack.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_GetSupportedStack.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_GetSupportedStack.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_build_results.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_build_results.py index 5c12a56696f5..f9df76bd5c9f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_build_results.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_build_results.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_ListBuildResults.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_ListBuildResults.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_build_services.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_build_services.py index 39ff932d27c7..9d5445c33045 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_build_services.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_build_services.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_ListBuildServices.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_ListBuildServices.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_builds.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_builds.py index bc10431424e8..e5dfdb490b24 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_builds.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_builds.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_ListBuilds.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_ListBuilds.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_supported_buildpacks.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_supported_buildpacks.py index f339c285134f..5a48389ac279 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_supported_buildpacks.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_supported_buildpacks.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_ListSupportedBuildpacks.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_ListSupportedBuildpacks.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_supported_stacks.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_supported_stacks.py index 98b2a98f7299..cc93754f9ea1 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_supported_stacks.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/build_service_list_supported_stacks.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildService_ListSupportedStacks.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildService_ListSupportedStacks.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_create_or_update.py index 19fd711a661a..894342205aac 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildpackBinding_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildpackBinding_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_delete.py index 284c4f25767e..dc7905c47bcb 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_delete.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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildpackBinding_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildpackBinding_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_get.py index 9ed7e788d463..63dea1812902 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildpackBinding_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildpackBinding_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_list.py index d601f759359a..873741ade848 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildpackBinding_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildpackBinding_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_list_for_cluster.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_list_for_cluster.py index 5537b03798ee..91df69a3c6f2 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_list_for_cluster.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/buildpack_binding_list_for_cluster.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/BuildpackBinding_ListForCluster.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/BuildpackBinding_ListForCluster.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_create_or_update.py index b79367d07218..48b638d283c0 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_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. @@ -47,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Certificates_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Certificates_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_delete.py index 3f65f10abbf9..479441e1753a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Certificates_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Certificates_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_get.py index 1ad7abe1b153..4681a3baba8b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Certificates_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Certificates_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_list.py index 298b69441619..33b79e0b5369 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/certificates_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Certificates_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Certificates_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_delete.py new file mode 100644 index 000000000000..17b17cd96c21 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_delete.py @@ -0,0 +1,42 @@ +# 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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python config_servers_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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.config_servers.begin_delete( + resource_group_name="myResourceGroup", + service_name="myservice", + ).result() + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigServers_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_get.py index 145e239a1201..232c21348d4b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ConfigServers_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigServers_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_get_consumption.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_get_consumption.py new file mode 100644 index 000000000000..152da7438946 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_get_consumption.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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python config_servers_get_consumption.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.config_servers.get( + resource_group_name="myResourceGroup", + service_name="myservice", + ) + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigServers_Get_Consumption.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_list.py new file mode 100644 index 000000000000..72520e7b8245 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python config_servers_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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.config_servers.list( + resource_group_name="myResourceGroup", + service_name="myservice", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigServers_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_patch.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_patch.py index 4ff2ac959bf9..27ed2e8074f3 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_patch.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ConfigServers_UpdatePatch.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigServers_UpdatePatch.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_patch_consumption.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_patch_consumption.py new file mode 100644 index 000000000000..dc4d104f6339 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_patch_consumption.py @@ -0,0 +1,55 @@ +# 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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python config_servers_update_patch_consumption.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.config_servers.begin_update_patch( + resource_group_name="myResourceGroup", + service_name="myservice", + config_server_resource={ + "properties": { + "configServer": { + "gitProperty": { + "label": "master", + "searchPaths": ["/"], + "uri": "https://github.com/fake-user/fake-repository.git", + } + }, + "enabledState": "Enabled", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigServers_UpdatePatch_Consumption.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_put.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_put.py index 9c2f7a84a68b..7e29073ebd0b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_put.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_put.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ConfigServers_UpdatePut.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigServers_UpdatePut.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_put_consumption.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_put_consumption.py new file mode 100644 index 000000000000..af20e69e20b4 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_update_put_consumption.py @@ -0,0 +1,55 @@ +# 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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python config_servers_update_put_consumption.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.config_servers.begin_update_put( + resource_group_name="myResourceGroup", + service_name="myservice", + config_server_resource={ + "properties": { + "configServer": { + "gitProperty": { + "label": "master", + "searchPaths": ["/"], + "uri": "https://github.com/fake-user/fake-repository.git", + } + }, + "enabledState": "Enabled", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigServers_UpdatePut_Consumption.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_validate.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_validate.py index 2ed13d5785e8..43119cc13178 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_validate.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/config_servers_validate.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ConfigServers_Validate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigServers_Validate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_create_or_update.py index 99c307e3cb2d..d2ced2d5f78b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_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. @@ -46,7 +47,8 @@ def main(): "uri": "https://github.com/fake-user/fake-repository", } ] - } + }, + "refreshIntervalInSeconds": 60, } } }, @@ -54,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ConfigurationServices_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigurationServices_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_delete.py index 0850c6ba2861..35732f31ab37 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ConfigurationServices_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigurationServices_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_get.py index 17ff65583148..bc93021d2153 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ConfigurationServices_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigurationServices_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_list.py index 0f0bc82c2537..6dff3296b627 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ConfigurationServices_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigurationServices_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_validate.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_validate.py index a73b0715ed97..86afb9c52e0f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_validate.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_validate.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ConfigurationServices_Validate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigurationServices_Validate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_validate_resource.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_validate_resource.py index 2749d74de29e..b5179bf40296 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_validate_resource.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/configuration_services_validate_resource.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ConfigurationServices_ValidateResource.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ConfigurationServices_ValidateResource.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_create_or_update.py index b34d91d8e68b..225a49a6f6ef 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ContainerRegistries_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ContainerRegistries_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_delete.py index a498c1c2087f..fd7a6e6ebe21 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ContainerRegistries_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ContainerRegistries_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_get.py index 8502ed899ece..52412eb5f86a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ContainerRegistries_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ContainerRegistries_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_list.py index 35be4ca10f22..ba2db9024485 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/container_registries_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ContainerRegistries_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ContainerRegistries_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_create_or_update.py index 092c639c64de..c65ad9f8c252 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_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. @@ -42,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/CustomDomains_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/CustomDomains_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_delete.py index 5d595237b95e..c230e2c7b509 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/CustomDomains_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/CustomDomains_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_get.py index 7542e9c89fd4..0cfd01a231c7 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/CustomDomains_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/CustomDomains_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_list.py index ec123de193ef..845272396017 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/CustomDomains_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/CustomDomains_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_update.py index 28fd0ec74950..56e0d106ff74 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/custom_domains_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -42,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/CustomDomains_Update.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/CustomDomains_Update.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_create_or_update.py index 682067633568..d260d10a976c 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_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. @@ -61,6 +62,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/CustomizedAccelerators_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/CustomizedAccelerators_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_delete.py index 660187d044e9..45ee48bdc533 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/CustomizedAccelerators_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/CustomizedAccelerators_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_get.py index 1bd95b6efa78..c3ef362370d3 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/CustomizedAccelerators_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/CustomizedAccelerators_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_list.py index 5a82b5389388..fd03871e7707 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/CustomizedAccelerators_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/CustomizedAccelerators_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_validate.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_validate.py index b194b27332ff..f4f8c3ed61da 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_validate.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/customized_accelerators_validate.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -58,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/CustomizedAccelerators_Validate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/CustomizedAccelerators_Validate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_create_or_update.py index 68a0a343ba81..b4079ccbbca9 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_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. @@ -77,6 +78,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_create_or_update_custom_container.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_create_or_update_custom_container.py index 1eabf7c375f9..405dd9ad9647 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_create_or_update_custom_container.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_create_or_update_custom_container.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_CreateOrUpdate_CustomContainer.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_CreateOrUpdate_CustomContainer.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_delete.py index af7bf1c768da..349936827510 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_disable_remote_debugging.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_disable_remote_debugging.py index 8b0431b8503d..2bc43c881aaa 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_disable_remote_debugging.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_disable_remote_debugging.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_DisableRemoteDebugging.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_DisableRemoteDebugging.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_enable_remote_debugging.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_enable_remote_debugging.py index 07bef878b1c9..e7d331c998a2 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_enable_remote_debugging.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_enable_remote_debugging.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_EnableRemoteDebugging.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_EnableRemoteDebugging.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_generate_heap_dump.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_generate_heap_dump.py index c2a18572358b..8d3fa8d7d941 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_generate_heap_dump.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_generate_heap_dump.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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_GenerateHeapDump.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_GenerateHeapDump.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_generate_thread_dump.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_generate_thread_dump.py index 91021bb323bd..8b938f6427c7 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_generate_thread_dump.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_generate_thread_dump.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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_GenerateThreadDump.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_GenerateThreadDump.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get.py index ac80e5d289b8..73e0e2537ca0 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_custom_container.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_custom_container.py index cca6181167f0..673748ed50be 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_custom_container.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_custom_container.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_Get_CustomContainer.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_Get_CustomContainer.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_log_file_url.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_log_file_url.py index ef203ae624fe..58bd9adcec35 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_log_file_url.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_log_file_url.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_GetLogFileUrl.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_GetLogFileUrl.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_remote_debugging_config.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_remote_debugging_config.py index 321e763d132a..02066eac0a90 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_remote_debugging_config.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_get_remote_debugging_config.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_GetRemoteDebuggingConfig.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_GetRemoteDebuggingConfig.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_list.py index ec34c3540604..d4bafe56542f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_list_for_cluster.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_list_for_cluster.py index 98d045a46934..219ee4dc5089 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_list_for_cluster.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_list_for_cluster.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_ListForCluster.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_ListForCluster.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_restart.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_restart.py index 3c1f61cd831b..b893411d11f0 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_restart.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_restart.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_Restart.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_Restart.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_start.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_start.py index c242fdc96916..dd14b8178a9f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_start.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_start.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_Start.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_Start.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_start_jfr.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_start_jfr.py index 6d2a6eb069dd..9f7ed40e9586 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_start_jfr.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_start_jfr.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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_StartJFR.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_StartJFR.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_stop.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_stop.py index 2b9fcea73670..67cf49703347 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_stop.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_stop.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_Stop.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_Stop.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_update.py index 84157b39edeb..2fe433b88e63 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_update.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_Update.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_Update.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_update_custom_container.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_update_custom_container.py index 8ce5dee8f582..c1f6c4bfdeed 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_update_custom_container.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/deployments_update_custom_container.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Deployments_Update_CustomContainer.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Deployments_Update_CustomContainer.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portal_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portal_delete.py index e30e6251b936..649314842923 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portal_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portal_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/DevToolPortal_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/DevToolPortal_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portals_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portals_get.py index 6b4d6f7a1812..ec01ec0014d1 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portals_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portals_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/DevToolPortals_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/DevToolPortals_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portals_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portals_list.py index e151a00a6d43..62d948654e3a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portals_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/dev_tool_portals_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/DevToolPortals_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/DevToolPortals_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_get_consumption.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_get_consumption.py new file mode 100644 index 000000000000..6d9d5715ffde --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_get_consumption.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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python eureka_servers_get_consumption.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.eureka_servers.get( + resource_group_name="myResourceGroup", + service_name="myservice", + ) + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/EurekaServers_Get_Consumption.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_list_consumption.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_list_consumption.py new file mode 100644 index 000000000000..6bd17acd986a --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_list_consumption.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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python eureka_servers_list_consumption.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.eureka_servers.list( + resource_group_name="myResourceGroup", + service_name="myservice", + ) + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/EurekaServers_List_Consumption.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_update_patch_consumption.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_update_patch_consumption.py new file mode 100644 index 000000000000..a424e223db26 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_update_patch_consumption.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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python eureka_servers_update_patch_consumption.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.eureka_servers.begin_update_patch( + resource_group_name="myResourceGroup", + service_name="myservice", + eureka_server_resource={"properties": {"enabledState": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/EurekaServers_UpdatePatch_Consumption.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_update_put_consumption.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_update_put_consumption.py new file mode 100644 index 000000000000..a8a096b1228e --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/eureka_servers_update_put_consumption.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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python eureka_servers_update_put_consumption.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.eureka_servers.begin_update_put( + resource_group_name="myResourceGroup", + service_name="myservice", + eureka_server_resource={"properties": {"enabledState": "Enabled"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/EurekaServers_UpdatePut_Consumption.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_create_or_update.py index 4c28296f3ccc..1c82889e2e4b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_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. @@ -40,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/GatewayCustomDomains_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_delete.py index b0cb71714c17..8ccbb343ef6f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/GatewayCustomDomains_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/GatewayCustomDomains_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_get.py index 53f621020fc5..3fd85287c922 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/GatewayCustomDomains_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/GatewayCustomDomains_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_list.py index a16137987c24..0899c0f9f931 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_custom_domains_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/GatewayCustomDomains_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/GatewayCustomDomains_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_create_or_update.py index 0fe21c3e4500..f8749dc99e4e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_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. @@ -56,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/GatewayRouteConfigs_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_delete.py index 88e778aae5e0..1cda7c1ae0de 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/GatewayRouteConfigs_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/GatewayRouteConfigs_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_get.py index f77f061991b8..207f34c18094 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/GatewayRouteConfigs_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/GatewayRouteConfigs_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_list.py index 28ae2fc5732f..250df79206c7 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_route_configs_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/GatewayRouteConfigs_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/GatewayRouteConfigs_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_scale.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_scale.py new file mode 100644 index 000000000000..c9f918b78de2 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateway_scale.py @@ -0,0 +1,45 @@ +# 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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python gateway_scale.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.gateways.begin_update_capacity( + resource_group_name="myResourceGroup", + service_name="myservice", + gateway_name="default", + gateway_capacity_resource={"sku": {"capacity": 2, "name": "E0", "tier": "Enterprise"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Gateway_Scale.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_create_or_update.py index 5c819ea59836..c9c0cd53d87b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_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. @@ -43,6 +44,11 @@ def main(): ], "public": True, "resourceRequests": {"cpu": "1", "memory": "1G"}, + "responseCacheProperties": { + "responseCacheType": "LocalCachePerRoute", + "size": "5MB", + "timeToLive": "300s", + }, }, "sku": {"capacity": 2, "name": "E0", "tier": "Enterprise"}, }, @@ -50,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Gateways_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Gateways_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_delete.py index e92bfa737a8e..4d66933250f1 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Gateways_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Gateways_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_get.py index 31740c0378b6..52e9d0f69245 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Gateways_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Gateways_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_list.py index 93f8001af1c2..56d0f1716e8a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Gateways_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Gateways_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_list_env_secrets.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_list_env_secrets.py index 5d8c66a118df..ec396c54765c 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_list_env_secrets.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_list_env_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Gateways_ListEnvSecrets.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Gateways_ListEnvSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_restart.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_restart.py index d26e3dfb92a0..3d5061f7c2f8 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_restart.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Gateways_Restart.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Gateways_Restart.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_validate_domain.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_validate_domain.py index 0578511ba663..62e6a47b973e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_validate_domain.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/gateways_validate_domain.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Gateways_ValidateDomain.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Gateways_ValidateDomain.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_create_or_update.py new file mode 100644 index 000000000000..73183b65751e --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_create_or_update.py @@ -0,0 +1,58 @@ +# 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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python job_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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.job.begin_create_or_update( + resource_group_name="myResourceGroup", + service_name="myservice", + job_name="test-job", + job_resource={ + "properties": { + "source": {"buildResultId": "", "type": "BuildResult"}, + "template": { + "args": ["arg1", "arg2"], + "environmentVariables": [ + {"name": "key1", "value": "value1"}, + {"name": "env2", "value": "value2"}, + {"name": "secretKey1", "secretValue": "secretValue1"}, + ], + }, + "triggerConfig": {"triggerType": "Manual"}, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Job_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_delete.py new file mode 100644 index 000000000000..3a0a746472df --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python job_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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.job.begin_delete( + resource_group_name="myResourceGroup", + service_name="myservice", + job_name="test-job", + ).result() + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Job_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_execution_cancel.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_execution_cancel.py new file mode 100644 index 000000000000..184242ec265a --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_execution_cancel.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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python job_execution_cancel.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.job_execution.begin_cancel( + resource_group_name="myResourceGroup", + service_name="myservice", + job_name="test-job", + job_execution_name="test-execution", + ).result() + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/JobExecution_Cancel.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_execution_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_execution_get.py new file mode 100644 index 000000000000..85b921973149 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_execution_get.py @@ -0,0 +1,45 @@ +# 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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python job_execution_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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.job_execution.get( + resource_group_name="myResourceGroup", + service_name="myservice", + job_name="test-job", + job_execution_name="test-job-execution", + ) + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/JobExecution_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_execution_list_env_secrets.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_execution_list_env_secrets.py new file mode 100644 index 000000000000..52e0ce3f395a --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_execution_list_env_secrets.py @@ -0,0 +1,45 @@ +# 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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python job_execution_list_env_secrets.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.job_execution.list_env_secrets( + resource_group_name="myResourceGroup", + service_name="myservice", + job_name="test-job", + job_execution_name="test-execution", + ) + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/JobExecution_ListEnvSecrets.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_executions_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_executions_list.py new file mode 100644 index 000000000000..900d816edcf6 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_executions_list.py @@ -0,0 +1,45 @@ +# 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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python job_executions_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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.job_executions.list( + resource_group_name="myResourceGroup", + service_name="myservice", + job_name="test-job", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/JobExecutions_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_get.py new file mode 100644 index 000000000000..5aaa050bee48 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python job_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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.job.get( + resource_group_name="myResourceGroup", + service_name="myservice", + job_name="test-job", + ) + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Job_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_list_env_secrets.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_list_env_secrets.py new file mode 100644 index 000000000000..9cd49d89a824 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_list_env_secrets.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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python job_list_env_secrets.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.job.list_env_secrets( + resource_group_name="myResourceGroup", + service_name="myservice", + job_name="test-job", + ) + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Job_ListEnvSecrets.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_start.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_start.py new file mode 100644 index 000000000000..8c00ad59f0b6 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/job_start.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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python job_start.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.job.begin_start( + resource_group_name="myResourceGroup", + service_name="myservice", + job_name="myjob", + ).result() + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Job_Start.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/jobs_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/jobs_list.py new file mode 100644 index 000000000000..036ffe5a3d44 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/jobs_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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python jobs_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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.jobs.list( + resource_group_name="myResourceGroup", + service_name="myservice", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Jobs_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_get.py index ccf4764a00a2..8f7414f90c6f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/MonitoringSettings_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/MonitoringSettings_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_update_patch.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_update_patch.py index e38a4452565e..5c43eb8cb585 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_update_patch.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_update_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/MonitoringSettings_UpdatePatch.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/MonitoringSettings_UpdatePatch.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_update_put.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_update_put.py index 3142ce3170d5..08bb5ca6f827 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_update_put.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/monitoring_settings_update_put.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/MonitoringSettings_UpdatePut.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/MonitoringSettings_UpdatePut.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/operations_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/operations_list.py index 0c0d7844889b..948e1ac296c5 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/operations_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Operations_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_disable.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_disable.py index 986dc21fddd9..6ab04809931a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_disable.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_disable.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/PredefinedAccelerators_Disable.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/PredefinedAccelerators_Disable.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_enable.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_enable.py index 67ce25bb6118..11e884ca74ec 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_enable.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_enable.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/PredefinedAccelerators_Enable.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/PredefinedAccelerators_Enable.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_get.py index 3346d0404c64..ad6580696b5d 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/PredefinedAccelerators_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/PredefinedAccelerators_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_list.py index 54985ed918f4..2a9a32a883d3 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/predefined_accelerators_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/PredefinedAccelerators_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/PredefinedAccelerators_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/runtime_versions_list_runtime_versions.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/runtime_versions_list_runtime_versions.py index 060eb907a5b7..e660bd3b6836 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/runtime_versions_list_runtime_versions.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/runtime_versions_list_runtime_versions.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/RuntimeVersions_ListRuntimeVersions.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_create_or_update.py index 275951fd18f0..1ae398c7d687 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ServiceRegistries_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ServiceRegistries_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_delete.py index 91579e0d98ea..186e4eaab593 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ServiceRegistries_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ServiceRegistries_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_get.py index cec898a10ce9..154c8a49b0cf 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ServiceRegistries_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ServiceRegistries_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_list.py index d4ba07095aee..e8c28f8e7195 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/service_registries_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/ServiceRegistries_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/ServiceRegistries_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_check_name_availability.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_check_name_availability.py index a4e18ac7aa73..6e60dee1a9c2 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_check_name_availability.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_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. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_CheckNameAvailability.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update.py index 35fe1cffffed..167e03691136 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_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. @@ -33,11 +34,17 @@ def main(): response = client.services.begin_create_or_update( resource_group_name="myResourceGroup", service_name="myservice", - resource={"location": "eastus", "sku": {"name": "S0", "tier": "Standard"}, "tags": {"key1": "value1"}}, + resource={ + "identity": {"type": "SystemAssigned"}, + "location": "eastus", + "properties": {"maintenanceScheduleConfiguration": {"day": "Sunday", "frequency": "Weekly", "hour": 10}}, + "sku": {"name": "S0", "tier": "Standard"}, + "tags": {"key1": "value1"}, + }, ).result() print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_consumption.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_consumption.py new file mode 100644 index 000000000000..48b9f535cbfe --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_consumption.py @@ -0,0 +1,52 @@ +# 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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python services_create_or_update_consumption.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.services.begin_create_or_update( + resource_group_name="myResourceGroup", + service_name="myservice", + resource={ + "identity": {"type": "SystemAssigned"}, + "location": "eastus", + "properties": { + "managedEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.App/managedEnvironments/myenvironment" + }, + "sku": {"name": "S0", "tier": "StandardGen2"}, + "tags": {"key1": "value1"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_CreateOrUpdate_Consumption.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_enterprise.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_enterprise.py index 28401964d77c..2c87fc56cefe 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_enterprise.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_enterprise.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="myResourceGroup", service_name="myservice", resource={ + "identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": { "marketplaceResource": { @@ -49,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_CreateOrUpdate_Enterprise.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_CreateOrUpdate_Enterprise.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_vnet_injection.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_vnet_injection.py index 3b4405af671b..4c1a1b2e70cc 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_vnet_injection.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_create_or_update_vnet_injection.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="myResourceGroup", service_name="myservice", resource={ + "identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": { "networkProfile": { @@ -44,7 +46,12 @@ def main(): "serviceRuntimeNetworkResourceGroup": "my-service-runtime-network-rg", "serviceRuntimeSubnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime", }, - "vnetAddons": {"dataPlanePublicEndpoint": True, "logStreamPublicEndpoint": True}, + "vnetAddons": { + "dataPlanePublicEndpoint": True, + "logStreamPublicEndpoint": True, + "privateDnsZoneId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateDnsZones/myPrivateDnsZone", + "privateStorageAccess": "Enabled", + }, }, "sku": {"name": "S0", "tier": "Standard"}, "tags": {"key1": "value1"}, @@ -53,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_CreateOrUpdate_VNetInjection.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_CreateOrUpdate_VNetInjection.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_delete.py index 34c537da7d05..cb1be1364653 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_disable_apm_globally.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_disable_apm_globally.py index eecf32614de5..b3b1adb057cd 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_disable_apm_globally.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_disable_apm_globally.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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_DisableApmGlobally.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_DisableApmGlobally.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_disable_test_endpoint.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_disable_test_endpoint.py index 20a5b2b54b29..e642198248ef 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_disable_test_endpoint.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_disable_test_endpoint.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(): ) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_DisableTestEndpoint.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_DisableTestEndpoint.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_enable_apm_globally.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_enable_apm_globally.py index 8c7b7b70bd8e..1619a19c0560 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_enable_apm_globally.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_enable_apm_globally.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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_EnableApmGlobally.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_EnableApmGlobally.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_enable_test_endpoint.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_enable_test_endpoint.py index c32c61c7d090..1fdf6c7e1737 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_enable_test_endpoint.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_enable_test_endpoint.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_EnableTestEndpoint.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_EnableTestEndpoint.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_flush_vnet_dns_setting.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_flush_vnet_dns_setting.py index 075347cf6739..c77891a1fa77 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_flush_vnet_dns_setting.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_flush_vnet_dns_setting.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_FlushVnetDnsSetting.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_FlushVnetDnsSetting.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_get.py index e73dbb67fc26..4848142bd636 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_get_consumption.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_get_consumption.py new file mode 100644 index 000000000000..a0930af0a129 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_get_consumption.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.appplatform import AppPlatformManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appplatform +# USAGE + python services_get_consumption.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 = AppPlatformManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.services.get( + resource_group_name="myResourceGroup", + service_name="myservice", + ) + print(response) + + +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_Get_Consumption.json +if __name__ == "__main__": + main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list.py index a002fe46dfb5..43f4dc6acda9 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_by_subscription.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_by_subscription.py index 6598c220dcb9..01d2094bf86d 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_by_subscription.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_ListBySubscription.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_globally_enabled_apms.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_globally_enabled_apms.py index 1ce0a208f6ba..0348c4724a05 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_globally_enabled_apms.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_globally_enabled_apms.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_ListGloballyEnabledApms.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_ListGloballyEnabledApms.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_supported_apm_types.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_supported_apm_types.py index 3e6e5dd1b0d3..d2c0efbc7b44 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_supported_apm_types.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_supported_apm_types.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_ListSupportedApmTypes.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_ListSupportedApmTypes.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_supported_server_versions.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_supported_server_versions.py index 96836f75cd0c..15e41d7d1368 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_supported_server_versions.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_supported_server_versions.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_ListSupportedServerVersions.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_ListSupportedServerVersions.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_test_keys.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_test_keys.py index 076fe3237a60..08585576a142 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_test_keys.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_list_test_keys.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_ListTestKeys.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_ListTestKeys.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_regenerate_test_key.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_regenerate_test_key.py index 9392ee1fefd1..1cd0bed538e1 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_regenerate_test_key.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_regenerate_test_key.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_RegenerateTestKey.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_RegenerateTestKey.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_start.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_start.py index c31300a92819..92ffdbd598a7 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_start.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_start.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_Start.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_Start.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_stop.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_stop.py index fdd8988d9276..27f2ba6752b1 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_stop.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_stop.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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_Stop.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_Stop.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_update.py index 63d92a26069b..6439390a33aa 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/services_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="myResourceGroup", service_name="myservice", resource={ + "identity": {"type": "SystemAssigned"}, "location": "eastus", "properties": {}, "sku": {"name": "S0", "tier": "Standard"}, @@ -43,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Services_Update.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Services_Update.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/skus_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/skus_list.py index c5f7da3822ac..32159f5aed0a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/skus_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/skus_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Skus_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Skus_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_create_or_update.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_create_or_update.py index 1d0578295f4d..3b83aaf3dea0 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_create_or_update.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/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. @@ -45,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Storages_CreateOrUpdate.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Storages_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_delete.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_delete.py index 17bd5a05fa25..ec29fdaac607 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_delete.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/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(): ).result() -# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Storages_Delete.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Storages_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_get.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_get.py index ff137415331c..22d5197df322 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_get.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Storages_Get.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Storages_Get.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_list.py b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_list.py index cf8c995fa0d3..089432394e00 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_list.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_samples/storages_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/appplatform/resource-manager/Microsoft.AppPlatform/stable/2023-12-01/examples/Storages_List.json +# x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-05-01-preview/examples/Storages_List.json if __name__ == "__main__": main() diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/conftest.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/conftest.py index ad8adbe6d16e..c033f5af743f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/conftest.py +++ b/sdk/appplatform/azure-mgmt-appplatform/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): appplatformmanagement_subscription_id = os.environ.get( diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portal_custom_domains_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portal_custom_domains_operations.py index cc4fde2d8f8b..f917daf996f6 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portal_custom_domains_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portal_custom_domains_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_api_portal_custom_domains_get(self, resource_group): response = self.client.api_portal_custom_domains.get( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -34,7 +34,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_api_portal_custom_domains_begin_create_or_update(self, resource_group): response = self.client.api_portal_custom_domains.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -54,7 +54,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -62,13 +62,13 @@ 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_api_portal_custom_domains_begin_delete(self, resource_group): response = self.client.api_portal_custom_domains.begin_delete( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -76,12 +76,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_api_portal_custom_domains_list(self, resource_group): response = self.client.api_portal_custom_domains.list( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portal_custom_domains_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portal_custom_domains_operations_async.py index 346bbe8a6e60..90d3c8c723cb 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portal_custom_domains_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portal_custom_domains_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_api_portal_custom_domains_get(self, resource_group): response = await self.client.api_portal_custom_domains.get( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -35,7 +35,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_api_portal_custom_domains_begin_create_or_update(self, resource_group): response = await ( await self.client.api_portal_custom_domains.begin_create_or_update( resource_group_name=resource_group.name, @@ -56,7 +56,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -65,14 +65,14 @@ 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_api_portal_custom_domains_begin_delete(self, resource_group): response = await ( await self.client.api_portal_custom_domains.begin_delete( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -81,12 +81,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_api_portal_custom_domains_list(self, resource_group): response = self.client.api_portal_custom_domains.list( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portals_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portals_operations.py index a3fe2b0041b7..500d7dbf0491 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portals_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portals_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_api_portals_get(self, resource_group): response = self.client.api_portals.get( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_api_portals_begin_create_or_update(self, resource_group): response = self.client.api_portals.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -64,7 +64,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-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_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_api_portals_begin_delete(self, resource_group): response = self.client.api_portals.begin_delete( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -85,11 +85,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_api_portals_list(self, resource_group): response = self.client.api_portals.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -97,13 +97,13 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_validate_domain(self, resource_group): + def test_api_portals_validate_domain(self, resource_group): response = self.client.api_portals.validate_domain( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", validate_payload={"name": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portals_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portals_operations_async.py index c341fabc9288..0447a1c93f75 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portals_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_api_portals_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_api_portals_get(self, resource_group): response = await self.client.api_portals.get( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_api_portals_begin_create_or_update(self, resource_group): response = await ( await self.client.api_portals.begin_create_or_update( resource_group_name=resource_group.name, @@ -71,7 +71,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -80,13 +80,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_api_portals_begin_delete(self, resource_group): response = await ( await self.client.api_portals.begin_delete( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -95,11 +95,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_api_portals_list(self, resource_group): response = self.client.api_portals.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -107,13 +107,13 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_validate_domain(self, resource_group): + async def test_api_portals_validate_domain(self, resource_group): response = await self.client.api_portals.validate_domain( resource_group_name=resource_group.name, service_name="str", api_portal_name="str", validate_payload={"name": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apms_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apms_operations.py index 940247247b3f..b29deb6c88d5 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apms_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apms_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_apms_list(self, resource_group): response = self.client.apms.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_apms_get(self, resource_group): response = self.client.apms.get( resource_group_name=resource_group.name, service_name="str", apm_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_apms_begin_create_or_update(self, resource_group): response = self.client.apms.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -69,7 +69,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -77,12 +77,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_apms_begin_delete(self, resource_group): response = self.client.apms.begin_delete( resource_group_name=resource_group.name, service_name="str", apm_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -90,12 +90,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_secret_keys(self, resource_group): + def test_apms_list_secret_keys(self, resource_group): response = self.client.apms.list_secret_keys( resource_group_name=resource_group.name, service_name="str", apm_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apms_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apms_operations_async.py index 114aaede85b8..f037f9de1b6e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apms_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apms_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_apms_list(self, resource_group): response = self.client.apms.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_apms_get(self, resource_group): response = await self.client.apms.get( resource_group_name=resource_group.name, service_name="str", apm_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_apms_begin_create_or_update(self, resource_group): response = await ( await self.client.apms.begin_create_or_update( resource_group_name=resource_group.name, @@ -71,7 +71,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -80,13 +80,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_apms_begin_delete(self, resource_group): response = await ( await self.client.apms.begin_delete( resource_group_name=resource_group.name, service_name="str", apm_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -95,12 +95,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_secret_keys(self, resource_group): + async def test_apms_list_secret_keys(self, resource_group): response = await self.client.apms.list_secret_keys( resource_group_name=resource_group.name, service_name="str", apm_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_accelerators_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_accelerators_operations.py index a496adccf1e2..d30227360391 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_accelerators_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_accelerators_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_application_accelerators_list(self, resource_group): response = self.client.application_accelerators.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_application_accelerators_get(self, resource_group): response = self.client.application_accelerators.get( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_application_accelerators_begin_create_or_update(self, resource_group): response = self.client.application_accelerators.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -74,7 +74,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -82,12 +82,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_application_accelerators_begin_delete(self, resource_group): response = self.client.application_accelerators.begin_delete( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_accelerators_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_accelerators_operations_async.py index f7b1c233e616..688327307ca2 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_accelerators_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_accelerators_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_application_accelerators_list(self, resource_group): response = self.client.application_accelerators.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_application_accelerators_get(self, resource_group): response = await self.client.application_accelerators.get( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_application_accelerators_begin_create_or_update(self, resource_group): response = await ( await self.client.application_accelerators.begin_create_or_update( resource_group_name=resource_group.name, @@ -76,7 +76,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -85,13 +85,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_application_accelerators_begin_delete(self, resource_group): response = await ( await self.client.application_accelerators.begin_delete( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_live_views_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_live_views_operations.py index abcf20abb192..ac6ce1fbc655 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_live_views_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_live_views_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_application_live_views_list(self, resource_group): response = self.client.application_live_views.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_application_live_views_get(self, resource_group): response = self.client.application_live_views.get( resource_group_name=resource_group.name, service_name="str", application_live_view_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_application_live_views_begin_create_or_update(self, resource_group): response = self.client.application_live_views.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -73,7 +73,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -81,12 +81,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_application_live_views_begin_delete(self, resource_group): response = self.client.application_live_views.begin_delete( resource_group_name=resource_group.name, service_name="str", application_live_view_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_live_views_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_live_views_operations_async.py index 852a5164336a..7312f2776c84 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_live_views_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_application_live_views_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_application_live_views_list(self, resource_group): response = self.client.application_live_views.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_application_live_views_get(self, resource_group): response = await self.client.application_live_views.get( resource_group_name=resource_group.name, service_name="str", application_live_view_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_application_live_views_begin_create_or_update(self, resource_group): response = await ( await self.client.application_live_views.begin_create_or_update( resource_group_name=resource_group.name, @@ -75,7 +75,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -84,13 +84,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_application_live_views_begin_delete(self, resource_group): response = await ( await self.client.application_live_views.begin_delete( resource_group_name=resource_group.name, service_name="str", application_live_view_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apps_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apps_operations.py index 20affa5a7c19..d8bff296637c 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apps_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_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_apps_get(self, resource_group): response = self.client.apps.get( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_apps_begin_create_or_update(self, resource_group): response = self.client.apps.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -68,9 +68,12 @@ def test_begin_create_or_update(self, resource_group): "persistentDisk": {"mountPath": "str", "sizeInGB": 0, "usedInGB": 0}, "provisioningState": "str", "public": bool, + "secrets": [{"name": "str", "value": "str"}], "temporaryDisk": {"mountPath": "/tmp", "sizeInGB": 0}, + "testEndpointAuthState": "Enabled", "url": "str", "vnetAddons": {"publicEndpoint": False, "publicEndpointUrl": "str"}, + "workloadProfileName": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -82,7 +85,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -90,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_apps_begin_delete(self, resource_group): response = self.client.apps.begin_delete( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -103,7 +106,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_apps_begin_update(self, resource_group): response = self.client.apps.begin_update( resource_group_name=resource_group.name, service_name="str", @@ -138,9 +141,12 @@ def test_begin_update(self, resource_group): "persistentDisk": {"mountPath": "str", "sizeInGB": 0, "usedInGB": 0}, "provisioningState": "str", "public": bool, + "secrets": [{"name": "str", "value": "str"}], "temporaryDisk": {"mountPath": "/tmp", "sizeInGB": 0}, + "testEndpointAuthState": "Enabled", "url": "str", "vnetAddons": {"publicEndpoint": False, "publicEndpointUrl": "str"}, + "workloadProfileName": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -152,7 +158,7 @@ def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -160,11 +166,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_apps_list(self, resource_group): response = self.client.apps.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -172,12 +178,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_resource_upload_url(self, resource_group): + def test_apps_get_resource_upload_url(self, resource_group): response = self.client.apps.get_resource_upload_url( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -185,13 +191,13 @@ def test_get_resource_upload_url(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_set_active_deployments(self, resource_group): + def test_apps_begin_set_active_deployments(self, resource_group): response = self.client.apps.begin_set_active_deployments( resource_group_name=resource_group.name, service_name="str", app_name="str", active_deployment_collection={"activeDeploymentNames": ["str"]}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -199,13 +205,13 @@ def test_begin_set_active_deployments(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_validate_domain(self, resource_group): + def test_apps_validate_domain(self, resource_group): response = self.client.apps.validate_domain( resource_group_name=resource_group.name, service_name="str", app_name="str", validate_payload={"name": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apps_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apps_operations_async.py index 99d3bfb9d7a9..72a7a91ae6d0 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_apps_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_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_apps_get(self, resource_group): response = await self.client.apps.get( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_apps_begin_create_or_update(self, resource_group): response = await ( await self.client.apps.begin_create_or_update( resource_group_name=resource_group.name, @@ -70,9 +70,12 @@ async def test_begin_create_or_update(self, resource_group): "persistentDisk": {"mountPath": "str", "sizeInGB": 0, "usedInGB": 0}, "provisioningState": "str", "public": bool, + "secrets": [{"name": "str", "value": "str"}], "temporaryDisk": {"mountPath": "/tmp", "sizeInGB": 0}, + "testEndpointAuthState": "Enabled", "url": "str", "vnetAddons": {"publicEndpoint": False, "publicEndpointUrl": "str"}, + "workloadProfileName": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -84,7 +87,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -93,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_apps_begin_delete(self, resource_group): response = await ( await self.client.apps.begin_delete( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -108,7 +111,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_apps_begin_update(self, resource_group): response = await ( await self.client.apps.begin_update( resource_group_name=resource_group.name, @@ -144,9 +147,12 @@ async def test_begin_update(self, resource_group): "persistentDisk": {"mountPath": "str", "sizeInGB": 0, "usedInGB": 0}, "provisioningState": "str", "public": bool, + "secrets": [{"name": "str", "value": "str"}], "temporaryDisk": {"mountPath": "/tmp", "sizeInGB": 0}, + "testEndpointAuthState": "Enabled", "url": "str", "vnetAddons": {"publicEndpoint": False, "publicEndpointUrl": "str"}, + "workloadProfileName": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -158,7 +164,7 @@ async def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -167,11 +173,11 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_apps_list(self, resource_group): response = self.client.apps.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -179,12 +185,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_resource_upload_url(self, resource_group): + async def test_apps_get_resource_upload_url(self, resource_group): response = await self.client.apps.get_resource_upload_url( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -192,14 +198,14 @@ async def test_get_resource_upload_url(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_set_active_deployments(self, resource_group): + async def test_apps_begin_set_active_deployments(self, resource_group): response = await ( await self.client.apps.begin_set_active_deployments( resource_group_name=resource_group.name, service_name="str", app_name="str", active_deployment_collection={"activeDeploymentNames": ["str"]}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -208,13 +214,13 @@ async def test_begin_set_active_deployments(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_validate_domain(self, resource_group): + async def test_apps_validate_domain(self, resource_group): response = await self.client.apps.validate_domain( resource_group_name=resource_group.name, service_name="str", app_name="str", validate_payload={"name": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_bindings_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_bindings_operations.py index 06f6f5a25570..46057b4f0dbf 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_bindings_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_bindings_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_bindings_get(self, resource_group): response = self.client.bindings.get( resource_group_name=resource_group.name, service_name="str", app_name="str", binding_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -34,7 +34,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_bindings_begin_create_or_update(self, resource_group): response = self.client.bindings.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -63,7 +63,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -71,13 +71,13 @@ 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_bindings_begin_delete(self, resource_group): response = self.client.bindings.begin_delete( resource_group_name=resource_group.name, service_name="str", app_name="str", binding_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -85,7 +85,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_bindings_begin_update(self, resource_group): response = self.client.bindings.begin_update( resource_group_name=resource_group.name, service_name="str", @@ -114,7 +114,7 @@ def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -122,12 +122,12 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_bindings_list(self, resource_group): response = self.client.bindings.list( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_bindings_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_bindings_operations_async.py index c1c7f9c4b70e..4b1aa21455ab 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_bindings_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_bindings_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_bindings_get(self, resource_group): response = await self.client.bindings.get( resource_group_name=resource_group.name, service_name="str", app_name="str", binding_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -35,7 +35,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_bindings_begin_create_or_update(self, resource_group): response = await ( await self.client.bindings.begin_create_or_update( resource_group_name=resource_group.name, @@ -65,7 +65,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -74,14 +74,14 @@ 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_bindings_begin_delete(self, resource_group): response = await ( await self.client.bindings.begin_delete( resource_group_name=resource_group.name, service_name="str", app_name="str", binding_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +90,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_bindings_begin_update(self, resource_group): response = await ( await self.client.bindings.begin_update( resource_group_name=resource_group.name, @@ -120,7 +120,7 @@ async def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -129,12 +129,12 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_bindings_list(self, resource_group): response = self.client.bindings.list( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_agent_pool_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_agent_pool_operations.py index 202ca798158f..a39af74c658b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_agent_pool_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_agent_pool_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_service_agent_pool_list(self, resource_group): response = self.client.build_service_agent_pool.list( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_build_service_agent_pool_get(self, resource_group): response = self.client.build_service_agent_pool.get( resource_group_name=resource_group.name, service_name="str", build_service_name="str", agent_pool_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_begin_update_put(self, resource_group): + def test_build_service_agent_pool_begin_update_put(self, resource_group): response = self.client.build_service_agent_pool.begin_update_put( resource_group_name=resource_group.name, service_name="str", @@ -67,7 +67,7 @@ def test_begin_update_put(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_agent_pool_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_agent_pool_operations_async.py index 352fb8bb1c70..196f8418401e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_agent_pool_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_agent_pool_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_service_agent_pool_list(self, resource_group): response = self.client.build_service_agent_pool.list( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_build_service_agent_pool_get(self, resource_group): response = await self.client.build_service_agent_pool.get( resource_group_name=resource_group.name, service_name="str", build_service_name="str", agent_pool_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_begin_update_put(self, resource_group): + async def test_build_service_agent_pool_begin_update_put(self, resource_group): response = await ( await self.client.build_service_agent_pool.begin_update_put( resource_group_name=resource_group.name, @@ -72,7 +72,7 @@ async def test_begin_update_put(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_builder_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_builder_operations.py index 29d1aef3c0ee..b1ef015cd9af 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_builder_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_builder_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_build_service_builder_get(self, resource_group): response = self.client.build_service_builder.get( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -34,7 +34,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_build_service_builder_begin_create_or_update(self, resource_group): response = self.client.build_service_builder.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -44,7 +44,7 @@ def test_begin_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "buildpackGroups": [{"buildpacks": [{"id": "str"}], "name": "str"}], + "buildpackGroups": [{"buildpacks": [{"id": "str", "version": "str"}], "name": "str"}], "provisioningState": "str", "stack": {"id": "str", "version": "str"}, }, @@ -58,7 +58,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -66,13 +66,13 @@ 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_build_service_builder_begin_delete(self, resource_group): response = self.client.build_service_builder.begin_delete( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -80,12 +80,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_build_service_builder_list(self, resource_group): response = self.client.build_service_builder.list( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -93,13 +93,13 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_deployments(self, resource_group): + def test_build_service_builder_list_deployments(self, resource_group): response = self.client.build_service_builder.list_deployments( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_builder_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_builder_operations_async.py index c192e1200d09..ae521ffc40fb 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_builder_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_builder_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_build_service_builder_get(self, resource_group): response = await self.client.build_service_builder.get( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -35,7 +35,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_build_service_builder_begin_create_or_update(self, resource_group): response = await ( await self.client.build_service_builder.begin_create_or_update( resource_group_name=resource_group.name, @@ -46,7 +46,7 @@ async def test_begin_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "buildpackGroups": [{"buildpacks": [{"id": "str"}], "name": "str"}], + "buildpackGroups": [{"buildpacks": [{"id": "str", "version": "str"}], "name": "str"}], "provisioningState": "str", "stack": {"id": "str", "version": "str"}, }, @@ -60,7 +60,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -69,14 +69,14 @@ 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_build_service_builder_begin_delete(self, resource_group): response = await ( await self.client.build_service_builder.begin_delete( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -85,12 +85,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_build_service_builder_list(self, resource_group): response = self.client.build_service_builder.list( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -98,13 +98,13 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_deployments(self, resource_group): + async def test_build_service_builder_list_deployments(self, resource_group): response = await self.client.build_service_builder.list_deployments( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_operations.py index a6cdb3be67ce..bde7378456d3 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_build_services(self, resource_group): + def test_build_service_list_build_services(self, resource_group): response = self.client.build_service.list_build_services( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_build_services(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_build_service(self, resource_group): + def test_build_service_get_build_service(self, resource_group): response = self.client.build_service.get_build_service( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get_build_service(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_build_service_begin_create_or_update(self, resource_group): response = self.client.build_service.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -69,7 +69,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -77,12 +77,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_builds(self, resource_group): + def test_build_service_list_builds(self, resource_group): response = self.client.build_service.list_builds( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -90,13 +90,13 @@ def test_list_builds(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_build(self, resource_group): + def test_build_service_get_build(self, resource_group): response = self.client.build_service.get_build( resource_group_name=resource_group.name, service_name="str", build_service_name="str", build_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -104,7 +104,7 @@ def test_get_build(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update_build(self, resource_group): + def test_build_service_create_or_update_build(self, resource_group): response = self.client.build_service.create_or_update_build( resource_group_name=resource_group.name, service_name="str", @@ -141,7 +141,7 @@ def test_create_or_update_build(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -149,13 +149,13 @@ def test_create_or_update_build(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete_build(self, resource_group): + def test_build_service_begin_delete_build(self, resource_group): response = self.client.build_service.begin_delete_build( resource_group_name=resource_group.name, service_name="str", build_service_name="str", build_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -163,13 +163,13 @@ def test_begin_delete_build(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_build_results(self, resource_group): + def test_build_service_list_build_results(self, resource_group): response = self.client.build_service.list_build_results( resource_group_name=resource_group.name, service_name="str", build_service_name="str", build_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -177,14 +177,14 @@ def test_list_build_results(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_build_result(self, resource_group): + def test_build_service_get_build_result(self, resource_group): response = self.client.build_service.get_build_result( resource_group_name=resource_group.name, service_name="str", build_service_name="str", build_name="str", build_result_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -192,14 +192,14 @@ def test_get_build_result(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_build_result_log(self, resource_group): + def test_build_service_get_build_result_log(self, resource_group): response = self.client.build_service.get_build_result_log( resource_group_name=resource_group.name, service_name="str", build_service_name="str", build_name="str", build_result_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -207,12 +207,12 @@ def test_get_build_result_log(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_resource_upload_url(self, resource_group): + def test_build_service_get_resource_upload_url(self, resource_group): response = self.client.build_service.get_resource_upload_url( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -220,12 +220,12 @@ def test_get_resource_upload_url(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_supported_buildpacks(self, resource_group): + def test_build_service_list_supported_buildpacks(self, resource_group): response = self.client.build_service.list_supported_buildpacks( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -233,13 +233,13 @@ def test_list_supported_buildpacks(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_supported_buildpack(self, resource_group): + def test_build_service_get_supported_buildpack(self, resource_group): response = self.client.build_service.get_supported_buildpack( resource_group_name=resource_group.name, service_name="str", build_service_name="str", buildpack_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -247,12 +247,12 @@ def test_get_supported_buildpack(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_supported_stacks(self, resource_group): + def test_build_service_list_supported_stacks(self, resource_group): response = self.client.build_service.list_supported_stacks( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -260,13 +260,13 @@ def test_list_supported_stacks(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_supported_stack(self, resource_group): + def test_build_service_get_supported_stack(self, resource_group): response = self.client.build_service.get_supported_stack( resource_group_name=resource_group.name, service_name="str", build_service_name="str", stack_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_operations_async.py index eb626889af70..fb55a3ccc5bb 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_build_service_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_build_services(self, resource_group): + async def test_build_service_list_build_services(self, resource_group): response = self.client.build_service.list_build_services( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_build_services(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_build_service(self, resource_group): + async def test_build_service_get_build_service(self, resource_group): response = await self.client.build_service.get_build_service( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get_build_service(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_build_service_begin_create_or_update(self, resource_group): response = await ( await self.client.build_service.begin_create_or_update( resource_group_name=resource_group.name, @@ -71,7 +71,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -80,12 +80,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_builds(self, resource_group): + async def test_build_service_list_builds(self, resource_group): response = self.client.build_service.list_builds( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -93,13 +93,13 @@ async def test_list_builds(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_build(self, resource_group): + async def test_build_service_get_build(self, resource_group): response = await self.client.build_service.get_build( resource_group_name=resource_group.name, service_name="str", build_service_name="str", build_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -107,7 +107,7 @@ async def test_get_build(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update_build(self, resource_group): + async def test_build_service_create_or_update_build(self, resource_group): response = await self.client.build_service.create_or_update_build( resource_group_name=resource_group.name, service_name="str", @@ -144,7 +144,7 @@ async def test_create_or_update_build(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -152,14 +152,14 @@ async def test_create_or_update_build(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete_build(self, resource_group): + async def test_build_service_begin_delete_build(self, resource_group): response = await ( await self.client.build_service.begin_delete_build( resource_group_name=resource_group.name, service_name="str", build_service_name="str", build_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -168,13 +168,13 @@ async def test_begin_delete_build(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_build_results(self, resource_group): + async def test_build_service_list_build_results(self, resource_group): response = self.client.build_service.list_build_results( resource_group_name=resource_group.name, service_name="str", build_service_name="str", build_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -182,14 +182,14 @@ async def test_list_build_results(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_build_result(self, resource_group): + async def test_build_service_get_build_result(self, resource_group): response = await self.client.build_service.get_build_result( resource_group_name=resource_group.name, service_name="str", build_service_name="str", build_name="str", build_result_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -197,14 +197,14 @@ async def test_get_build_result(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_build_result_log(self, resource_group): + async def test_build_service_get_build_result_log(self, resource_group): response = await self.client.build_service.get_build_result_log( resource_group_name=resource_group.name, service_name="str", build_service_name="str", build_name="str", build_result_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -212,12 +212,12 @@ async def test_get_build_result_log(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_resource_upload_url(self, resource_group): + async def test_build_service_get_resource_upload_url(self, resource_group): response = await self.client.build_service.get_resource_upload_url( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -225,12 +225,12 @@ async def test_get_resource_upload_url(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_supported_buildpacks(self, resource_group): + async def test_build_service_list_supported_buildpacks(self, resource_group): response = await self.client.build_service.list_supported_buildpacks( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -238,13 +238,13 @@ async def test_list_supported_buildpacks(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_supported_buildpack(self, resource_group): + async def test_build_service_get_supported_buildpack(self, resource_group): response = await self.client.build_service.get_supported_buildpack( resource_group_name=resource_group.name, service_name="str", build_service_name="str", buildpack_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -252,12 +252,12 @@ async def test_get_supported_buildpack(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_supported_stacks(self, resource_group): + async def test_build_service_list_supported_stacks(self, resource_group): response = await self.client.build_service.list_supported_stacks( resource_group_name=resource_group.name, service_name="str", build_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -265,13 +265,13 @@ async def test_list_supported_stacks(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_supported_stack(self, resource_group): + async def test_build_service_get_supported_stack(self, resource_group): response = await self.client.build_service.get_supported_stack( resource_group_name=resource_group.name, service_name="str", build_service_name="str", stack_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_buildpack_binding_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_buildpack_binding_operations.py index 532977020d1e..4e9e334143f4 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_buildpack_binding_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_buildpack_binding_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_for_cluster(self, resource_group): + def test_buildpack_binding_list_for_cluster(self, resource_group): response = self.client.buildpack_binding.list_for_cluster( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,14 +32,14 @@ def test_list_for_cluster(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_buildpack_binding_get(self, resource_group): response = self.client.buildpack_binding.get( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", buildpack_binding_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_begin_create_or_update(self, resource_group): + def test_buildpack_binding_begin_create_or_update(self, resource_group): response = self.client.buildpack_binding.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -72,7 +72,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -80,14 +80,14 @@ 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_buildpack_binding_begin_delete(self, resource_group): response = self.client.buildpack_binding.begin_delete( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", buildpack_binding_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -95,13 +95,13 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_buildpack_binding_list(self, resource_group): response = self.client.buildpack_binding.list( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_buildpack_binding_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_buildpack_binding_operations_async.py index 6595afbf0d4f..5a711541da87 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_buildpack_binding_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_buildpack_binding_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_for_cluster(self, resource_group): + async def test_buildpack_binding_list_for_cluster(self, resource_group): response = self.client.buildpack_binding.list_for_cluster( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,14 +33,14 @@ async def test_list_for_cluster(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_buildpack_binding_get(self, resource_group): response = await self.client.buildpack_binding.get( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", buildpack_binding_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_begin_create_or_update(self, resource_group): + async def test_buildpack_binding_begin_create_or_update(self, resource_group): response = await ( await self.client.buildpack_binding.begin_create_or_update( resource_group_name=resource_group.name, @@ -74,7 +74,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -83,7 +83,7 @@ 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_buildpack_binding_begin_delete(self, resource_group): response = await ( await self.client.buildpack_binding.begin_delete( resource_group_name=resource_group.name, @@ -91,7 +91,7 @@ async def test_begin_delete(self, resource_group): build_service_name="str", builder_name="str", buildpack_binding_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -100,13 +100,13 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_buildpack_binding_list(self, resource_group): response = self.client.buildpack_binding.list( resource_group_name=resource_group.name, service_name="str", build_service_name="str", builder_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_certificates_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_certificates_operations.py index 013e6eecd9d9..48b336b91100 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_certificates_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_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_certificates_get(self, resource_group): response = self.client.certificates.get( resource_group_name=resource_group.name, service_name="str", certificate_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_certificates_begin_create_or_update(self, resource_group): response = self.client.certificates.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -52,7 +52,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -60,12 +60,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_certificates_begin_delete(self, resource_group): response = self.client.certificates.begin_delete( resource_group_name=resource_group.name, service_name="str", certificate_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -73,11 +73,11 @@ def test_begin_delete(self, resource_group): @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, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_certificates_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_certificates_operations_async.py index 819fbd1aa9bf..ca234d7c27ae 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_certificates_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_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_certificates_get(self, resource_group): response = await self.client.certificates.get( resource_group_name=resource_group.name, service_name="str", certificate_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_certificates_begin_create_or_update(self, resource_group): response = await ( await self.client.certificates.begin_create_or_update( resource_group_name=resource_group.name, @@ -54,7 +54,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -63,13 +63,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_certificates_begin_delete(self, resource_group): response = await ( await self.client.certificates.begin_delete( resource_group_name=resource_group.name, service_name="str", certificate_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -78,11 +78,11 @@ async def test_begin_delete(self, resource_group): @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, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_config_servers_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_config_servers_operations.py index fabd090ae560..ca0c87061096 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_config_servers_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_config_servers_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_config_servers_get(self, resource_group): response = self.client.config_servers.get( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -32,7 +32,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update_put(self, resource_group): + def test_config_servers_begin_update_put(self, resource_group): response = self.client.config_servers.begin_update_put( resource_group_name=resource_group.name, service_name="str", @@ -68,8 +68,11 @@ def test_begin_update_put(self, resource_group): "username": "str", } }, + "enabledState": "str", "error": {"code": "str", "message": "str"}, + "instances": [{"name": "str", "status": "str"}], "provisioningState": "str", + "resourceRequests": {"cpu": "str", "instanceCount": 0, "memory": "str"}, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -81,7 +84,7 @@ def test_begin_update_put(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -89,7 +92,7 @@ def test_begin_update_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update_patch(self, resource_group): + def test_config_servers_begin_update_patch(self, resource_group): response = self.client.config_servers.begin_update_patch( resource_group_name=resource_group.name, service_name="str", @@ -125,8 +128,11 @@ def test_begin_update_patch(self, resource_group): "username": "str", } }, + "enabledState": "str", "error": {"code": "str", "message": "str"}, + "instances": [{"name": "str", "status": "str"}], "provisioningState": "str", + "resourceRequests": {"cpu": "str", "instanceCount": 0, "memory": "str"}, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -138,7 +144,7 @@ def test_begin_update_patch(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -146,7 +152,31 @@ def test_begin_update_patch(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_validate(self, resource_group): + def test_config_servers_begin_delete(self, resource_group): + response = self.client.config_servers.begin_delete( + resource_group_name=resource_group.name, + service_name="str", + api_version="2024-05-01-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_config_servers_list(self, resource_group): + response = self.client.config_servers.list( + resource_group_name=resource_group.name, + service_name="str", + api_version="2024-05-01-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_config_servers_begin_validate(self, resource_group): response = self.client.config_servers.begin_validate( resource_group_name=resource_group.name, service_name="str", @@ -178,7 +208,7 @@ def test_begin_validate(self, resource_group): "username": "str", } }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_config_servers_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_config_servers_operations_async.py index 8a95e1f0f971..e4e8e5c7bc75 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_config_servers_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_config_servers_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_config_servers_get(self, resource_group): response = await self.client.config_servers.get( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -33,7 +33,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update_put(self, resource_group): + async def test_config_servers_begin_update_put(self, resource_group): response = await ( await self.client.config_servers.begin_update_put( resource_group_name=resource_group.name, @@ -70,8 +70,11 @@ async def test_begin_update_put(self, resource_group): "username": "str", } }, + "enabledState": "str", "error": {"code": "str", "message": "str"}, + "instances": [{"name": "str", "status": "str"}], "provisioningState": "str", + "resourceRequests": {"cpu": "str", "instanceCount": 0, "memory": "str"}, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -83,7 +86,7 @@ async def test_begin_update_put(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -92,7 +95,7 @@ async def test_begin_update_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update_patch(self, resource_group): + async def test_config_servers_begin_update_patch(self, resource_group): response = await ( await self.client.config_servers.begin_update_patch( resource_group_name=resource_group.name, @@ -129,8 +132,11 @@ async def test_begin_update_patch(self, resource_group): "username": "str", } }, + "enabledState": "str", "error": {"code": "str", "message": "str"}, + "instances": [{"name": "str", "status": "str"}], "provisioningState": "str", + "resourceRequests": {"cpu": "str", "instanceCount": 0, "memory": "str"}, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -142,7 +148,7 @@ async def test_begin_update_patch(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -151,7 +157,33 @@ async def test_begin_update_patch(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_validate(self, resource_group): + async def test_config_servers_begin_delete(self, resource_group): + response = await ( + await self.client.config_servers.begin_delete( + resource_group_name=resource_group.name, + service_name="str", + api_version="2024-05-01-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_config_servers_list(self, resource_group): + response = self.client.config_servers.list( + resource_group_name=resource_group.name, + service_name="str", + api_version="2024-05-01-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_config_servers_begin_validate(self, resource_group): response = await ( await self.client.config_servers.begin_validate( resource_group_name=resource_group.name, @@ -184,7 +216,7 @@ async def test_begin_validate(self, resource_group): "username": "str", } }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_configuration_services_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_configuration_services_operations.py index 4bcc208828cb..e41bdb36ee8e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_configuration_services_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_configuration_services_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_configuration_services_get(self, resource_group): response = self.client.configuration_services.get( resource_group_name=resource_group.name, service_name="str", configuration_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_configuration_services_begin_create_or_update(self, resource_group): response = self.client.configuration_services.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -65,7 +65,8 @@ def test_begin_create_or_update(self, resource_group): "username": "str", } ] - } + }, + "refreshIntervalInSeconds": 0, }, }, "systemData": { @@ -78,7 +79,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,12 +87,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_configuration_services_begin_delete(self, resource_group): response = self.client.configuration_services.begin_delete( resource_group_name=resource_group.name, service_name="str", configuration_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,11 +100,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_configuration_services_list(self, resource_group): response = self.client.configuration_services.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -111,7 +112,7 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_validate(self, resource_group): + def test_configuration_services_begin_validate(self, resource_group): response = self.client.configuration_services.begin_validate( resource_group_name=resource_group.name, service_name="str", @@ -135,9 +136,10 @@ def test_begin_validate(self, resource_group): "username": "str", } ] - } + }, + "refreshIntervalInSeconds": 0, }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -145,7 +147,7 @@ def test_begin_validate(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_validate_resource(self, resource_group): + def test_configuration_services_begin_validate_resource(self, resource_group): response = self.client.configuration_services.begin_validate_resource( resource_group_name=resource_group.name, service_name="str", @@ -177,7 +179,8 @@ def test_begin_validate_resource(self, resource_group): "username": "str", } ] - } + }, + "refreshIntervalInSeconds": 0, }, }, "systemData": { @@ -190,7 +193,7 @@ def test_begin_validate_resource(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_configuration_services_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_configuration_services_operations_async.py index a367ec7ef3b4..55f65fe56ab6 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_configuration_services_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_configuration_services_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_configuration_services_get(self, resource_group): response = await self.client.configuration_services.get( resource_group_name=resource_group.name, service_name="str", configuration_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_configuration_services_begin_create_or_update(self, resource_group): response = await ( await self.client.configuration_services.begin_create_or_update( resource_group_name=resource_group.name, @@ -67,7 +67,8 @@ async def test_begin_create_or_update(self, resource_group): "username": "str", } ] - } + }, + "refreshIntervalInSeconds": 0, }, }, "systemData": { @@ -80,7 +81,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -89,13 +90,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_configuration_services_begin_delete(self, resource_group): response = await ( await self.client.configuration_services.begin_delete( resource_group_name=resource_group.name, service_name="str", configuration_service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -104,11 +105,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_configuration_services_list(self, resource_group): response = self.client.configuration_services.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -116,7 +117,7 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_validate(self, resource_group): + async def test_configuration_services_begin_validate(self, resource_group): response = await ( await self.client.configuration_services.begin_validate( resource_group_name=resource_group.name, @@ -141,9 +142,10 @@ async def test_begin_validate(self, resource_group): "username": "str", } ] - } + }, + "refreshIntervalInSeconds": 0, }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -152,7 +154,7 @@ async def test_begin_validate(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_validate_resource(self, resource_group): + async def test_configuration_services_begin_validate_resource(self, resource_group): response = await ( await self.client.configuration_services.begin_validate_resource( resource_group_name=resource_group.name, @@ -185,7 +187,8 @@ async def test_begin_validate_resource(self, resource_group): "username": "str", } ] - } + }, + "refreshIntervalInSeconds": 0, }, }, "systemData": { @@ -198,7 +201,7 @@ async def test_begin_validate_resource(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_container_registries_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_container_registries_operations.py index 0c7c7b622ab8..4dff64e0a41f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_container_registries_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_container_registries_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_registries_list(self, resource_group): response = self.client.container_registries.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_container_registries_get(self, resource_group): response = self.client.container_registries.get( resource_group_name=resource_group.name, service_name="str", container_registry_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_registries_begin_create_or_update(self, resource_group): response = self.client.container_registries.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -64,7 +64,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-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_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_container_registries_begin_delete(self, resource_group): response = self.client.container_registries.begin_delete( resource_group_name=resource_group.name, service_name="str", container_registry_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -85,13 +85,13 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_validate(self, resource_group): + def test_container_registries_begin_validate(self, resource_group): response = self.client.container_registries.begin_validate( resource_group_name=resource_group.name, service_name="str", container_registry_name="str", container_registry_properties={"credentials": "container_registry_credentials", "provisioningState": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_container_registries_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_container_registries_operations_async.py index db9829f8b236..77393fddf8b5 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_container_registries_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_container_registries_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_registries_list(self, resource_group): response = self.client.container_registries.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_container_registries_get(self, resource_group): response = await self.client.container_registries.get( resource_group_name=resource_group.name, service_name="str", container_registry_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_registries_begin_create_or_update(self, resource_group): response = await ( await self.client.container_registries.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="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -75,13 +75,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_registries_begin_delete(self, resource_group): response = await ( await self.client.container_registries.begin_delete( resource_group_name=resource_group.name, service_name="str", container_registry_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +90,7 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_validate(self, resource_group): + async def test_container_registries_begin_validate(self, resource_group): response = await ( await self.client.container_registries.begin_validate( resource_group_name=resource_group.name, @@ -100,7 +100,7 @@ async def test_begin_validate(self, resource_group): "credentials": "container_registry_credentials", "provisioningState": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_custom_domains_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_custom_domains_operations.py index c565da9c391b..481d93ce7d5b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_custom_domains_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_custom_domains_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_custom_domains_get(self, resource_group): response = self.client.custom_domains.get( resource_group_name=resource_group.name, service_name="str", app_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -34,7 +34,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_custom_domains_begin_create_or_update(self, resource_group): response = self.client.custom_domains.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -54,7 +54,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -62,13 +62,13 @@ 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_custom_domains_begin_delete(self, resource_group): response = self.client.custom_domains.begin_delete( resource_group_name=resource_group.name, service_name="str", app_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -76,7 +76,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_custom_domains_begin_update(self, resource_group): response = self.client.custom_domains.begin_update( resource_group_name=resource_group.name, service_name="str", @@ -96,7 +96,7 @@ def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -104,12 +104,12 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_custom_domains_list(self, resource_group): response = self.client.custom_domains.list( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_custom_domains_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_custom_domains_operations_async.py index ff345b7d577a..74c61fd7ff2e 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_custom_domains_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_custom_domains_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_custom_domains_get(self, resource_group): response = await self.client.custom_domains.get( resource_group_name=resource_group.name, service_name="str", app_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -35,7 +35,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_custom_domains_begin_create_or_update(self, resource_group): response = await ( await self.client.custom_domains.begin_create_or_update( resource_group_name=resource_group.name, @@ -61,7 +61,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -70,14 +70,14 @@ 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_custom_domains_begin_delete(self, resource_group): response = await ( await self.client.custom_domains.begin_delete( resource_group_name=resource_group.name, service_name="str", app_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -86,7 +86,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_custom_domains_begin_update(self, resource_group): response = await ( await self.client.custom_domains.begin_update( resource_group_name=resource_group.name, @@ -112,7 +112,7 @@ async def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -121,12 +121,12 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_custom_domains_list(self, resource_group): response = self.client.custom_domains.list( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_customized_accelerators_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_customized_accelerators_operations.py index 708db6de1875..c2c51884558a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_customized_accelerators_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_customized_accelerators_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_customized_accelerators_list(self, resource_group): response = self.client.customized_accelerators.list( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_customized_accelerators_get(self, resource_group): response = self.client.customized_accelerators.get( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", customized_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_begin_create_or_update(self, resource_group): + def test_customized_accelerators_begin_create_or_update(self, resource_group): response = self.client.customized_accelerators.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -85,7 +85,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -93,13 +93,13 @@ 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_customized_accelerators_begin_delete(self, resource_group): response = self.client.customized_accelerators.begin_delete( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", customized_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -107,7 +107,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_validate(self, resource_group): + def test_customized_accelerators_begin_validate(self, resource_group): response = self.client.customized_accelerators.begin_validate( resource_group_name=resource_group.name, service_name="str", @@ -131,7 +131,7 @@ def test_begin_validate(self, resource_group): "imports": ["str"], "provisioningState": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_customized_accelerators_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_customized_accelerators_operations_async.py index 4e9f25d4cbca..8ca970e12b1b 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_customized_accelerators_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_customized_accelerators_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_customized_accelerators_list(self, resource_group): response = self.client.customized_accelerators.list( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_customized_accelerators_get(self, resource_group): response = await self.client.customized_accelerators.get( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", customized_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_begin_create_or_update(self, resource_group): + async def test_customized_accelerators_begin_create_or_update(self, resource_group): response = await ( await self.client.customized_accelerators.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="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -96,14 +96,14 @@ 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_customized_accelerators_begin_delete(self, resource_group): response = await ( await self.client.customized_accelerators.begin_delete( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", customized_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -112,7 +112,7 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_validate(self, resource_group): + async def test_customized_accelerators_begin_validate(self, resource_group): response = await ( await self.client.customized_accelerators.begin_validate( resource_group_name=resource_group.name, @@ -137,7 +137,7 @@ async def test_begin_validate(self, resource_group): "imports": ["str"], "provisioningState": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_deployments_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_deployments_operations.py index 24d35ee27ed6..86a04620caf1 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_deployments_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_deployments_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_deployments_get(self, resource_group): response = self.client.deployments.get( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -34,7 +34,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_deployments_begin_create_or_update(self, resource_group): response = self.client.deployments.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -69,6 +69,33 @@ def test_begin_create_or_update(self, resource_group): "timeoutSeconds": 0, }, "resourceRequests": {"cpu": "str", "memory": "str"}, + "scale": { + "maxReplicas": 10, + "minReplicas": 0, + "rules": [ + { + "azureQueue": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "queueLength": 0, + "queueName": "str", + }, + "custom": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + "type": "str", + }, + "http": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + }, + "name": "str", + "tcp": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + }, + } + ], + }, "startupProbe": { "disableProbe": False, "failureThreshold": 0, @@ -105,7 +132,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -113,13 +140,13 @@ 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_deployments_begin_delete(self, resource_group): response = self.client.deployments.begin_delete( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -127,7 +154,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_deployments_begin_update(self, resource_group): response = self.client.deployments.begin_update( resource_group_name=resource_group.name, service_name="str", @@ -162,6 +189,33 @@ def test_begin_update(self, resource_group): "timeoutSeconds": 0, }, "resourceRequests": {"cpu": "str", "memory": "str"}, + "scale": { + "maxReplicas": 10, + "minReplicas": 0, + "rules": [ + { + "azureQueue": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "queueLength": 0, + "queueName": "str", + }, + "custom": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + "type": "str", + }, + "http": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + }, + "name": "str", + "tcp": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + }, + } + ], + }, "startupProbe": { "disableProbe": False, "failureThreshold": 0, @@ -198,7 +252,7 @@ def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -206,12 +260,12 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_deployments_list(self, resource_group): response = self.client.deployments.list( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -219,11 +273,11 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_for_cluster(self, resource_group): + def test_deployments_list_for_cluster(self, resource_group): response = self.client.deployments.list_for_cluster( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -231,13 +285,13 @@ def test_list_for_cluster(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_start(self, resource_group): + def test_deployments_begin_start(self, resource_group): response = self.client.deployments.begin_start( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -245,13 +299,13 @@ def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_stop(self, resource_group): + def test_deployments_begin_stop(self, resource_group): response = self.client.deployments.begin_stop( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -259,13 +313,13 @@ def test_begin_stop(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_restart(self, resource_group): + def test_deployments_begin_restart(self, resource_group): response = self.client.deployments.begin_restart( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -273,13 +327,13 @@ def test_begin_restart(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_enable_remote_debugging(self, resource_group): + def test_deployments_begin_enable_remote_debugging(self, resource_group): response = self.client.deployments.begin_enable_remote_debugging( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -287,13 +341,13 @@ def test_begin_enable_remote_debugging(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_disable_remote_debugging(self, resource_group): + def test_deployments_begin_disable_remote_debugging(self, resource_group): response = self.client.deployments.begin_disable_remote_debugging( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -301,13 +355,13 @@ def test_begin_disable_remote_debugging(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_remote_debugging_config(self, resource_group): + def test_deployments_get_remote_debugging_config(self, resource_group): response = self.client.deployments.get_remote_debugging_config( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -315,13 +369,13 @@ def test_get_remote_debugging_config(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_log_file_url(self, resource_group): + def test_deployments_get_log_file_url(self, resource_group): response = self.client.deployments.get_log_file_url( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -329,14 +383,14 @@ def test_get_log_file_url(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_generate_heap_dump(self, resource_group): + def test_deployments_begin_generate_heap_dump(self, resource_group): response = self.client.deployments.begin_generate_heap_dump( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", diagnostic_parameters={"appInstance": "str", "duration": "str", "filePath": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -344,14 +398,14 @@ def test_begin_generate_heap_dump(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_generate_thread_dump(self, resource_group): + def test_deployments_begin_generate_thread_dump(self, resource_group): response = self.client.deployments.begin_generate_thread_dump( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", diagnostic_parameters={"appInstance": "str", "duration": "str", "filePath": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -359,14 +413,14 @@ def test_begin_generate_thread_dump(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_start_jfr(self, resource_group): + def test_deployments_begin_start_jfr(self, resource_group): response = self.client.deployments.begin_start_jfr( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", diagnostic_parameters={"appInstance": "str", "duration": "str", "filePath": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_deployments_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_deployments_operations_async.py index ddd1fe8e0936..f3150aa32715 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_deployments_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_deployments_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_deployments_get(self, resource_group): response = await self.client.deployments.get( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -35,7 +35,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_deployments_begin_create_or_update(self, resource_group): response = await ( await self.client.deployments.begin_create_or_update( resource_group_name=resource_group.name, @@ -71,6 +71,33 @@ async def test_begin_create_or_update(self, resource_group): "timeoutSeconds": 0, }, "resourceRequests": {"cpu": "str", "memory": "str"}, + "scale": { + "maxReplicas": 10, + "minReplicas": 0, + "rules": [ + { + "azureQueue": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "queueLength": 0, + "queueName": "str", + }, + "custom": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + "type": "str", + }, + "http": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + }, + "name": "str", + "tcp": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + }, + } + ], + }, "startupProbe": { "disableProbe": False, "failureThreshold": 0, @@ -107,7 +134,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -116,14 +143,14 @@ 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_deployments_begin_delete(self, resource_group): response = await ( await self.client.deployments.begin_delete( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -132,7 +159,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_deployments_begin_update(self, resource_group): response = await ( await self.client.deployments.begin_update( resource_group_name=resource_group.name, @@ -168,6 +195,33 @@ async def test_begin_update(self, resource_group): "timeoutSeconds": 0, }, "resourceRequests": {"cpu": "str", "memory": "str"}, + "scale": { + "maxReplicas": 10, + "minReplicas": 0, + "rules": [ + { + "azureQueue": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "queueLength": 0, + "queueName": "str", + }, + "custom": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + "type": "str", + }, + "http": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + }, + "name": "str", + "tcp": { + "auth": [{"secretRef": "str", "triggerParameter": "str"}], + "metadata": {"str": "str"}, + }, + } + ], + }, "startupProbe": { "disableProbe": False, "failureThreshold": 0, @@ -204,7 +258,7 @@ async def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -213,12 +267,12 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_deployments_list(self, resource_group): response = self.client.deployments.list( resource_group_name=resource_group.name, service_name="str", app_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -226,11 +280,11 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_for_cluster(self, resource_group): + async def test_deployments_list_for_cluster(self, resource_group): response = self.client.deployments.list_for_cluster( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -238,14 +292,14 @@ async def test_list_for_cluster(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_start(self, resource_group): + async def test_deployments_begin_start(self, resource_group): response = await ( await self.client.deployments.begin_start( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -254,14 +308,14 @@ 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_deployments_begin_stop(self, resource_group): response = await ( await self.client.deployments.begin_stop( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -270,14 +324,14 @@ async def test_begin_stop(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_restart(self, resource_group): + async def test_deployments_begin_restart(self, resource_group): response = await ( await self.client.deployments.begin_restart( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -286,14 +340,14 @@ async def test_begin_restart(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_enable_remote_debugging(self, resource_group): + async def test_deployments_begin_enable_remote_debugging(self, resource_group): response = await ( await self.client.deployments.begin_enable_remote_debugging( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -302,14 +356,14 @@ async def test_begin_enable_remote_debugging(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_disable_remote_debugging(self, resource_group): + async def test_deployments_begin_disable_remote_debugging(self, resource_group): response = await ( await self.client.deployments.begin_disable_remote_debugging( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -318,13 +372,13 @@ async def test_begin_disable_remote_debugging(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_remote_debugging_config(self, resource_group): + async def test_deployments_get_remote_debugging_config(self, resource_group): response = await self.client.deployments.get_remote_debugging_config( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -332,13 +386,13 @@ async def test_get_remote_debugging_config(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_log_file_url(self, resource_group): + async def test_deployments_get_log_file_url(self, resource_group): response = await self.client.deployments.get_log_file_url( resource_group_name=resource_group.name, service_name="str", app_name="str", deployment_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -346,7 +400,7 @@ async def test_get_log_file_url(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_generate_heap_dump(self, resource_group): + async def test_deployments_begin_generate_heap_dump(self, resource_group): response = await ( await self.client.deployments.begin_generate_heap_dump( resource_group_name=resource_group.name, @@ -354,7 +408,7 @@ async def test_begin_generate_heap_dump(self, resource_group): app_name="str", deployment_name="str", diagnostic_parameters={"appInstance": "str", "duration": "str", "filePath": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -363,7 +417,7 @@ async def test_begin_generate_heap_dump(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_generate_thread_dump(self, resource_group): + async def test_deployments_begin_generate_thread_dump(self, resource_group): response = await ( await self.client.deployments.begin_generate_thread_dump( resource_group_name=resource_group.name, @@ -371,7 +425,7 @@ async def test_begin_generate_thread_dump(self, resource_group): app_name="str", deployment_name="str", diagnostic_parameters={"appInstance": "str", "duration": "str", "filePath": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -380,7 +434,7 @@ async def test_begin_generate_thread_dump(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_start_jfr(self, resource_group): + async def test_deployments_begin_start_jfr(self, resource_group): response = await ( await self.client.deployments.begin_start_jfr( resource_group_name=resource_group.name, @@ -388,7 +442,7 @@ async def test_begin_start_jfr(self, resource_group): app_name="str", deployment_name="str", diagnostic_parameters={"appInstance": "str", "duration": "str", "filePath": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_dev_tool_portals_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_dev_tool_portals_operations.py index 9b9d9d045589..c10aa2b32b36 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_dev_tool_portals_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_dev_tool_portals_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_dev_tool_portals_list(self, resource_group): response = self.client.dev_tool_portals.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_dev_tool_portals_get(self, resource_group): response = self.client.dev_tool_portals.get( resource_group_name=resource_group.name, service_name="str", dev_tool_portal_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_dev_tool_portals_begin_create_or_update(self, resource_group): response = self.client.dev_tool_portals.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -85,7 +85,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-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_dev_tool_portals_begin_delete(self, resource_group): response = self.client.dev_tool_portals.begin_delete( resource_group_name=resource_group.name, service_name="str", dev_tool_portal_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_dev_tool_portals_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_dev_tool_portals_operations_async.py index f1be0a622084..ae76c43c8223 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_dev_tool_portals_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_dev_tool_portals_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_dev_tool_portals_list(self, resource_group): response = self.client.dev_tool_portals.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_dev_tool_portals_get(self, resource_group): response = await self.client.dev_tool_portals.get( resource_group_name=resource_group.name, service_name="str", dev_tool_portal_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_dev_tool_portals_begin_create_or_update(self, resource_group): response = await ( await self.client.dev_tool_portals.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="2023-12-01", + api_version="2024-05-01-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_dev_tool_portals_begin_delete(self, resource_group): response = await ( await self.client.dev_tool_portals.begin_delete( resource_group_name=resource_group.name, service_name="str", dev_tool_portal_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_eureka_servers_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_eureka_servers_operations.py new file mode 100644 index 000000000000..3a19ba552884 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_eureka_servers_operations.py @@ -0,0 +1,103 @@ +# 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.appplatform import AppPlatformManagementClient + +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 TestAppPlatformManagementEurekaServersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AppPlatformManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_eureka_servers_list(self, resource_group): + response = self.client.eureka_servers.list( + resource_group_name=resource_group.name, + service_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_eureka_servers_get(self, resource_group): + response = self.client.eureka_servers.get( + resource_group_name=resource_group.name, + service_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_eureka_servers_begin_update_put(self, resource_group): + response = self.client.eureka_servers.begin_update_put( + resource_group_name=resource_group.name, + service_name="str", + eureka_server_resource={ + "id": "str", + "name": "str", + "properties": { + "enabledState": "str", + "error": {"code": "str", "message": "str"}, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2024-05-01-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_eureka_servers_begin_update_patch(self, resource_group): + response = self.client.eureka_servers.begin_update_patch( + resource_group_name=resource_group.name, + service_name="str", + eureka_server_resource={ + "id": "str", + "name": "str", + "properties": { + "enabledState": "str", + "error": {"code": "str", "message": "str"}, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2024-05-01-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_eureka_servers_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_eureka_servers_operations_async.py new file mode 100644 index 000000000000..2529dfeee57d --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_eureka_servers_operations_async.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.appplatform.aio import AppPlatformManagementClient + +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 TestAppPlatformManagementEurekaServersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AppPlatformManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_eureka_servers_list(self, resource_group): + response = await self.client.eureka_servers.list( + resource_group_name=resource_group.name, + service_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_eureka_servers_get(self, resource_group): + response = await self.client.eureka_servers.get( + resource_group_name=resource_group.name, + service_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_eureka_servers_begin_update_put(self, resource_group): + response = await ( + await self.client.eureka_servers.begin_update_put( + resource_group_name=resource_group.name, + service_name="str", + eureka_server_resource={ + "id": "str", + "name": "str", + "properties": { + "enabledState": "str", + "error": {"code": "str", "message": "str"}, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2024-05-01-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_eureka_servers_begin_update_patch(self, resource_group): + response = await ( + await self.client.eureka_servers.begin_update_patch( + resource_group_name=resource_group.name, + service_name="str", + eureka_server_resource={ + "id": "str", + "name": "str", + "properties": { + "enabledState": "str", + "error": {"code": "str", "message": "str"}, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + api_version="2024-05-01-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_custom_domains_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_custom_domains_operations.py index d123c810efb0..2fc83b94233f 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_custom_domains_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_custom_domains_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_gateway_custom_domains_get(self, resource_group): response = self.client.gateway_custom_domains.get( resource_group_name=resource_group.name, service_name="str", gateway_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -34,7 +34,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_gateway_custom_domains_begin_create_or_update(self, resource_group): response = self.client.gateway_custom_domains.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -54,7 +54,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -62,13 +62,13 @@ 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_gateway_custom_domains_begin_delete(self, resource_group): response = self.client.gateway_custom_domains.begin_delete( resource_group_name=resource_group.name, service_name="str", gateway_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -76,12 +76,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_gateway_custom_domains_list(self, resource_group): response = self.client.gateway_custom_domains.list( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_custom_domains_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_custom_domains_operations_async.py index 46199fdef556..5278b81355b4 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_custom_domains_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_custom_domains_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_gateway_custom_domains_get(self, resource_group): response = await self.client.gateway_custom_domains.get( resource_group_name=resource_group.name, service_name="str", gateway_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -35,7 +35,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_gateway_custom_domains_begin_create_or_update(self, resource_group): response = await ( await self.client.gateway_custom_domains.begin_create_or_update( resource_group_name=resource_group.name, @@ -56,7 +56,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -65,14 +65,14 @@ 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_gateway_custom_domains_begin_delete(self, resource_group): response = await ( await self.client.gateway_custom_domains.begin_delete( resource_group_name=resource_group.name, service_name="str", gateway_name="str", domain_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -81,12 +81,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_gateway_custom_domains_list(self, resource_group): response = self.client.gateway_custom_domains.list( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_route_configs_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_route_configs_operations.py index 84a45cebc986..13cc7f2413fa 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_route_configs_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_route_configs_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_gateway_route_configs_get(self, resource_group): response = self.client.gateway_route_configs.get( resource_group_name=resource_group.name, service_name="str", gateway_name="str", route_config_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -34,7 +34,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_gateway_route_configs_begin_create_or_update(self, resource_group): response = self.client.gateway_route_configs.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -75,7 +75,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -83,13 +83,13 @@ 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_gateway_route_configs_begin_delete(self, resource_group): response = self.client.gateway_route_configs.begin_delete( resource_group_name=resource_group.name, service_name="str", gateway_name="str", route_config_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -97,12 +97,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_gateway_route_configs_list(self, resource_group): response = self.client.gateway_route_configs.list( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_route_configs_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_route_configs_operations_async.py index b7c3dcad9d0c..897cc85baab1 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_route_configs_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateway_route_configs_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_gateway_route_configs_get(self, resource_group): response = await self.client.gateway_route_configs.get( resource_group_name=resource_group.name, service_name="str", gateway_name="str", route_config_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -35,7 +35,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_gateway_route_configs_begin_create_or_update(self, resource_group): response = await ( await self.client.gateway_route_configs.begin_create_or_update( resource_group_name=resource_group.name, @@ -77,7 +77,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -86,14 +86,14 @@ 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_gateway_route_configs_begin_delete(self, resource_group): response = await ( await self.client.gateway_route_configs.begin_delete( resource_group_name=resource_group.name, service_name="str", gateway_name="str", route_config_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -102,12 +102,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_gateway_route_configs_list(self, resource_group): response = self.client.gateway_route_configs.list( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateways_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateways_operations.py index 1e39e0071d38..45299aa96200 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateways_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateways_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_gateways_get(self, resource_group): response = self.client.gateways.get( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_gateways_begin_create_or_update(self, resource_group): response = self.client.gateways.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -42,6 +42,7 @@ def test_begin_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { + "addonConfigs": {"str": {}}, "apiMetadataProperties": { "description": "str", "documentation": "str", @@ -49,6 +50,7 @@ def test_begin_create_or_update(self, resource_group): "title": "str", "version": "str", }, + "apmTypes": ["str"], "apms": [{"resourceId": "str"}], "clientAuth": {"certificateVerification": "Disabled", "certificates": ["str"]}, "corsProperties": { @@ -70,6 +72,7 @@ def test_begin_create_or_update(self, resource_group): "provisioningState": "str", "public": False, "resourceRequests": {"cpu": "1", "memory": "2Gi"}, + "responseCacheProperties": "gateway_response_cache_properties", "ssoProperties": {"clientId": "str", "clientSecret": "str", "issuerUri": "str", "scope": ["str"]}, "url": "str", }, @@ -84,7 +87,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -92,12 +95,26 @@ 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_gateways_begin_update_capacity(self, resource_group): + response = self.client.gateways.begin_update_capacity( + resource_group_name=resource_group.name, + service_name="str", + gateway_name="str", + gateway_capacity_resource={"sku": {"capacity": 0, "name": "S0", "tier": "Standard"}}, + api_version="2024-05-01-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_gateways_begin_delete(self, resource_group): response = self.client.gateways.begin_delete( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -105,12 +122,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_env_secrets(self, resource_group): + def test_gateways_list_env_secrets(self, resource_group): response = self.client.gateways.list_env_secrets( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -118,12 +135,12 @@ def test_list_env_secrets(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_restart(self, resource_group): + def test_gateways_begin_restart(self, resource_group): response = self.client.gateways.begin_restart( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -131,11 +148,11 @@ def test_begin_restart(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_gateways_list(self, resource_group): response = self.client.gateways.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -143,13 +160,13 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_validate_domain(self, resource_group): + def test_gateways_validate_domain(self, resource_group): response = self.client.gateways.validate_domain( resource_group_name=resource_group.name, service_name="str", gateway_name="str", validate_payload={"name": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateways_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateways_operations_async.py index c687a1578913..9934d45e6bf2 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateways_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_gateways_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_gateways_get(self, resource_group): response = await self.client.gateways.get( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_gateways_begin_create_or_update(self, resource_group): response = await ( await self.client.gateways.begin_create_or_update( resource_group_name=resource_group.name, @@ -44,6 +44,7 @@ async def test_begin_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { + "addonConfigs": {"str": {}}, "apiMetadataProperties": { "description": "str", "documentation": "str", @@ -51,6 +52,7 @@ async def test_begin_create_or_update(self, resource_group): "title": "str", "version": "str", }, + "apmTypes": ["str"], "apms": [{"resourceId": "str"}], "clientAuth": {"certificateVerification": "Disabled", "certificates": ["str"]}, "corsProperties": { @@ -72,6 +74,7 @@ async def test_begin_create_or_update(self, resource_group): "provisioningState": "str", "public": False, "resourceRequests": {"cpu": "1", "memory": "2Gi"}, + "responseCacheProperties": "gateway_response_cache_properties", "ssoProperties": { "clientId": "str", "clientSecret": "str", @@ -91,7 +94,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -100,13 +103,29 @@ 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_gateways_begin_update_capacity(self, resource_group): + response = await ( + await self.client.gateways.begin_update_capacity( + resource_group_name=resource_group.name, + service_name="str", + gateway_name="str", + gateway_capacity_resource={"sku": {"capacity": 0, "name": "S0", "tier": "Standard"}}, + api_version="2024-05-01-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_gateways_begin_delete(self, resource_group): response = await ( await self.client.gateways.begin_delete( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -115,12 +134,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_env_secrets(self, resource_group): + async def test_gateways_list_env_secrets(self, resource_group): response = await self.client.gateways.list_env_secrets( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -128,13 +147,13 @@ async def test_list_env_secrets(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_restart(self, resource_group): + async def test_gateways_begin_restart(self, resource_group): response = await ( await self.client.gateways.begin_restart( resource_group_name=resource_group.name, service_name="str", gateway_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -143,11 +162,11 @@ async def test_begin_restart(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_gateways_list(self, resource_group): response = self.client.gateways.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -155,13 +174,13 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_validate_domain(self, resource_group): + async def test_gateways_validate_domain(self, resource_group): response = await self.client.gateways.validate_domain( resource_group_name=resource_group.name, service_name="str", gateway_name="str", validate_payload={"name": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_execution_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_execution_operations.py new file mode 100644 index 000000000000..3e74833ae12e --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_execution_operations.py @@ -0,0 +1,61 @@ +# 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.appplatform import AppPlatformManagementClient + +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 TestAppPlatformManagementJobExecutionOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AppPlatformManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_execution_begin_cancel(self, resource_group): + response = self.client.job_execution.begin_cancel( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + job_execution_name="str", + api_version="2024-05-01-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_job_execution_get(self, resource_group): + response = self.client.job_execution.get( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + job_execution_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_execution_list_env_secrets(self, resource_group): + response = self.client.job_execution.list_env_secrets( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + job_execution_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_execution_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_execution_operations_async.py new file mode 100644 index 000000000000..e7937493e8c9 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_execution_operations_async.py @@ -0,0 +1,64 @@ +# 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.appplatform.aio import AppPlatformManagementClient + +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 TestAppPlatformManagementJobExecutionOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AppPlatformManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_execution_begin_cancel(self, resource_group): + response = await ( + await self.client.job_execution.begin_cancel( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + job_execution_name="str", + api_version="2024-05-01-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_job_execution_get(self, resource_group): + response = await self.client.job_execution.get( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + job_execution_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_execution_list_env_secrets(self, resource_group): + response = await self.client.job_execution.list_env_secrets( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + job_execution_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_executions_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_executions_operations.py new file mode 100644 index 000000000000..1ea9870c425a --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_executions_operations.py @@ -0,0 +1,32 @@ +# 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.appplatform import AppPlatformManagementClient + +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 TestAppPlatformManagementJobExecutionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AppPlatformManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_executions_list(self, resource_group): + response = self.client.job_executions.list( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + api_version="2024-05-01-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_executions_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_executions_operations_async.py new file mode 100644 index 000000000000..2d1ff2ae3478 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_executions_operations_async.py @@ -0,0 +1,33 @@ +# 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.appplatform.aio import AppPlatformManagementClient + +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 TestAppPlatformManagementJobExecutionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AppPlatformManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_executions_list(self, resource_group): + response = self.client.job_executions.list( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + api_version="2024-05-01-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_operations.py new file mode 100644 index 000000000000..4431cb97f0c4 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.appplatform import AppPlatformManagementClient + +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 TestAppPlatformManagementJobOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AppPlatformManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_get(self, resource_group): + response = self.client.job.get( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_begin_create_or_update(self, resource_group): + response = self.client.job.begin_create_or_update( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + job_resource={ + "id": "str", + "name": "str", + "properties": { + "managedComponentReferences": [{"resourceId": "str"}], + "provisioningState": "str", + "source": "user_source_info", + "template": { + "args": ["str"], + "environmentVariables": [{"name": "str", "secretValue": "str", "value": "str"}], + "resourceRequests": {"cpu": "1", "memory": "2Gi"}, + }, + "triggerConfig": "job_trigger_config", + }, + "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-05-01-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_job_begin_delete(self, resource_group): + response = self.client.job.begin_delete( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + api_version="2024-05-01-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_job_begin_start(self, resource_group): + response = self.client.job.begin_start( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + api_version="2024-05-01-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_job_list_env_secrets(self, resource_group): + response = self.client.job.list_env_secrets( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_operations_async.py new file mode 100644 index 000000000000..b36812d9f162 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_job_operations_async.py @@ -0,0 +1,115 @@ +# 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.appplatform.aio import AppPlatformManagementClient + +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 TestAppPlatformManagementJobOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AppPlatformManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_get(self, resource_group): + response = await self.client.job.get( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_begin_create_or_update(self, resource_group): + response = await ( + await self.client.job.begin_create_or_update( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + job_resource={ + "id": "str", + "name": "str", + "properties": { + "managedComponentReferences": [{"resourceId": "str"}], + "provisioningState": "str", + "source": "user_source_info", + "template": { + "args": ["str"], + "environmentVariables": [{"name": "str", "secretValue": "str", "value": "str"}], + "resourceRequests": {"cpu": "1", "memory": "2Gi"}, + }, + "triggerConfig": "job_trigger_config", + }, + "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-05-01-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_job_begin_delete(self, resource_group): + response = await ( + await self.client.job.begin_delete( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + api_version="2024-05-01-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_job_begin_start(self, resource_group): + response = await ( + await self.client.job.begin_start( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + api_version="2024-05-01-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_job_list_env_secrets(self, resource_group): + response = await self.client.job.list_env_secrets( + resource_group_name=resource_group.name, + service_name="str", + job_name="str", + api_version="2024-05-01-preview", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_jobs_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_jobs_operations.py new file mode 100644 index 000000000000..716e32068165 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_jobs_operations.py @@ -0,0 +1,31 @@ +# 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.appplatform import AppPlatformManagementClient + +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 TestAppPlatformManagementJobsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AppPlatformManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_jobs_list(self, resource_group): + response = self.client.jobs.list( + resource_group_name=resource_group.name, + service_name="str", + api_version="2024-05-01-preview", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_jobs_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_jobs_operations_async.py new file mode 100644 index 000000000000..b74960525139 --- /dev/null +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_jobs_operations_async.py @@ -0,0 +1,32 @@ +# 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.appplatform.aio import AppPlatformManagementClient + +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 TestAppPlatformManagementJobsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AppPlatformManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_jobs_list(self, resource_group): + response = self.client.jobs.list( + resource_group_name=resource_group.name, + service_name="str", + api_version="2024-05-01-preview", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_monitoring_settings_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_monitoring_settings_operations.py index 49153a3909f5..57feee090e4c 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_monitoring_settings_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_monitoring_settings_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_monitoring_settings_get(self, resource_group): response = self.client.monitoring_settings.get( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -32,7 +32,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update_put(self, resource_group): + def test_monitoring_settings_begin_update_put(self, resource_group): response = self.client.monitoring_settings.begin_update_put( resource_group_name=resource_group.name, service_name="str", @@ -57,7 +57,7 @@ def test_begin_update_put(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -65,7 +65,7 @@ def test_begin_update_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update_patch(self, resource_group): + def test_monitoring_settings_begin_update_patch(self, resource_group): response = self.client.monitoring_settings.begin_update_patch( resource_group_name=resource_group.name, service_name="str", @@ -90,7 +90,7 @@ def test_begin_update_patch(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_monitoring_settings_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_monitoring_settings_operations_async.py index 226b4f68e7c1..57a081cffda2 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_monitoring_settings_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_monitoring_settings_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_monitoring_settings_get(self, resource_group): response = await self.client.monitoring_settings.get( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -33,7 +33,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update_put(self, resource_group): + async def test_monitoring_settings_begin_update_put(self, resource_group): response = await ( await self.client.monitoring_settings.begin_update_put( resource_group_name=resource_group.name, @@ -59,7 +59,7 @@ async def test_begin_update_put(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -68,7 +68,7 @@ async def test_begin_update_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update_patch(self, resource_group): + async def test_monitoring_settings_begin_update_patch(self, resource_group): response = await ( await self.client.monitoring_settings.begin_update_patch( resource_group_name=resource_group.name, @@ -94,7 +94,7 @@ async def test_begin_update_patch(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_operations.py index 951ad278b0b9..c91aa526fda7 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_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="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_operations_async.py index 531affd8feca..139593cc2855 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_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="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_predefined_accelerators_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_predefined_accelerators_operations.py index bfce766d4261..4ee0bf479252 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_predefined_accelerators_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_predefined_accelerators_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_predefined_accelerators_list(self, resource_group): response = self.client.predefined_accelerators.list( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_predefined_accelerators_get(self, resource_group): response = self.client.predefined_accelerators.get( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", predefined_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -47,13 +47,13 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_disable(self, resource_group): + def test_predefined_accelerators_begin_disable(self, resource_group): response = self.client.predefined_accelerators.begin_disable( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", predefined_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -61,13 +61,13 @@ def test_begin_disable(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_enable(self, resource_group): + def test_predefined_accelerators_begin_enable(self, resource_group): response = self.client.predefined_accelerators.begin_enable( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", predefined_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_predefined_accelerators_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_predefined_accelerators_operations_async.py index d3c4890c071f..af62238e36e4 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_predefined_accelerators_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_predefined_accelerators_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_predefined_accelerators_list(self, resource_group): response = self.client.predefined_accelerators.list( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_predefined_accelerators_get(self, resource_group): response = await self.client.predefined_accelerators.get( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", predefined_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -48,14 +48,14 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_disable(self, resource_group): + async def test_predefined_accelerators_begin_disable(self, resource_group): response = await ( await self.client.predefined_accelerators.begin_disable( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", predefined_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -64,14 +64,14 @@ async def test_begin_disable(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_enable(self, resource_group): + async def test_predefined_accelerators_begin_enable(self, resource_group): response = await ( await self.client.predefined_accelerators.begin_enable( resource_group_name=resource_group.name, service_name="str", application_accelerator_name="str", predefined_accelerator_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_runtime_versions_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_runtime_versions_operations.py index 0dc96c5bfaf3..4ba4434ff813 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_runtime_versions_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_runtime_versions_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_runtime_versions(self, resource_group): + def test_runtime_versions_list_runtime_versions(self, resource_group): response = self.client.runtime_versions.list_runtime_versions( - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_runtime_versions_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_runtime_versions_operations_async.py index a8916a163876..8d4cc5606139 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_runtime_versions_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_runtime_versions_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_runtime_versions(self, resource_group): + async def test_runtime_versions_list_runtime_versions(self, resource_group): response = await self.client.runtime_versions.list_runtime_versions( - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_service_registries_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_service_registries_operations.py index ab26ec6af446..5bb7619e13d3 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_service_registries_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_service_registries_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_service_registries_get(self, resource_group): response = self.client.service_registries.get( resource_group_name=resource_group.name, service_name="str", service_registry_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_service_registries_begin_create_or_update(self, resource_group): response = self.client.service_registries.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", service_registry_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_begin_delete(self, resource_group): + def test_service_registries_begin_delete(self, resource_group): response = self.client.service_registries.begin_delete( resource_group_name=resource_group.name, service_name="str", service_registry_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -59,11 +59,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_service_registries_list(self, resource_group): response = self.client.service_registries.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_service_registries_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_service_registries_operations_async.py index f96fe9e1c133..55a6bd1e1fcf 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_service_registries_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_service_registries_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_service_registries_get(self, resource_group): response = await self.client.service_registries.get( resource_group_name=resource_group.name, service_name="str", service_registry_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_service_registries_begin_create_or_update(self, resource_group): response = await ( await self.client.service_registries.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", service_registry_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -49,13 +49,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_service_registries_begin_delete(self, resource_group): response = await ( await self.client.service_registries.begin_delete( resource_group_name=resource_group.name, service_name="str", service_registry_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -64,11 +64,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_service_registries_list(self, resource_group): response = self.client.service_registries.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_services_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_services_operations.py index 49ad6342d828..31630004d304 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_services_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_services_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_services_get(self, resource_group): response = self.client.services.get( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -32,16 +32,20 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_services_begin_create_or_update(self, resource_group): response = self.client.services.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", resource={ "id": "str", + "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, "location": "str", "name": "str", "properties": { "fqdn": "str", + "infraResourceGroup": "str", + "maintenanceScheduleConfiguration": "maintenance_schedule_configuration", + "managedEnvironmentId": "str", "marketplaceResource": {"plan": "str", "product": "str", "publisher": "str"}, "networkProfile": { "appNetworkResourceGroup": "str", @@ -60,7 +64,12 @@ def test_begin_create_or_update(self, resource_group): "provisioningState": "str", "serviceId": "str", "version": 0, - "vnetAddons": {"dataPlanePublicEndpoint": False, "logStreamPublicEndpoint": False}, + "vnetAddons": { + "dataPlanePublicEndpoint": False, + "logStreamPublicEndpoint": False, + "privateDnsZoneId": "str", + "privateStorageAccess": "str", + }, "zoneRedundant": False, }, "sku": {"capacity": 0, "name": "S0", "tier": "Standard"}, @@ -75,7 +84,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -83,11 +92,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_services_begin_delete(self, resource_group): response = self.client.services.begin_delete( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -95,16 +104,20 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_services_begin_update(self, resource_group): response = self.client.services.begin_update( resource_group_name=resource_group.name, service_name="str", resource={ "id": "str", + "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, "location": "str", "name": "str", "properties": { "fqdn": "str", + "infraResourceGroup": "str", + "maintenanceScheduleConfiguration": "maintenance_schedule_configuration", + "managedEnvironmentId": "str", "marketplaceResource": {"plan": "str", "product": "str", "publisher": "str"}, "networkProfile": { "appNetworkResourceGroup": "str", @@ -123,7 +136,12 @@ def test_begin_update(self, resource_group): "provisioningState": "str", "serviceId": "str", "version": 0, - "vnetAddons": {"dataPlanePublicEndpoint": False, "logStreamPublicEndpoint": False}, + "vnetAddons": { + "dataPlanePublicEndpoint": False, + "logStreamPublicEndpoint": False, + "privateDnsZoneId": "str", + "privateStorageAccess": "str", + }, "zoneRedundant": False, }, "sku": {"capacity": 0, "name": "S0", "tier": "Standard"}, @@ -138,7 +156,7 @@ def test_begin_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -146,11 +164,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_test_keys(self, resource_group): + def test_services_list_test_keys(self, resource_group): response = self.client.services.list_test_keys( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -158,12 +176,12 @@ def test_list_test_keys(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_regenerate_test_key(self, resource_group): + def test_services_regenerate_test_key(self, resource_group): response = self.client.services.regenerate_test_key( resource_group_name=resource_group.name, service_name="str", regenerate_test_key_request={"keyType": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -171,11 +189,11 @@ def test_regenerate_test_key(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_disable_test_endpoint(self, resource_group): + def test_services_disable_test_endpoint(self, resource_group): response = self.client.services.disable_test_endpoint( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -183,11 +201,11 @@ def test_disable_test_endpoint(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_enable_test_endpoint(self, resource_group): + def test_services_enable_test_endpoint(self, resource_group): response = self.client.services.enable_test_endpoint( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -195,11 +213,11 @@ def test_enable_test_endpoint(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_stop(self, resource_group): + def test_services_begin_stop(self, resource_group): response = self.client.services.begin_stop( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -207,11 +225,11 @@ def test_begin_stop(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_start(self, resource_group): + def test_services_begin_start(self, resource_group): response = self.client.services.begin_start( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -219,11 +237,11 @@ def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_flush_vnet_dns_setting(self, resource_group): + def test_services_begin_flush_vnet_dns_setting(self, resource_group): response = self.client.services.begin_flush_vnet_dns_setting( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -231,11 +249,11 @@ def test_begin_flush_vnet_dns_setting(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_supported_apm_types(self, resource_group): + def test_services_list_supported_apm_types(self, resource_group): response = self.client.services.list_supported_apm_types( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -243,11 +261,11 @@ def test_list_supported_apm_types(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_globally_enabled_apms(self, resource_group): + def test_services_list_globally_enabled_apms(self, resource_group): response = self.client.services.list_globally_enabled_apms( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -255,12 +273,12 @@ def test_list_globally_enabled_apms(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_enable_apm_globally(self, resource_group): + def test_services_begin_enable_apm_globally(self, resource_group): response = self.client.services.begin_enable_apm_globally( resource_group_name=resource_group.name, service_name="str", apm={"resourceId": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -268,12 +286,12 @@ def test_begin_enable_apm_globally(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_disable_apm_globally(self, resource_group): + def test_services_begin_disable_apm_globally(self, resource_group): response = self.client.services.begin_disable_apm_globally( resource_group_name=resource_group.name, service_name="str", apm={"resourceId": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -281,11 +299,11 @@ def test_begin_disable_apm_globally(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_check_name_availability(self, resource_group): + def test_services_check_name_availability(self, resource_group): response = self.client.services.check_name_availability( location="str", availability_parameters={"name": "str", "type": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -293,9 +311,9 @@ def test_check_name_availability(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_services_list_by_subscription(self, resource_group): response = self.client.services.list_by_subscription( - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -303,10 +321,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_services_list(self, resource_group): response = self.client.services.list( resource_group_name=resource_group.name, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -314,11 +332,11 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_supported_server_versions(self, resource_group): + def test_services_list_supported_server_versions(self, resource_group): response = self.client.services.list_supported_server_versions( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_services_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_services_operations_async.py index d7577b2d3a05..f18708cc9a64 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_services_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_services_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_services_get(self, resource_group): response = await self.client.services.get( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -33,17 +33,21 @@ 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_services_begin_create_or_update(self, resource_group): response = await ( await self.client.services.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", resource={ "id": "str", + "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, "location": "str", "name": "str", "properties": { "fqdn": "str", + "infraResourceGroup": "str", + "maintenanceScheduleConfiguration": "maintenance_schedule_configuration", + "managedEnvironmentId": "str", "marketplaceResource": {"plan": "str", "product": "str", "publisher": "str"}, "networkProfile": { "appNetworkResourceGroup": "str", @@ -62,7 +66,12 @@ async def test_begin_create_or_update(self, resource_group): "provisioningState": "str", "serviceId": "str", "version": 0, - "vnetAddons": {"dataPlanePublicEndpoint": False, "logStreamPublicEndpoint": False}, + "vnetAddons": { + "dataPlanePublicEndpoint": False, + "logStreamPublicEndpoint": False, + "privateDnsZoneId": "str", + "privateStorageAccess": "str", + }, "zoneRedundant": False, }, "sku": {"capacity": 0, "name": "S0", "tier": "Standard"}, @@ -77,7 +86,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -86,12 +95,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_services_begin_delete(self, resource_group): response = await ( await self.client.services.begin_delete( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -100,17 +109,21 @@ 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_services_begin_update(self, resource_group): response = await ( await self.client.services.begin_update( resource_group_name=resource_group.name, service_name="str", resource={ "id": "str", + "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, "location": "str", "name": "str", "properties": { "fqdn": "str", + "infraResourceGroup": "str", + "maintenanceScheduleConfiguration": "maintenance_schedule_configuration", + "managedEnvironmentId": "str", "marketplaceResource": {"plan": "str", "product": "str", "publisher": "str"}, "networkProfile": { "appNetworkResourceGroup": "str", @@ -129,7 +142,12 @@ async def test_begin_update(self, resource_group): "provisioningState": "str", "serviceId": "str", "version": 0, - "vnetAddons": {"dataPlanePublicEndpoint": False, "logStreamPublicEndpoint": False}, + "vnetAddons": { + "dataPlanePublicEndpoint": False, + "logStreamPublicEndpoint": False, + "privateDnsZoneId": "str", + "privateStorageAccess": "str", + }, "zoneRedundant": False, }, "sku": {"capacity": 0, "name": "S0", "tier": "Standard"}, @@ -144,7 +162,7 @@ async def test_begin_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -153,11 +171,11 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_test_keys(self, resource_group): + async def test_services_list_test_keys(self, resource_group): response = await self.client.services.list_test_keys( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -165,12 +183,12 @@ async def test_list_test_keys(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_regenerate_test_key(self, resource_group): + async def test_services_regenerate_test_key(self, resource_group): response = await self.client.services.regenerate_test_key( resource_group_name=resource_group.name, service_name="str", regenerate_test_key_request={"keyType": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -178,11 +196,11 @@ async def test_regenerate_test_key(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_disable_test_endpoint(self, resource_group): + async def test_services_disable_test_endpoint(self, resource_group): response = await self.client.services.disable_test_endpoint( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -190,11 +208,11 @@ async def test_disable_test_endpoint(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_enable_test_endpoint(self, resource_group): + async def test_services_enable_test_endpoint(self, resource_group): response = await self.client.services.enable_test_endpoint( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -202,12 +220,12 @@ async def test_enable_test_endpoint(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_stop(self, resource_group): + async def test_services_begin_stop(self, resource_group): response = await ( await self.client.services.begin_stop( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -216,12 +234,12 @@ async def test_begin_stop(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_start(self, resource_group): + async def test_services_begin_start(self, resource_group): response = await ( await self.client.services.begin_start( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -230,12 +248,12 @@ async def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_flush_vnet_dns_setting(self, resource_group): + async def test_services_begin_flush_vnet_dns_setting(self, resource_group): response = await ( await self.client.services.begin_flush_vnet_dns_setting( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -244,11 +262,11 @@ async def test_begin_flush_vnet_dns_setting(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_supported_apm_types(self, resource_group): + async def test_services_list_supported_apm_types(self, resource_group): response = self.client.services.list_supported_apm_types( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -256,11 +274,11 @@ async def test_list_supported_apm_types(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_globally_enabled_apms(self, resource_group): + async def test_services_list_globally_enabled_apms(self, resource_group): response = await self.client.services.list_globally_enabled_apms( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -268,13 +286,13 @@ async def test_list_globally_enabled_apms(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_enable_apm_globally(self, resource_group): + async def test_services_begin_enable_apm_globally(self, resource_group): response = await ( await self.client.services.begin_enable_apm_globally( resource_group_name=resource_group.name, service_name="str", apm={"resourceId": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -283,13 +301,13 @@ async def test_begin_enable_apm_globally(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_disable_apm_globally(self, resource_group): + async def test_services_begin_disable_apm_globally(self, resource_group): response = await ( await self.client.services.begin_disable_apm_globally( resource_group_name=resource_group.name, service_name="str", apm={"resourceId": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -298,11 +316,11 @@ async def test_begin_disable_apm_globally(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_check_name_availability(self, resource_group): + async def test_services_check_name_availability(self, resource_group): response = await self.client.services.check_name_availability( location="str", availability_parameters={"name": "str", "type": "str"}, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) # please add some check logic here by yourself @@ -310,9 +328,9 @@ async def test_check_name_availability(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_services_list_by_subscription(self, resource_group): response = self.client.services.list_by_subscription( - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -320,10 +338,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_services_list(self, resource_group): response = self.client.services.list( resource_group_name=resource_group.name, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -331,11 +349,11 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_supported_server_versions(self, resource_group): + async def test_services_list_supported_server_versions(self, resource_group): response = self.client.services.list_supported_server_versions( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_skus_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_skus_operations.py index cdfe991b5f6b..5edbef9d91b8 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_skus_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_skus_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_skus_list(self, resource_group): response = self.client.skus.list( - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_skus_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_skus_operations_async.py index 84ef2fc4e449..f8c92f6738be 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_skus_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_skus_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_skus_list(self, resource_group): response = self.client.skus.list( - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_storages_operations.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_storages_operations.py index 56ddc2fc9a9c..aa9c07e789e5 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_storages_operations.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_storages_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_storages_get(self, resource_group): response = self.client.storages.get( resource_group_name=resource_group.name, service_name="str", storage_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_storages_begin_create_or_update(self, resource_group): response = self.client.storages.begin_create_or_update( resource_group_name=resource_group.name, service_name="str", @@ -52,7 +52,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -60,12 +60,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_storages_begin_delete(self, resource_group): response = self.client.storages.begin_delete( resource_group_name=resource_group.name, service_name="str", storage_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -73,11 +73,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_storages_list(self, resource_group): response = self.client.storages.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_storages_operations_async.py b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_storages_operations_async.py index f88d5975894b..c2b01c40ea3a 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_storages_operations_async.py +++ b/sdk/appplatform/azure-mgmt-appplatform/generated_tests/test_app_platform_management_storages_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_storages_get(self, resource_group): response = await self.client.storages.get( resource_group_name=resource_group.name, service_name="str", storage_name="str", - api_version="2023-12-01", + api_version="2024-05-01-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_storages_begin_create_or_update(self, resource_group): response = await ( await self.client.storages.begin_create_or_update( resource_group_name=resource_group.name, @@ -54,7 +54,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -63,13 +63,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_storages_begin_delete(self, resource_group): response = await ( await self.client.storages.begin_delete( resource_group_name=resource_group.name, service_name="str", storage_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -78,11 +78,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_storages_list(self, resource_group): response = self.client.storages.list( resource_group_name=resource_group.name, service_name="str", - api_version="2023-12-01", + api_version="2024-05-01-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appplatform/azure-mgmt-appplatform/sdk_packaging.toml b/sdk/appplatform/azure-mgmt-appplatform/sdk_packaging.toml index 39069bd9f6d5..7f3f297b06b0 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/sdk_packaging.toml +++ b/sdk/appplatform/azure-mgmt-appplatform/sdk_packaging.toml @@ -3,6 +3,6 @@ package_name = "azure-mgmt-appplatform" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "App Platform Management" package_doc_id = "" -is_stable = true +is_stable = false is_arm = true title = "AppPlatformManagementClient" diff --git a/sdk/appplatform/azure-mgmt-appplatform/setup.py b/sdk/appplatform/azure-mgmt-appplatform/setup.py index 7a26efe84f17..b0552bbfccee 100644 --- a/sdk/appplatform/azure-mgmt-appplatform/setup.py +++ b/sdk/appplatform/azure-mgmt-appplatform/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) @@ -51,11 +49,10 @@ url="https://github.com/Azure/azure-sdk-for-python", keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product classifiers=[ - "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "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", )