From d6d2089ea7228c2363713e4d8d09b2ee8f72b1d8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 29 Nov 2024 06:54:47 +0000 Subject: [PATCH] CodeGen from PR 31543 in Azure/azure-rest-api-specs Merge b9933f6f77779bdd9c747533813f3b4766b4230f into 43ce04961ccb6496e421789c54798ba1e0880f64 --- .../_meta.json | 4 +- .../mgmt/devopsinfrastructure/__init__.py | 10 +- .../mgmt/devopsinfrastructure/_model_base.py | 18 +-- .../devopsinfrastructure/_serialization.py | 14 +- .../mgmt/devopsinfrastructure/_version.py | 2 +- .../mgmt/devopsinfrastructure/aio/__init__.py | 10 +- .../aio/operations/__init__.py | 20 ++- .../aio/operations/_operations.py | 2 +- .../devopsinfrastructure/models/__init__.py | 135 ++++++++++-------- .../devopsinfrastructure/models/_models.py | 85 +++++------ .../operations/__init__.py | 20 ++- .../operations/_operations.py | 2 +- .../generated_samples/list_operations.py | 40 ------ ..._dev_ops_infrastructure_mgmt_operations.py | 27 ---- ...ps_infrastructure_mgmt_operations_async.py | 28 ---- .../azure-mgmt-devopsinfrastructure/setup.py | 8 +- .../tsp-location.yaml | 2 +- 17 files changed, 185 insertions(+), 242 deletions(-) delete mode 100644 sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_operations.py delete mode 100644 sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_operations.py delete mode 100644 sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_operations_async.py diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/_meta.json b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/_meta.json index ed41f8389e46..cf6f589e6af9 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/_meta.json +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/_meta.json @@ -1,6 +1,6 @@ { - "commit": "95e89f00932d2a8f04ff80e28f8ce10ee586ca7d", + "commit": "405438c72094a0a43fbcba18a56aa71110b78db8", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure.Management", - "@azure-tools/typespec-python": "0.36.0" + "@azure-tools/typespec-python": "0.36.5" } \ No newline at end of file diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/__init__.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/__init__.py index 8f06e13ef998..6c010fdec339 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/__init__.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import DevOpsInfrastructureMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import DevOpsInfrastructureMgmtClient # 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 diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_model_base.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_model_base.py index 9d401b0cf012..6a6e1f38b17e 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_model_base.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_model_base.py @@ -5,7 +5,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except, too-many-lines +# pylint: disable=protected-access, broad-except import copy import calendar @@ -574,7 +574,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: def copy(self) -> "Model": return Model(self.__dict__) - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' @@ -585,8 +585,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di annotations = { k: v for mro_class in mros - if hasattr(mro_class, "__annotations__") # pylint: disable=no-member - for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() } for attr, rf in attr_to_rest_field.items(): rf._module = cls.__module__ @@ -601,8 +601,8 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: di def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: - if hasattr(base, "__mapping__"): # pylint: disable=no-member - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore @classmethod def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: @@ -613,7 +613,7 @@ def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField @classmethod def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + if not hasattr(cls, "__mapping__"): return cls(data) discriminator = cls._get_discriminator(exist_discriminators) if discriminator is None: @@ -633,7 +633,7 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: @@ -754,7 +754,7 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except AttributeError: model_name = annotation if module is not None: - annotation = _get_model(module, model_name) + annotation = _get_model(module, model_name) # type: ignore try: if module and _is_model(annotation): diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_serialization.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_serialization.py index 480e941d758f..e2ad51869908 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_serialization.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_serialization.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -506,7 +507,6 @@ def _flatten_subtype(cls, key, objects): 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 @@ -518,7 +518,7 @@ def _classify(cls, response, objects): 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: @@ -1683,17 +1683,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None): subtype = getattr(response, "_subtype_map", {}) try: readonly = [ - k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + 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() if v.get("constant") # pylint: disable=protected-access + 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 diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_version.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_version.py index 0ec13ea52bbf..be71c81bd282 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_version.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/__init__.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/__init__.py index b00102e663c6..483d336333f1 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/__init__.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._client import DevOpsInfrastructureMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import DevOpsInfrastructureMgmtClient # 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 diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/operations/__init__.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/operations/__init__.py index a187f0c9bdbc..025faf189e43 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/operations/__init__.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/operations/__init__.py @@ -5,16 +5,22 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._operations import PoolsOperations -from ._operations import ResourceDetailsOperations -from ._operations import SkuOperations -from ._operations import SubscriptionUsagesOperations -from ._operations import ImageVersionsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import PoolsOperations # type: ignore +from ._operations import ResourceDetailsOperations # type: ignore +from ._operations import SkuOperations # type: ignore +from ._operations import SubscriptionUsagesOperations # type: ignore +from ._operations import ImageVersionsOperations # 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__ = [ diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/operations/_operations.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/operations/_operations.py index 465720a9188e..9ece3da48b7d 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/operations/_operations.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/operations/_operations.py @@ -75,7 +75,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models._models.Operation"]: + def _list(self, **kwargs: Any) -> AsyncIterable["_models._models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/__init__.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/__init__.py index ca241a7c8aeb..b46fe4aaed48 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/__init__.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/__init__.py @@ -5,71 +5,82 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models import AgentProfile -from ._models import AutomaticResourcePredictionsProfile -from ._models import AzureDevOpsOrganizationProfile -from ._models import AzureDevOpsPermissionProfile -from ._models import DataDisk -from ._models import DevOpsAzureSku -from ._models import ErrorAdditionalInfo -from ._models import ErrorDetail -from ._models import ErrorResponse -from ._models import FabricProfile -from ._models import GitHubOrganization -from ._models import GitHubOrganizationProfile -from ._models import ImageVersion -from ._models import ImageVersionProperties -from ._models import ManagedServiceIdentity -from ._models import ManualResourcePredictionsProfile -from ._models import NetworkProfile -from ._models import Organization -from ._models import OrganizationProfile -from ._models import OsProfile -from ._models import Pool -from ._models import PoolImage -from ._models import PoolProperties -from ._models import PoolUpdate -from ._models import PoolUpdateProperties -from ._models import ProxyResource -from ._models import Quota -from ._models import QuotaName -from ._models import Resource -from ._models import ResourceDetailsObject -from ._models import ResourceDetailsObjectProperties -from ._models import ResourcePredictions -from ._models import ResourcePredictionsProfile -from ._models import ResourceSku -from ._models import ResourceSkuCapabilities -from ._models import ResourceSkuLocationInfo -from ._models import ResourceSkuProperties -from ._models import ResourceSkuRestrictionInfo -from ._models import ResourceSkuRestrictions -from ._models import ResourceSkuZoneDetails -from ._models import SecretsManagementSettings -from ._models import Stateful -from ._models import StatelessAgentProfile -from ._models import StorageProfile -from ._models import SystemData -from ._models import TrackedResource -from ._models import UserAssignedIdentity -from ._models import VmssFabricProfile +from typing import TYPE_CHECKING -from ._enums import AzureDevOpsPermissionType -from ._enums import CachingType -from ._enums import CreatedByType -from ._enums import LogonType -from ._enums import ManagedServiceIdentityType -from ._enums import OsDiskStorageAccountType -from ._enums import PredictionPreference -from ._enums import ProvisioningState -from ._enums import ResourcePredictionsProfileType -from ._enums import ResourceSkuRestrictionsReasonCode -from ._enums import ResourceSkuRestrictionsType -from ._enums import ResourceStatus -from ._enums import StorageAccountType +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + AgentProfile, + AutomaticResourcePredictionsProfile, + AzureDevOpsOrganizationProfile, + AzureDevOpsPermissionProfile, + DataDisk, + DevOpsAzureSku, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + FabricProfile, + GitHubOrganization, + GitHubOrganizationProfile, + ImageVersion, + ImageVersionProperties, + ManagedServiceIdentity, + ManualResourcePredictionsProfile, + NetworkProfile, + Organization, + OrganizationProfile, + OsProfile, + Pool, + PoolImage, + PoolProperties, + PoolUpdate, + PoolUpdateProperties, + ProxyResource, + Quota, + QuotaName, + Resource, + ResourceDetailsObject, + ResourceDetailsObjectProperties, + ResourcePredictions, + ResourcePredictionsProfile, + ResourceSku, + ResourceSkuCapabilities, + ResourceSkuLocationInfo, + ResourceSkuProperties, + ResourceSkuRestrictionInfo, + ResourceSkuRestrictions, + ResourceSkuZoneDetails, + SecretsManagementSettings, + Stateful, + StatelessAgentProfile, + StorageProfile, + SystemData, + TrackedResource, + UserAssignedIdentity, + VmssFabricProfile, +) + +from ._enums import ( # type: ignore + AzureDevOpsPermissionType, + CachingType, + CreatedByType, + LogonType, + ManagedServiceIdentityType, + OsDiskStorageAccountType, + PredictionPreference, + ProvisioningState, + ResourcePredictionsProfileType, + ResourceSkuRestrictionsReasonCode, + ResourceSkuRestrictionsType, + ResourceStatus, + StorageAccountType, +) 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__ = [ diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/_models.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/_models.py index c3f6d0644023..afffefbd2b50 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/_models.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/_models.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation import datetime from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload @@ -60,7 +61,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -95,7 +96,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -136,7 +137,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=ResourcePredictionsProfileType.AUTOMATIC, **kwargs) @@ -169,7 +170,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -210,7 +211,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind="AzureDevOps", **kwargs) @@ -251,7 +252,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -307,7 +308,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -336,7 +337,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -413,7 +414,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -446,7 +447,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -480,7 +481,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -514,7 +515,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind="GitHub", **kwargs) @@ -605,7 +606,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -634,7 +635,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -687,7 +688,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -716,7 +717,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind=ResourcePredictionsProfileType.MANUAL, **kwargs) @@ -745,7 +746,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -859,7 +860,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -897,7 +898,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -945,7 +946,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -999,7 +1000,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1043,7 +1044,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1101,7 +1102,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1139,7 +1140,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1195,7 +1196,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1245,7 +1246,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1278,7 +1279,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1319,7 +1320,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1362,7 +1363,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1407,7 +1408,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1441,7 +1442,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1481,7 +1482,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1547,7 +1548,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1580,7 +1581,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1629,7 +1630,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1665,7 +1666,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1705,7 +1706,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1755,7 +1756,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind="Stateful", **kwargs) @@ -1792,7 +1793,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind="Stateless", **kwargs) @@ -1830,7 +1831,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1887,7 +1888,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -1957,5 +1958,5 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: :type mapping: Mapping[str, Any] """ - def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, kind="Vmss", **kwargs) diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/operations/__init__.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/operations/__init__.py index a187f0c9bdbc..025faf189e43 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/operations/__init__.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/operations/__init__.py @@ -5,16 +5,22 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._operations import PoolsOperations -from ._operations import ResourceDetailsOperations -from ._operations import SkuOperations -from ._operations import SubscriptionUsagesOperations -from ._operations import ImageVersionsOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import PoolsOperations # type: ignore +from ._operations import ResourceDetailsOperations # type: ignore +from ._operations import SkuOperations # type: ignore +from ._operations import SubscriptionUsagesOperations # type: ignore +from ._operations import ImageVersionsOperations # 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__ = [ diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/operations/_operations.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/operations/_operations.py index 76e8943e965f..7b4f3932901f 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/operations/_operations.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/operations/_operations.py @@ -359,7 +359,7 @@ def __init__(self, *args, **kwargs): self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models._models.Operation"]: + def _list(self, **kwargs: Any) -> Iterable["_models._models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_operations.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_operations.py deleted file mode 100644 index 9953b51a2180..000000000000 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_operations.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.devopsinfrastructure import DevOpsInfrastructureMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-devopsinfrastructure -# USAGE - python list_operations.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 = DevOpsInfrastructureMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.operations.list() - for item in response: - print(item) - - -# x-ms-original-file: 2024-10-19/ListOperations.json -if __name__ == "__main__": - main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_operations.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_operations.py deleted file mode 100644 index c0d3e99e054f..000000000000 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_operations.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.devopsinfrastructure import DevOpsInfrastructureMgmtClient - -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 TestDevOpsInfrastructureMgmtOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(DevOpsInfrastructureMgmtClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_operations_list(self, resource_group): - response = self.client.operations.list() - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_operations_async.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_operations_async.py deleted file mode 100644 index dff46d754ea3..000000000000 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_operations_async.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.devopsinfrastructure.aio import DevOpsInfrastructureMgmtClient - -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 TestDevOpsInfrastructureMgmtOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(DevOpsInfrastructureMgmtClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_operations_list(self, resource_group): - response = self.client.operations.list() - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/setup.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/setup.py index fd8157cfb80b..63b77eefe01f 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/setup.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/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) diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/tsp-location.yaml b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/tsp-location.yaml index b5833183bd67..f4803f57a951 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/tsp-location.yaml +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure.Management -commit: 95e89f00932d2a8f04ff80e28f8ce10ee586ca7d +commit: 405438c72094a0a43fbcba18a56aa71110b78db8 repo: Azure/azure-rest-api-specs additionalDirectories: