From a885eb3cd37f33a3a1c49d7fbf4fb6b7bd5eb883 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 28 Feb 2025 18:56:07 +0000 Subject: [PATCH] CodeGen from PR 32741 in Azure/azure-rest-api-specs Merge 59699e9c7a7febd7e16a01e59e948b4241d812cf into 69339d9098a3110738a872aa0326246670f0b3f1 --- .../_meta.json | 4 +- .../apiview-properties.json | 89 +++ .../mgmt/devopsinfrastructure/__init__.py | 10 +- .../mgmt/devopsinfrastructure/_client.py | 2 +- .../devopsinfrastructure/_configuration.py | 4 +- .../mgmt/devopsinfrastructure/_model_base.py | 94 ++- .../devopsinfrastructure/_serialization.py | 168 ++--- .../mgmt/devopsinfrastructure/_version.py | 2 +- .../mgmt/devopsinfrastructure/aio/__init__.py | 10 +- .../mgmt/devopsinfrastructure/aio/_client.py | 2 +- .../aio/_configuration.py | 4 +- .../aio/operations/__init__.py | 20 +- .../aio/operations/_operations.py | 222 +++++-- .../devopsinfrastructure/models/__init__.py | 157 +++-- .../devopsinfrastructure/models/_enums.py | 45 ++ .../devopsinfrastructure/models/_models.py | 579 +++++++++++++----- .../operations/__init__.py | 20 +- .../operations/_operations.py | 289 +++++++-- .../create_or_update_pool.py | 19 +- .../generated_samples/delete_pool.py | 2 +- .../generated_samples/get_pool.py | 2 +- .../image_versions_list_by_image.py | 2 +- .../generated_samples/list_operations.py | 2 +- .../list_pools_by_subscription.py | 2 +- ...ools_by_subscription_and_resource_group.py | 2 +- .../pools_check_name_availability.py | 41 ++ .../resource_details_list_by_pool.py | 2 +- .../generated_samples/sku_list_by_location.py | 2 +- .../subscription_usages_usages.py | 2 +- ...ps_infrastructure_mgmt_pools_operations.py | 10 + ...rastructure_mgmt_pools_operations_async.py | 10 + .../azure-mgmt-devopsinfrastructure/setup.py | 8 +- .../tsp-location.yaml | 2 +- 33 files changed, 1331 insertions(+), 498 deletions(-) create mode 100644 sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/apiview-properties.json create mode 100644 sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/pools_check_name_availability.py diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/_meta.json b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/_meta.json index ed41f8389e46..b9990f8f8948 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/_meta.json +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/_meta.json @@ -1,6 +1,6 @@ { - "commit": "95e89f00932d2a8f04ff80e28f8ce10ee586ca7d", + "commit": "3350b3c1fe16b906adc33891c41ef8ace067c3dd", "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.38.4" } \ No newline at end of file diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/apiview-properties.json b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/apiview-properties.json new file mode 100644 index 000000000000..9c37fe72f899 --- /dev/null +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/apiview-properties.json @@ -0,0 +1,89 @@ +{ + "CrossLanguagePackageId": "Microsoft.DevOpsInfrastructure", + "CrossLanguageDefinitionId": { + "azure.mgmt.devopsinfrastructure.models.AgentProfile": "Microsoft.DevOpsInfrastructure.AgentProfile", + "azure.mgmt.devopsinfrastructure.models.ResourcePredictionsProfile": "Microsoft.DevOpsInfrastructure.ResourcePredictionsProfile", + "azure.mgmt.devopsinfrastructure.models.AutomaticResourcePredictionsProfile": "Microsoft.DevOpsInfrastructure.AutomaticResourcePredictionsProfile", + "azure.mgmt.devopsinfrastructure.models.OrganizationProfile": "Microsoft.DevOpsInfrastructure.OrganizationProfile", + "azure.mgmt.devopsinfrastructure.models.AzureDevOpsOrganizationProfile": "Microsoft.DevOpsInfrastructure.AzureDevOpsOrganizationProfile", + "azure.mgmt.devopsinfrastructure.models.AzureDevOpsPermissionProfile": "Microsoft.DevOpsInfrastructure.AzureDevOpsPermissionProfile", + "azure.mgmt.devopsinfrastructure.models.CheckNameAvailability": "Microsoft.DevOpsInfrastructure.CheckNameAvailability", + "azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityResult": "Microsoft.DevOpsInfrastructure.CheckNameAvailabilityResult", + "azure.mgmt.devopsinfrastructure.models.DataDisk": "Microsoft.DevOpsInfrastructure.DataDisk", + "azure.mgmt.devopsinfrastructure.models.DevOpsAzureSku": "Microsoft.DevOpsInfrastructure.DevOpsAzureSku", + "azure.mgmt.devopsinfrastructure.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.devopsinfrastructure.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.devopsinfrastructure.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.devopsinfrastructure.models.FabricProfile": "Microsoft.DevOpsInfrastructure.FabricProfile", + "azure.mgmt.devopsinfrastructure.models.GitHubOrganization": "Microsoft.DevOpsInfrastructure.GitHubOrganization", + "azure.mgmt.devopsinfrastructure.models.GitHubOrganizationProfile": "Microsoft.DevOpsInfrastructure.GitHubOrganizationProfile", + "azure.mgmt.devopsinfrastructure.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.devopsinfrastructure.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.devopsinfrastructure.models.ImageVersion": "Microsoft.DevOpsInfrastructure.ImageVersion", + "azure.mgmt.devopsinfrastructure.models.ImageVersionProperties": "Microsoft.DevOpsInfrastructure.ImageVersionProperties", + "azure.mgmt.devopsinfrastructure.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "azure.mgmt.devopsinfrastructure.models.ManualResourcePredictionsProfile": "Microsoft.DevOpsInfrastructure.ManualResourcePredictionsProfile", + "azure.mgmt.devopsinfrastructure.models.NetworkProfile": "Microsoft.DevOpsInfrastructure.NetworkProfile", + "azure.mgmt.devopsinfrastructure.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.devopsinfrastructure.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.devopsinfrastructure.models.Organization": "Microsoft.DevOpsInfrastructure.Organization", + "azure.mgmt.devopsinfrastructure.models.OsProfile": "Microsoft.DevOpsInfrastructure.OsProfile", + "azure.mgmt.devopsinfrastructure.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.devopsinfrastructure.models.Pool": "Microsoft.DevOpsInfrastructure.Pool", + "azure.mgmt.devopsinfrastructure.models.PoolImage": "Microsoft.DevOpsInfrastructure.PoolImage", + "azure.mgmt.devopsinfrastructure.models.PoolProperties": "Microsoft.DevOpsInfrastructure.PoolProperties", + "azure.mgmt.devopsinfrastructure.models.PoolUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.devopsinfrastructure.models.PoolUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.devopsinfrastructure.models.Quota": "Microsoft.DevOpsInfrastructure.Quota", + "azure.mgmt.devopsinfrastructure.models.QuotaName": "Microsoft.DevOpsInfrastructure.QuotaName", + "azure.mgmt.devopsinfrastructure.models.ResourceDetailsObject": "Microsoft.DevOpsInfrastructure.ResourceDetailsObject", + "azure.mgmt.devopsinfrastructure.models.ResourceDetailsObjectProperties": "Microsoft.DevOpsInfrastructure.ResourceDetailsObjectProperties", + "azure.mgmt.devopsinfrastructure.models.ResourcePredictions": "Microsoft.DevOpsInfrastructure.ResourcePredictions", + "azure.mgmt.devopsinfrastructure.models.ResourceSku": "Microsoft.DevOpsInfrastructure.ResourceSku", + "azure.mgmt.devopsinfrastructure.models.ResourceSkuCapabilities": "Microsoft.DevOpsInfrastructure.ResourceSkuCapabilities", + "azure.mgmt.devopsinfrastructure.models.ResourceSkuLocationInfo": "Microsoft.DevOpsInfrastructure.ResourceSkuLocationInfo", + "azure.mgmt.devopsinfrastructure.models.ResourceSkuProperties": "Microsoft.DevOpsInfrastructure.ResourceSkuProperties", + "azure.mgmt.devopsinfrastructure.models.ResourceSkuRestrictionInfo": "Microsoft.DevOpsInfrastructure.ResourceSkuRestrictionInfo", + "azure.mgmt.devopsinfrastructure.models.ResourceSkuRestrictions": "Microsoft.DevOpsInfrastructure.ResourceSkuRestrictions", + "azure.mgmt.devopsinfrastructure.models.ResourceSkuZoneDetails": "Microsoft.DevOpsInfrastructure.ResourceSkuZoneDetails", + "azure.mgmt.devopsinfrastructure.models.SecretsManagementSettings": "Microsoft.DevOpsInfrastructure.SecretsManagementSettings", + "azure.mgmt.devopsinfrastructure.models.Stateful": "Microsoft.DevOpsInfrastructure.Stateful", + "azure.mgmt.devopsinfrastructure.models.StatelessAgentProfile": "Microsoft.DevOpsInfrastructure.StatelessAgentProfile", + "azure.mgmt.devopsinfrastructure.models.StorageProfile": "Microsoft.DevOpsInfrastructure.StorageProfile", + "azure.mgmt.devopsinfrastructure.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.devopsinfrastructure.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "azure.mgmt.devopsinfrastructure.models.VmssFabricProfile": "Microsoft.DevOpsInfrastructure.VmssFabricProfile", + "azure.mgmt.devopsinfrastructure.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.devopsinfrastructure.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.devopsinfrastructure.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.devopsinfrastructure.models.ProvisioningState": "Microsoft.DevOpsInfrastructure.ProvisioningState", + "azure.mgmt.devopsinfrastructure.models.AzureDevOpsPermissionType": "Microsoft.DevOpsInfrastructure.AzureDevOpsPermissionType", + "azure.mgmt.devopsinfrastructure.models.ResourcePredictionsProfileType": "Microsoft.DevOpsInfrastructure.ResourcePredictionsProfileType", + "azure.mgmt.devopsinfrastructure.models.PredictionPreference": "Microsoft.DevOpsInfrastructure.PredictionPreference", + "azure.mgmt.devopsinfrastructure.models.EphemeralType": "Microsoft.DevOpsInfrastructure.EphemeralType", + "azure.mgmt.devopsinfrastructure.models.CertificateStoreNameOption": "Microsoft.DevOpsInfrastructure.CertificateStoreNameOption", + "azure.mgmt.devopsinfrastructure.models.LogonType": "Microsoft.DevOpsInfrastructure.LogonType", + "azure.mgmt.devopsinfrastructure.models.OsDiskStorageAccountType": "Microsoft.DevOpsInfrastructure.OsDiskStorageAccountType", + "azure.mgmt.devopsinfrastructure.models.CachingType": "Microsoft.DevOpsInfrastructure.CachingType", + "azure.mgmt.devopsinfrastructure.models.StorageAccountType": "Microsoft.DevOpsInfrastructure.StorageAccountType", + "azure.mgmt.devopsinfrastructure.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "azure.mgmt.devopsinfrastructure.models.AvailabilityStatus": "Microsoft.DevOpsInfrastructure.AvailabilityStatus", + "azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityReason": "Microsoft.DevOpsInfrastructure.CheckNameAvailabilityReason", + "azure.mgmt.devopsinfrastructure.models.DevOpsInfrastructureResourceType": "Microsoft.DevOpsInfrastructure.DevOpsInfrastructureResourceType", + "azure.mgmt.devopsinfrastructure.models.ResourceStatus": "Microsoft.DevOpsInfrastructure.ResourceStatus", + "azure.mgmt.devopsinfrastructure.models.ResourceSkuRestrictionsType": "Microsoft.DevOpsInfrastructure.ResourceSkuRestrictionsType", + "azure.mgmt.devopsinfrastructure.models.ResourceSkuRestrictionsReasonCode": "Microsoft.DevOpsInfrastructure.ResourceSkuRestrictionsReasonCode", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.pools.get": "Microsoft.DevOpsInfrastructure.Pools.get", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.pools.begin_create_or_update": "Microsoft.DevOpsInfrastructure.Pools.createOrUpdate", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.pools.begin_update": "Microsoft.DevOpsInfrastructure.Pools.update", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.pools.begin_delete": "Microsoft.DevOpsInfrastructure.Pools.delete", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.pools.list_by_resource_group": "Microsoft.DevOpsInfrastructure.Pools.listByResourceGroup", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.pools.list_by_subscription": "Microsoft.DevOpsInfrastructure.Pools.listBySubscription", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.pools.check_name_availability": "Microsoft.DevOpsInfrastructure.Pools.checkNameAvailability", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.resource_details.list_by_pool": "Microsoft.DevOpsInfrastructure.ResourceDetails.listByPool", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.sku.list_by_location": "Microsoft.DevOpsInfrastructure.Sku.listByLocation", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.subscription_usages.usages": "Microsoft.DevOpsInfrastructure.SubscriptionUsages.usages", + "azure.mgmt.devopsinfrastructure.DevOpsInfrastructureMgmtClient.image_versions.list_by_image": "Microsoft.DevOpsInfrastructure.ImageVersions.listByImage" + } +} \ 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/_client.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_client.py index 11a34eacbf5d..1f1add923a3e 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_client.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_client.py @@ -52,7 +52,7 @@ class DevOpsInfrastructureMgmtClient: :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-10-19". + :keyword api_version: The API version to use for this operation. Default value is "2025-01-21". 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 diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_configuration.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_configuration.py index fa50fa2e2787..b9ad9af75677 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_configuration.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_configuration.py @@ -29,7 +29,7 @@ class DevOpsInfrastructureMgmtClientConfiguration: # pylint: disable=too-many-i :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-10-19". + :keyword api_version: The API version to use for this operation. Default value is "2025-01-21". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -41,7 +41,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-10-19") + api_version: str = kwargs.pop("api_version", "2025-01-21") if credential is None: raise ValueError("Parameter 'credential' must not be None.") 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..3072ee252ed9 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 @@ -373,15 +373,34 @@ def __ne__(self, other: typing.Any) -> bool: return not self.__eq__(other) def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ return self._data.items() def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ try: return self[key] except KeyError: @@ -397,17 +416,38 @@ def pop(self, key: str, default: _T) -> _T: ... def pop(self, key: str, default: typing.Any) -> typing.Any: ... def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ if default is _UNSET: return self._data.pop(key) return self._data.pop(key, default) def popitem(self) -> typing.Tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ return self._data.popitem() def clear(self) -> None: + """ + Remove all items from D. + """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ self._data.update(*args, **kwargs) @typing.overload @@ -417,6 +457,13 @@ def setdefault(self, key: str, default: None = None) -> None: ... def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ if default is _UNSET: return self._data.setdefault(key) return self._data.setdefault(key, default) @@ -574,7 +621,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 +632,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 +648,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 +660,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 +680,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 +801,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): @@ -894,6 +941,35 @@ def _deserialize( return _deserialize_with_callable(deserializer, value) +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + value: typing.Any, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, value) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + class _RestField: def __init__( self, 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..e2a20b1d534c 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=line-too-long,useless-suppression,too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,9 +48,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, ) @@ -60,13 +59,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] @@ -184,73 +183,7 @@ 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. - - :param datetime.datetime dt: The datetime - :returns: The offset - :rtype: datetime.timedelta - """ - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation. - - :param datetime.datetime dt: The datetime - :returns: The timestamp representation - :rtype: str - """ - return "Z" - - def dst(self, dt): - """No daylight saving for UTC. - - :param datetime.datetime dt: The datetime - :returns: The daylight saving time - :rtype: datetime.timedelta - """ - 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) -> None: - 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"(? 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 - :rtype: ModelType + :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 @@ -479,7 +412,7 @@ def from_dict( :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong - :rtype: ModelType + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -506,7 +439,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 +450,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: @@ -563,7 +495,7 @@ def _decode_attribute_map_key(key): return key.replace("\\.", ".") -class Serializer(object): # pylint: disable=too-many-public-methods +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -626,7 +558,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to :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) @@ -736,8 +668,8 @@ def body(self, data, data_type, **kwargs): :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 """ @@ -781,8 +713,8 @@ def url(self, name, data, data_type, **kwargs): :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -805,8 +737,8 @@ def query(self, name, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :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: @@ -835,8 +767,8 @@ def header(self, name, data, data_type, **kwargs): :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: @@ -855,9 +787,9 @@ def serialize_data(self, data, data_type, **kwargs): :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :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 """ @@ -1192,7 +1124,7 @@ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. :return: serialized rfc """ try: @@ -1218,7 +1150,7 @@ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument :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): @@ -1251,7 +1183,7 @@ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument :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): @@ -1429,7 +1361,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument # 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( # pylint: disable=line-too-long + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( xml_name ) ) @@ -1441,7 +1373,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1488,7 +1420,7 @@ 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 """ @@ -1502,7 +1434,7 @@ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return :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 """ @@ -1683,17 +1615,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 @@ -1713,7 +1649,7 @@ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return- :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 """ @@ -1795,7 +1731,7 @@ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return :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 @@ -1841,7 +1777,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :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 @@ -1932,7 +1868,7 @@ def deserialize_bytearray(attr): :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 @@ -1945,7 +1881,7 @@ def deserialize_base64(attr): :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 @@ -1960,7 +1896,7 @@ def deserialize_decimal(attr): :param str attr: response string to be deserialized. :return: Deserialized decimal - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. :rtype: decimal """ if isinstance(attr, ET.Element): @@ -1978,7 +1914,7 @@ def deserialize_long(attr): :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 @@ -1991,7 +1927,7 @@ def deserialize_duration(attr): :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 @@ -2009,7 +1945,7 @@ def deserialize_date(attr): :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 @@ -2025,7 +1961,7 @@ def deserialize_time(attr): :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 @@ -2040,14 +1976,14 @@ def deserialize_rfc(attr): :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) @@ -2063,7 +1999,7 @@ def deserialize_iso(attr): :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 @@ -2101,7 +2037,7 @@ def deserialize_unix(attr): :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 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/_client.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/_client.py index 5e145bf72751..90f682019bfe 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/_client.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/_client.py @@ -53,7 +53,7 @@ class DevOpsInfrastructureMgmtClient: :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-10-19". + :keyword api_version: The API version to use for this operation. Default value is "2025-01-21". 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 diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/_configuration.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/_configuration.py index 909992c5c979..5f439c514215 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/_configuration.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/aio/_configuration.py @@ -29,7 +29,7 @@ class DevOpsInfrastructureMgmtClientConfiguration: # pylint: disable=too-many-i :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-10-19". + :keyword api_version: The API version to use for this operation. Default value is "2025-01-21". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -41,7 +41,7 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-10-19") + api_version: str = kwargs.pop("api_version", "2025-01-21") if credential is None: raise ValueError("Parameter 'credential' must not be None.") 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..7347414ead96 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 @@ -12,6 +12,7 @@ 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, @@ -33,10 +34,12 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize +from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._serialization import Deserializer, Serializer from ...operations._operations import ( build_image_versions_list_by_image_request, build_operations_list_request, + build_pools_check_name_availability_request, build_pools_create_or_update_request, build_pools_delete_request, build_pools_get_request, @@ -47,6 +50,7 @@ build_sku_list_by_location_request, build_subscription_usages_usages_request, ) +from .._configuration import DevOpsInfrastructureMgmtClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -69,24 +73,26 @@ 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: DevOpsInfrastructureMgmtClientConfiguration = ( + 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._models.Operation"]: + def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devopsinfrastructure.models._models.Operation] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devopsinfrastructure.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models._models.Operation]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -135,7 +141,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models._models.Operation], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -151,7 +157,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -171,10 +177,12 @@ class PoolsOperations: 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: DevOpsInfrastructureMgmtClientConfiguration = ( + 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, pool_name: str, **kwargs: Any) -> _models.Pool: @@ -229,7 +237,7 @@ async def get(self, resource_group_name: str, pool_name: str, **kwargs: Any) -> except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -294,7 +302,7 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -519,7 +527,7 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -733,7 +741,7 @@ async def _delete_initial(self, resource_group_name: str, pool_name: str, **kwar except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -886,7 +894,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -970,13 +978,139 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + @overload + async def check_name_availability( + self, body: _models.CheckNameAvailability, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResult: + """Checks that the pool name is valid and is not already in use. + + :param body: The CheckAvailability request. Required. + :type body: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailability + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckNameAvailabilityResult. The CheckNameAvailabilityResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_name_availability( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResult: + """Checks that the pool name is valid and is not already in use. + + :param body: The CheckAvailability request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckNameAvailabilityResult. The CheckNameAvailabilityResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_name_availability( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResult: + """Checks that the pool name is valid and is not already in use. + + :param body: The CheckAvailability request. Required. + :type body: 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: CheckNameAvailabilityResult. The CheckNameAvailabilityResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def check_name_availability( + self, body: Union[_models.CheckNameAvailability, JSON, IO[bytes]], **kwargs: Any + ) -> _models.CheckNameAvailabilityResult: + """Checks that the pool name is valid and is not already in use. + + :param body: The CheckAvailability request. Is one of the following types: + CheckNameAvailability, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailability or JSON or IO[bytes] + :return: CheckNameAvailabilityResult. The CheckNameAvailabilityResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pools_check_name_availability_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("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]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.CheckNameAvailabilityResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + class ResourceDetailsOperations: """ @@ -990,10 +1124,12 @@ class ResourceDetailsOperations: 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: DevOpsInfrastructureMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_pool( @@ -1082,7 +1218,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1102,10 +1238,12 @@ class SkuOperations: 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: DevOpsInfrastructureMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: @@ -1188,7 +1326,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1208,10 +1346,12 @@ class SubscriptionUsagesOperations: 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: DevOpsInfrastructureMgmtClientConfiguration = ( + 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 usages(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Quota"]: @@ -1293,7 +1433,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1313,10 +1453,12 @@ class ImageVersionsOperations: 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: DevOpsInfrastructureMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_image( @@ -1405,7 +1547,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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..07fe9a305eeb 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,93 @@ # 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, + CheckNameAvailability, + CheckNameAvailabilityResult, + DataDisk, + DevOpsAzureSku, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + FabricProfile, + GitHubOrganization, + GitHubOrganizationProfile, + ImageVersion, + ImageVersionProperties, + ManagedServiceIdentity, + ManualResourcePredictionsProfile, + NetworkProfile, + Operation, + OperationDisplay, + 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 + ActionType, + AvailabilityStatus, + AzureDevOpsPermissionType, + CachingType, + CertificateStoreNameOption, + CheckNameAvailabilityReason, + CreatedByType, + DevOpsInfrastructureResourceType, + EphemeralType, + LogonType, + ManagedServiceIdentityType, + Origin, + 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__ = [ @@ -77,6 +99,8 @@ "AutomaticResourcePredictionsProfile", "AzureDevOpsOrganizationProfile", "AzureDevOpsPermissionProfile", + "CheckNameAvailability", + "CheckNameAvailabilityResult", "DataDisk", "DevOpsAzureSku", "ErrorAdditionalInfo", @@ -90,6 +114,8 @@ "ManagedServiceIdentity", "ManualResourcePredictionsProfile", "NetworkProfile", + "Operation", + "OperationDisplay", "Organization", "OrganizationProfile", "OsProfile", @@ -121,11 +147,18 @@ "TrackedResource", "UserAssignedIdentity", "VmssFabricProfile", + "ActionType", + "AvailabilityStatus", "AzureDevOpsPermissionType", "CachingType", + "CertificateStoreNameOption", + "CheckNameAvailabilityReason", "CreatedByType", + "DevOpsInfrastructureResourceType", + "EphemeralType", "LogonType", "ManagedServiceIdentityType", + "Origin", "OsDiskStorageAccountType", "PredictionPreference", "ProvisioningState", diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/_enums.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/_enums.py index 4cc4b621cdc8..fc1234b6f939 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/_enums.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/models/_enums.py @@ -19,6 +19,15 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Actions are for internal-only APIs.""" +class AvailabilityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """AvailabilityStatus of a name.""" + + AVAILABLE = "Available" + """The name is available.""" + UNAVAILABLE = "Unavailable" + """The name is unavailable""" + + class AzureDevOpsPermissionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Determines who has admin permissions to the Azure DevOps pool.""" @@ -41,6 +50,24 @@ class CachingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """For workloads that do a balance of read and write operations.""" +class CertificateStoreNameOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The certificate store name type.""" + + MY = "My" + """The X.509 certificate store for personal certificates.""" + ROOT = "Root" + """The X.509 certificate store for trusted root certificate authorities (CAs).""" + + +class CheckNameAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The reason code explaining why the name is unavailable. Will be null if the name is available.""" + + INVALID = "Invalid" + """The name is invalid.""" + ALREADY_EXISTS = "AlreadyExists" + """The name already exists.""" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The kind of entity that created the resource.""" @@ -54,6 +81,24 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The entity was created by a key.""" +class DevOpsInfrastructureResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of resource.""" + + MICROSOFT_DEV_OPS_INFRASTRUCTURE_POOLS = "Microsoft.DevOpsInfrastructure/pools" + """DevOpsInfrastructure pool resource.""" + + +class EphemeralType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of Ephemeral option the pool will use on underlying VMs when loading this image.""" + + AUTOMATIC = "Automatic" + """Ephemeral is handled by Managed DevOps Pools service.""" + CACHE_DISK = "CacheDisk" + """CacheDisk ephemeral only, requires that the SKU has a cache that is large enough for the image.""" + RESOURCE_DISK = "ResourceDisk" + """ResourceDisk ephemeral only, requires only that the SKU supports it.""" + + class LogonType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Determines how the service should be run.""" 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..462f5294bbae 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -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 @@ -37,10 +38,12 @@ class AgentProfile(_model_base.Model): __mapping__: Dict[str, _model_base.Model] = {} kind: str = rest_discriminator(name="kind") """Discriminator property for AgentProfile. Required. Default value is None.""" - resource_predictions: Optional["_models.ResourcePredictions"] = rest_field(name="resourcePredictions") + resource_predictions: Optional["_models.ResourcePredictions"] = rest_field( + name="resourcePredictions", visibility=["read", "create", "update", "delete", "query"] + ) """Defines pool buffer/stand-by agents.""" resource_predictions_profile: Optional["_models.ResourcePredictionsProfile"] = rest_field( - name="resourcePredictionsProfile" + name="resourcePredictionsProfile", visibility=["read", "create", "update", "delete", "query"] ) """Defines how the pool buffer/stand-by agents is provided.""" @@ -60,7 +63,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) @@ -77,7 +80,7 @@ class ResourcePredictionsProfile(_model_base.Model): """ __mapping__: Dict[str, _model_base.Model] = {} - kind: str = rest_discriminator(name="kind") + kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) """Determines how the stand-by scheme should be provided. Required. Known values are: \"Manual\" and \"Automatic\".""" @@ -95,7 +98,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) @@ -113,11 +116,11 @@ class AutomaticResourcePredictionsProfile(ResourcePredictionsProfile, discrimina ~azure.mgmt.devopsinfrastructure.models.PredictionPreference """ - kind: Literal[ResourcePredictionsProfileType.AUTOMATIC] = rest_discriminator(name="kind") # type: ignore + kind: Literal[ResourcePredictionsProfileType.AUTOMATIC] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The stand-by agent scheme is determined based on historical demand. Required. The stand-by agent scheme is determined based on historical demand.""" prediction_preference: Optional[Union[str, "_models.PredictionPreference"]] = rest_field( - name="predictionPreference" + name="predictionPreference", visibility=["read", "create", "update", "delete", "query"] ) """Determines the balance between cost and performance. Known values are: \"Balanced\", \"MostCostEffective\", \"MoreCostEffective\", \"MorePerformance\", and \"BestPerformance\".""" @@ -136,7 +139,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 +172,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) @@ -188,11 +191,13 @@ class AzureDevOpsOrganizationProfile(OrganizationProfile, discriminator="AzureDe ~azure.mgmt.devopsinfrastructure.models.AzureDevOpsPermissionProfile """ - kind: Literal["AzureDevOps"] = rest_discriminator(name="kind") # type: ignore + kind: Literal["AzureDevOps"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Azure DevOps organization profile. Required. Default value is \"AzureDevOps\".""" - organizations: List["_models.Organization"] = rest_field() + organizations: List["_models.Organization"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The list of Azure DevOps organizations the pool should be present in. Required.""" - permission_profile: Optional["_models.AzureDevOpsPermissionProfile"] = rest_field(name="permissionProfile") + permission_profile: Optional["_models.AzureDevOpsPermissionProfile"] = rest_field( + name="permissionProfile", visibility=["read", "create", "update", "delete", "query"] + ) """The type of permission which determines which accounts are admins on the Azure DevOps pool.""" @overload @@ -210,7 +215,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) @@ -227,12 +232,14 @@ class AzureDevOpsPermissionProfile(_model_base.Model): :vartype groups: list[str] """ - kind: Union[str, "_models.AzureDevOpsPermissionType"] = rest_field() + kind: Union[str, "_models.AzureDevOpsPermissionType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Determines who has admin permissions to the Azure DevOps pool. Required. Known values are: \"Inherit\", \"CreatorOnly\", and \"SpecificAccounts\".""" - users: Optional[List[str]] = rest_field() + users: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """User email addresses.""" - groups: Optional[List[str]] = rest_field() + groups: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Group email addresses.""" @overload @@ -251,7 +258,99 @@ 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) + + +class CheckNameAvailability(_model_base.Model): + """The parameters used to check the availability of a resource. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the resource. Required. + :vartype name: str + :ivar type: The type of resource that is used as the scope of the availability check. Required. + "Microsoft.DevOpsInfrastructure/pools" + :vartype type: str or ~azure.mgmt.devopsinfrastructure.models.DevOpsInfrastructureResourceType + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the resource. Required.""" + type: Union[str, "_models.DevOpsInfrastructureResourceType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of resource that is used as the scope of the availability check. Required. + \"Microsoft.DevOpsInfrastructure/pools\"""" + + @overload + def __init__( + self, + *, + name: str, + type: Union[str, "_models.DevOpsInfrastructureResourceType"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CheckNameAvailabilityResult(_model_base.Model): + """The CheckNameAvailability operation response. + + + :ivar available: Availability status of the name. Required. Known values are: "Available" and + "Unavailable". + :vartype available: str or ~azure.mgmt.devopsinfrastructure.models.AvailabilityStatus + :ivar message: A message explaining why the name is unavailable. Will be null if the name is + available. Required. + :vartype message: str + :ivar name: The name whose availability was checked. Required. + :vartype name: str + :ivar reason: The reason code explaining why the name is unavailable. Will be null if the name + is available. Required. Known values are: "Invalid" and "AlreadyExists". + :vartype reason: str or ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityReason + """ + + available: Union[str, "_models.AvailabilityStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Availability status of the name. Required. Known values are: \"Available\" and \"Unavailable\".""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A message explaining why the name is unavailable. Will be null if the name is available. + Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name whose availability was checked. Required.""" + reason: Union[str, "_models.CheckNameAvailabilityReason"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The reason code explaining why the name is unavailable. Will be null if the name is available. + Required. Known values are: \"Invalid\" and \"AlreadyExists\".""" + + @overload + def __init__( + self, + *, + available: Union[str, "_models.AvailabilityStatus"], + message: str, + name: str, + reason: Union[str, "_models.CheckNameAvailabilityReason"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @@ -275,18 +374,26 @@ class DataDisk(_model_base.Model): :vartype drive_letter: str """ - caching: Optional[Union[str, "_models.CachingType"]] = rest_field() + caching: Optional[Union[str, "_models.CachingType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The type of caching to be enabled for the data disks. The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Known values are: \"None\", \"ReadOnly\", and \"ReadWrite\".""" - disk_size_gi_b: Optional[int] = rest_field(name="diskSizeGiB") + disk_size_gi_b: Optional[int] = rest_field( + name="diskSizeGiB", visibility=["read", "create", "update", "delete", "query"] + ) """The initial disk size in gigabytes.""" - storage_account_type: Optional[Union[str, "_models.StorageAccountType"]] = rest_field(name="storageAccountType") + storage_account_type: Optional[Union[str, "_models.StorageAccountType"]] = rest_field( + name="storageAccountType", visibility=["read", "create", "update", "delete", "query"] + ) """The storage Account type to be used for the data disk. If omitted, the default is \"standard_lrs\". Known values are: \"Standard_LRS\", \"Premium_LRS\", \"StandardSSD_LRS\", \"Premium_ZRS\", and \"StandardSSD_ZRS\".""" - drive_letter: Optional[str] = rest_field(name="driveLetter") + drive_letter: Optional[str] = rest_field( + name="driveLetter", visibility=["read", "create", "update", "delete", "query"] + ) """The drive letter for the empty data disk. If not specified, it will be the first available letter.""" @@ -307,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) @@ -319,7 +426,7 @@ class DevOpsAzureSku(_model_base.Model): :vartype name: str """ - name: str = rest_field() + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The Azure SKU name of the machines in the pool. Required.""" @overload @@ -336,7 +443,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) @@ -396,7 +503,7 @@ class ErrorResponse(_model_base.Model): :vartype error: ~azure.mgmt.devopsinfrastructure.models.ErrorDetail """ - error: Optional["_models.ErrorDetail"] = rest_field() + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The error object.""" @overload @@ -413,7 +520,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 +553,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) @@ -460,9 +567,9 @@ class GitHubOrganization(_model_base.Model): :vartype repositories: list[str] """ - url: str = rest_field() + url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The GitHub organization URL in which the pool should be created. Required.""" - repositories: Optional[List[str]] = rest_field() + repositories: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Optional list of repositories in which the pool should be created.""" @overload @@ -480,7 +587,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) @@ -495,9 +602,11 @@ class GitHubOrganizationProfile(OrganizationProfile, discriminator="GitHub"): :vartype organizations: list[~azure.mgmt.devopsinfrastructure.models.GitHubOrganization] """ - kind: Literal["GitHub"] = rest_discriminator(name="kind") # type: ignore + kind: Literal["GitHub"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """GitHub organization profile. Required. Default value is \"GitHub\".""" - organizations: List["_models.GitHubOrganization"] = rest_field() + organizations: List["_models.GitHubOrganization"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The list of GitHub organizations/repositories the pool should be present in. Required.""" @overload @@ -514,7 +623,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) @@ -524,7 +633,7 @@ class Resource(_model_base.Model): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -538,7 +647,7 @@ class Resource(_model_base.Model): id: Optional[str] = rest_field(visibility=["read"]) """Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long""" + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" name: Optional[str] = rest_field(visibility=["read"]) """The name of the resource.""" type: Optional[str] = rest_field(visibility=["read"]) @@ -555,7 +664,7 @@ class ProxyResource(Resource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -574,7 +683,7 @@ class ImageVersion(ProxyResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -588,7 +697,9 @@ class ImageVersion(ProxyResource): :vartype properties: ~azure.mgmt.devopsinfrastructure.models.ImageVersionProperties """ - properties: Optional["_models.ImageVersionProperties"] = rest_field() + properties: Optional["_models.ImageVersionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -605,7 +716,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) @@ -617,7 +728,7 @@ class ImageVersionProperties(_model_base.Model): :vartype version: str """ - version: str = rest_field() + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Version of the image. Required.""" @overload @@ -634,7 +745,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) @@ -664,11 +775,13 @@ class ManagedServiceIdentity(_model_base.Model): tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) """The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.""" - type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field() + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The type of managed identity assigned to this resource. Required. Known values are: \"None\", \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = rest_field( - name="userAssignedIdentities" + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] ) """The identities assigned to this resource by the user.""" @@ -687,7 +800,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) @@ -700,7 +813,7 @@ class ManualResourcePredictionsProfile(ResourcePredictionsProfile, discriminator :vartype kind: str or ~azure.mgmt.devopsinfrastructure.models.MANUAL """ - kind: Literal[ResourcePredictionsProfileType.MANUAL] = rest_discriminator(name="kind") # type: ignore + kind: Literal[ResourcePredictionsProfileType.MANUAL] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Customer provides the stand-by agent scheme. Required. Customer provides the stand-by agent scheme.""" @@ -716,7 +829,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) @@ -728,7 +841,7 @@ class NetworkProfile(_model_base.Model): :vartype subnet_id: str """ - subnet_id: str = rest_field(name="subnetId") + subnet_id: str = rest_field(name="subnetId", visibility=["read", "create", "update", "delete", "query"]) """The subnet id on which to put all machines created in the pool. Required.""" @overload @@ -745,7 +858,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) @@ -761,7 +874,7 @@ class Operation(_model_base.Model): data-plane operations and "false" for Azure Resource Manager/control-plane operations. :vartype is_data_action: bool :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.devopsinfrastructure.models._models.OperationDisplay + :vartype display: ~azure.mgmt.devopsinfrastructure.models.OperationDisplay :ivar origin: The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", and "user,system". @@ -778,16 +891,35 @@ class Operation(_model_base.Model): is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.""" - display: Optional["_models._models.OperationDisplay"] = rest_field(visibility=["read"]) + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Localized display information for this particular operation.""" - origin: Optional[Union[str, "_models._enums.Origin"]] = rest_field(visibility=["read"]) + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and \"user,system\".""" - action_type: Optional[Union[str, "_models._enums.ActionType"]] = rest_field(name="actionType") + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. \"Internal\"""" + @overload + def __init__( + self, + *, + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + class OperationDisplay(_model_base.Model): """Localized display information for and operation. @@ -833,15 +965,22 @@ class Organization(_model_base.Model): :ivar parallelism: How many machines can be created at maximum in this organization out of the maximumConcurrency of the pool. :vartype parallelism: int + :ivar open_access: Determines if the pool should have open access to all projects in this + organization. + :vartype open_access: bool """ - url: str = rest_field() + url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The Azure DevOps organization URL in which the pool should be created. Required.""" - projects: Optional[List[str]] = rest_field() + projects: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Optional list of projects in which the pool should be created.""" - parallelism: Optional[int] = rest_field() + parallelism: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """How many machines can be created at maximum in this organization out of the maximumConcurrency of the pool.""" + open_access: Optional[bool] = rest_field( + name="openAccess", visibility=["read", "create", "update", "delete", "query"] + ) + """Determines if the pool should have open access to all projects in this organization.""" @overload def __init__( @@ -850,6 +989,7 @@ def __init__( url: str, projects: Optional[List[str]] = None, parallelism: Optional[int] = None, + open_access: Optional[bool] = None, ) -> None: ... @overload @@ -859,7 +999,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) @@ -875,10 +1015,12 @@ class OsProfile(_model_base.Model): """ secrets_management_settings: Optional["_models.SecretsManagementSettings"] = rest_field( - name="secretsManagementSettings" + name="secretsManagementSettings", visibility=["read", "create", "update", "delete", "query"] ) """The secret management settings of the machines in the pool.""" - logon_type: Optional[Union[str, "_models.LogonType"]] = rest_field(name="logonType") + logon_type: Optional[Union[str, "_models.LogonType"]] = rest_field( + name="logonType", visibility=["read", "create", "update", "delete", "query"] + ) """Determines how the service should be run. By default, this will be set to Service. Known values are: \"Service\" and \"Interactive\".""" @@ -897,7 +1039,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) @@ -909,7 +1051,7 @@ class TrackedResource(Resource): :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -925,7 +1067,7 @@ class TrackedResource(Resource): :vartype location: str """ - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" location: str = rest_field(visibility=["read", "create"]) """The geo-location where the resource lives. Required.""" @@ -945,7 +1087,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) @@ -957,7 +1099,7 @@ class Pool(TrackedResource): :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -977,9 +1119,13 @@ class Pool(TrackedResource): :vartype identity: ~azure.mgmt.devopsinfrastructure.models.ManagedServiceIdentity """ - properties: Optional["_models.PoolProperties"] = rest_field() + properties: Optional["_models.PoolProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" - identity: Optional["_models.ManagedServiceIdentity"] = rest_field() + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The managed service identities assigned to this resource.""" @overload @@ -999,7 +1145,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) @@ -1015,16 +1161,28 @@ class PoolImage(_model_base.Model): :vartype aliases: list[str] :ivar buffer: The percentage of the buffer to be allocated to this image. :vartype buffer: str + :ivar ephemeral_type: The ephemeral type of the image. Known values are: "Automatic", + "CacheDisk", and "ResourceDisk". + :vartype ephemeral_type: str or ~azure.mgmt.devopsinfrastructure.models.EphemeralType """ - resource_id: Optional[str] = rest_field(name="resourceId") + resource_id: Optional[str] = rest_field( + name="resourceId", visibility=["read", "create", "update", "delete", "query"] + ) """The resource id of the image.""" - well_known_image_name: Optional[str] = rest_field(name="wellKnownImageName") + well_known_image_name: Optional[str] = rest_field( + name="wellKnownImageName", visibility=["read", "create", "update", "delete", "query"] + ) """The image to use from a well-known set of images made available to customers.""" - aliases: Optional[List[str]] = rest_field() + aliases: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """List of aliases to reference the image by.""" - buffer: Optional[str] = rest_field() + buffer: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The percentage of the buffer to be allocated to this image.""" + ephemeral_type: Optional[Union[str, "_models.EphemeralType"]] = rest_field( + name="ephemeralType", visibility=["read", "create", "update", "delete", "query"] + ) + """The ephemeral type of the image. Known values are: \"Automatic\", \"CacheDisk\", and + \"ResourceDisk\".""" @overload def __init__( @@ -1034,6 +1192,7 @@ def __init__( well_known_image_name: Optional[str] = None, aliases: Optional[List[str]] = None, buffer: Optional[str] = None, + ephemeral_type: Optional[Union[str, "_models.EphemeralType"]] = None, ) -> None: ... @overload @@ -1043,7 +1202,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) @@ -1068,18 +1227,30 @@ class PoolProperties(_model_base.Model): :vartype dev_center_project_resource_id: str """ - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(name="provisioningState") + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read", "create", "update", "delete", "query"] + ) """The status of the current operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" - maximum_concurrency: int = rest_field(name="maximumConcurrency") + maximum_concurrency: int = rest_field( + name="maximumConcurrency", visibility=["read", "create", "update", "delete", "query"] + ) """Defines how many resources can there be created at any given time. Required.""" - organization_profile: "_models.OrganizationProfile" = rest_field(name="organizationProfile") + organization_profile: "_models.OrganizationProfile" = rest_field( + name="organizationProfile", visibility=["read", "create", "update", "delete", "query"] + ) """Defines the organization in which the pool will be used. Required.""" - agent_profile: "_models.AgentProfile" = rest_field(name="agentProfile") + agent_profile: "_models.AgentProfile" = rest_field( + name="agentProfile", visibility=["read", "create", "update", "delete", "query"] + ) """Defines how the machine will be handled once it executed a job. Required.""" - fabric_profile: "_models.FabricProfile" = rest_field(name="fabricProfile") + fabric_profile: "_models.FabricProfile" = rest_field( + name="fabricProfile", visibility=["read", "create", "update", "delete", "query"] + ) """Defines the type of fabric the agent will run on. Required.""" - dev_center_project_resource_id: str = rest_field(name="devCenterProjectResourceId") + dev_center_project_resource_id: str = rest_field( + name="devCenterProjectResourceId", visibility=["read", "create", "update", "delete", "query"] + ) """The resource id of the DevCenter Project the pool belongs to. Required.""" @overload @@ -1101,7 +1272,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) @@ -1116,11 +1287,15 @@ class PoolUpdate(_model_base.Model): :vartype properties: ~azure.mgmt.devopsinfrastructure.models.PoolUpdateProperties """ - identity: Optional["_models.ManagedServiceIdentity"] = rest_field() + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The managed service identities assigned to this resource.""" - tags: Optional[Dict[str, str]] = rest_field() + tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" - properties: Optional["_models.PoolUpdateProperties"] = rest_field() + properties: Optional["_models.PoolUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -1139,7 +1314,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) @@ -1162,18 +1337,30 @@ class PoolUpdateProperties(_model_base.Model): :vartype dev_center_project_resource_id: str """ - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(name="provisioningState") + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read", "create", "update", "delete", "query"] + ) """The status of the current operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" - maximum_concurrency: Optional[int] = rest_field(name="maximumConcurrency") + maximum_concurrency: Optional[int] = rest_field( + name="maximumConcurrency", visibility=["read", "create", "update", "delete", "query"] + ) """Defines how many resources can there be created at any given time.""" - organization_profile: Optional["_models.OrganizationProfile"] = rest_field(name="organizationProfile") + organization_profile: Optional["_models.OrganizationProfile"] = rest_field( + name="organizationProfile", visibility=["read", "create", "update", "delete", "query"] + ) """Defines the organization in which the pool will be used.""" - agent_profile: Optional["_models.AgentProfile"] = rest_field(name="agentProfile") + agent_profile: Optional["_models.AgentProfile"] = rest_field( + name="agentProfile", visibility=["read", "create", "update", "delete", "query"] + ) """Defines how the machine will be handled once it executed a job.""" - fabric_profile: Optional["_models.FabricProfile"] = rest_field(name="fabricProfile") + fabric_profile: Optional["_models.FabricProfile"] = rest_field( + name="fabricProfile", visibility=["read", "create", "update", "delete", "query"] + ) """Defines the type of fabric the agent will run on.""" - dev_center_project_resource_id: Optional[str] = rest_field(name="devCenterProjectResourceId") + dev_center_project_resource_id: Optional[str] = rest_field( + name="devCenterProjectResourceId", visibility=["read", "create", "update", "delete", "query"] + ) """The resource id of the DevCenter Project the pool belongs to.""" @overload @@ -1195,7 +1382,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) @@ -1219,13 +1406,13 @@ class Quota(_model_base.Model): name: Optional["_models.QuotaName"] = rest_field(visibility=["read"]) """The name of the quota.""" - id: str = rest_field() + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Fully qualified ARM resource id. Required.""" - unit: str = rest_field() + unit: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unit of usage measurement. Required.""" - current_value: int = rest_field(name="currentValue") + current_value: int = rest_field(name="currentValue", visibility=["read", "create", "update", "delete", "query"]) """The current usage of the resource. Required.""" - limit: int = rest_field() + limit: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The maximum permitted usage of the resource. Required.""" @overload @@ -1245,7 +1432,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) @@ -1258,9 +1445,11 @@ class QuotaName(_model_base.Model): :vartype localized_value: str """ - value: Optional[str] = rest_field() + value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The name of the resource.""" - localized_value: Optional[str] = rest_field(name="localizedValue") + localized_value: Optional[str] = rest_field( + name="localizedValue", visibility=["read", "create", "update", "delete", "query"] + ) """The localized name of the resource.""" @overload @@ -1278,7 +1467,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) @@ -1288,7 +1477,7 @@ class ResourceDetailsObject(ProxyResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1302,7 +1491,9 @@ class ResourceDetailsObject(ProxyResource): :vartype properties: ~azure.mgmt.devopsinfrastructure.models.ResourceDetailsObjectProperties """ - properties: Optional["_models.ResourceDetailsObjectProperties"] = rest_field() + properties: Optional["_models.ResourceDetailsObjectProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -1319,7 +1510,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) @@ -1337,13 +1528,15 @@ class ResourceDetailsObjectProperties(_model_base.Model): :vartype image_version: str """ - status: Union[str, "_models.ResourceStatus"] = rest_field() + status: Union[str, "_models.ResourceStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The status of the resource. Required. Known values are: \"Ready\", \"NotReady\", \"Allocated\", \"PendingReturn\", \"Returned\", \"Leased\", \"Provisioning\", \"Updating\", \"Starting\", \"PendingReimage\", and \"Reimaging\".""" - image: str = rest_field() + image: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The image name of the resource. Required.""" - image_version: str = rest_field(name="imageVersion") + image_version: str = rest_field(name="imageVersion", visibility=["read", "create", "update", "delete", "query"]) """The version of the image running on the resource. Required.""" @overload @@ -1362,7 +1555,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) @@ -1376,7 +1569,7 @@ class ResourceSku(ProxyResource): Readonly variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1390,7 +1583,9 @@ class ResourceSku(ProxyResource): :vartype properties: ~azure.mgmt.devopsinfrastructure.models.ResourceSkuProperties """ - properties: Optional["_models.ResourceSkuProperties"] = rest_field() + properties: Optional["_models.ResourceSkuProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The resource-specific properties for this resource.""" @overload @@ -1407,7 +1602,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) @@ -1421,9 +1616,9 @@ class ResourceSkuCapabilities(_model_base.Model): :vartype value: str """ - name: str = rest_field() + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The name of the SKU capability. Required.""" - value: str = rest_field() + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The value of the SKU capability. Required.""" @overload @@ -1441,7 +1636,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) @@ -1458,11 +1653,13 @@ class ResourceSkuLocationInfo(_model_base.Model): :vartype zone_details: list[~azure.mgmt.devopsinfrastructure.models.ResourceSkuZoneDetails] """ - location: str = rest_field() + location: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Location of the SKU. Required.""" - zones: List[str] = rest_field() + zones: List[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """List of availability zones where the SKU is supported. Required.""" - zone_details: List["_models.ResourceSkuZoneDetails"] = rest_field(name="zoneDetails") + zone_details: List["_models.ResourceSkuZoneDetails"] = rest_field( + name="zoneDetails", visibility=["read", "create", "update", "delete", "query"] + ) """Gets details of capabilities available to a SKU in specific zones. Required.""" @overload @@ -1481,7 +1678,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) @@ -1508,22 +1705,28 @@ class ResourceSkuProperties(_model_base.Model): :vartype restrictions: list[~azure.mgmt.devopsinfrastructure.models.ResourceSkuRestrictions] """ - resource_type: str = rest_field(name="resourceType") + resource_type: str = rest_field(name="resourceType", visibility=["read", "create", "update", "delete", "query"]) """The type of resource the SKU applies to. Required.""" - tier: str = rest_field() + tier: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The tier of virtual machines in a scale set. Required.""" - size: str = rest_field() + size: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The size of the SKU. Required.""" - family: str = rest_field() + family: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The family of the SKU. Required.""" - locations: List[str] = rest_field() + locations: List[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The set of locations that the SKU is available. Required.""" - location_info: List["_models.ResourceSkuLocationInfo"] = rest_field(name="locationInfo") + location_info: List["_models.ResourceSkuLocationInfo"] = rest_field( + name="locationInfo", visibility=["read", "create", "update", "delete", "query"] + ) """A list of locations and availability zones in those locations where the SKU is available. Required.""" - capabilities: List["_models.ResourceSkuCapabilities"] = rest_field() + capabilities: List["_models.ResourceSkuCapabilities"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """Name value pairs to describe the capability. Required.""" - restrictions: List["_models.ResourceSkuRestrictions"] = rest_field() + restrictions: List["_models.ResourceSkuRestrictions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The restrictions of the SKU. Required.""" @overload @@ -1547,7 +1750,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) @@ -1560,9 +1763,9 @@ class ResourceSkuRestrictionInfo(_model_base.Model): :vartype zones: list[str] """ - locations: Optional[List[str]] = rest_field() + locations: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Locations where the SKU is restricted.""" - zones: Optional[List[str]] = rest_field() + zones: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """List of availability zones where the SKU is restricted.""" @overload @@ -1580,7 +1783,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) @@ -1602,14 +1805,20 @@ class ResourceSkuRestrictions(_model_base.Model): ~azure.mgmt.devopsinfrastructure.models.ResourceSkuRestrictionsReasonCode """ - type: Optional[Union[str, "_models.ResourceSkuRestrictionsType"]] = rest_field() + type: Optional[Union[str, "_models.ResourceSkuRestrictionsType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """the type of restrictions. Known values are: \"Location\" and \"Zone\".""" - values_property: List[str] = rest_field(name="values") + values_property: List[str] = rest_field(name="values", visibility=["read", "create", "update", "delete", "query"]) """The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. Required.""" - restriction_info: "_models.ResourceSkuRestrictionInfo" = rest_field(name="restrictionInfo") + restriction_info: "_models.ResourceSkuRestrictionInfo" = rest_field( + name="restrictionInfo", visibility=["read", "create", "update", "delete", "query"] + ) """The information about the restriction where the SKU cannot be used. Required.""" - reason_code: Optional[Union[str, "_models.ResourceSkuRestrictionsReasonCode"]] = rest_field(name="reasonCode") + reason_code: Optional[Union[str, "_models.ResourceSkuRestrictionsReasonCode"]] = rest_field( + name="reasonCode", visibility=["read", "create", "update", "delete", "query"] + ) """the reason for restriction. Known values are: \"QuotaId\" and \"NotAvailableForSubscription\".""" @overload @@ -1629,7 +1838,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) @@ -1645,9 +1854,11 @@ class ResourceSkuZoneDetails(_model_base.Model): :vartype capabilities: list[~azure.mgmt.devopsinfrastructure.models.ResourceSkuCapabilities] """ - name: List[str] = rest_field() + name: List[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Gets the set of zones that the SKU is available in with the specified capabilities. Required.""" - capabilities: List["_models.ResourceSkuCapabilities"] = rest_field() + capabilities: List["_models.ResourceSkuCapabilities"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """A list of capabilities that are available for the SKU in the specified list of zones. Required.""" @overload @@ -1665,7 +1876,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) @@ -1675,6 +1886,10 @@ class SecretsManagementSettings(_model_base.Model): :ivar certificate_store_location: Where to store certificates on the machine. :vartype certificate_store_location: str + :ivar certificate_store_name: Name of the certificate store to use on the machine, currently + 'My' and 'Root' are supported. Known values are: "My" and "Root". + :vartype certificate_store_name: str or + ~azure.mgmt.devopsinfrastructure.models.CertificateStoreNameOption :ivar observed_certificates: The list of certificates to install on all machines in the pool. Required. :vartype observed_certificates: list[str] @@ -1682,11 +1897,20 @@ class SecretsManagementSettings(_model_base.Model): :vartype key_exportable: bool """ - certificate_store_location: Optional[str] = rest_field(name="certificateStoreLocation") + certificate_store_location: Optional[str] = rest_field( + name="certificateStoreLocation", visibility=["read", "create", "update", "delete", "query"] + ) """Where to store certificates on the machine.""" - observed_certificates: List[str] = rest_field(name="observedCertificates") + certificate_store_name: Optional[Union[str, "_models.CertificateStoreNameOption"]] = rest_field( + name="certificateStoreName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the certificate store to use on the machine, currently 'My' and 'Root' are supported. + Known values are: \"My\" and \"Root\".""" + observed_certificates: List[str] = rest_field( + name="observedCertificates", visibility=["read", "create", "update", "delete", "query"] + ) """The list of certificates to install on all machines in the pool. Required.""" - key_exportable: bool = rest_field(name="keyExportable") + key_exportable: bool = rest_field(name="keyExportable", visibility=["read", "create", "update", "delete", "query"]) """Defines if the key of the certificates should be exportable. Required.""" @overload @@ -1696,6 +1920,7 @@ def __init__( observed_certificates: List[str], key_exportable: bool, certificate_store_location: Optional[str] = None, + certificate_store_name: Optional[Union[str, "_models.CertificateStoreNameOption"]] = None, ) -> None: ... @overload @@ -1705,7 +1930,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) @@ -1729,12 +1954,16 @@ class Stateful(AgentProfile, discriminator="Stateful"): :vartype grace_period_time_span: str """ - kind: Literal["Stateful"] = rest_discriminator(name="kind") # type: ignore + kind: Literal["Stateful"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Stateful profile meaning that the machines will be returned to the pool after running a job. Required. Default value is \"Stateful\".""" - max_agent_lifetime: Optional[str] = rest_field(name="maxAgentLifetime") + max_agent_lifetime: Optional[str] = rest_field( + name="maxAgentLifetime", visibility=["read", "create", "update", "delete", "query"] + ) """How long should stateful machines be kept around. The maximum is one week.""" - grace_period_time_span: Optional[str] = rest_field(name="gracePeriodTimeSpan") + grace_period_time_span: Optional[str] = rest_field( + name="gracePeriodTimeSpan", visibility=["read", "create", "update", "delete", "query"] + ) """How long should the machine be kept around after it ran a workload when there are no stand-by agents. The maximum is one week.""" @@ -1755,7 +1984,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) @@ -1773,7 +2002,7 @@ class StatelessAgentProfile(AgentProfile, discriminator="Stateless"): :vartype kind: str """ - kind: Literal["Stateless"] = rest_discriminator(name="kind") # type: ignore + kind: Literal["Stateless"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Stateless profile meaning that the machines will be cleaned up after running a job. Required. Default value is \"Stateless\".""" @@ -1792,7 +2021,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) @@ -1808,11 +2037,13 @@ class StorageProfile(_model_base.Model): """ os_disk_storage_account_type: Optional[Union[str, "_models.OsDiskStorageAccountType"]] = rest_field( - name="osDiskStorageAccountType" + name="osDiskStorageAccountType", visibility=["read", "create", "update", "delete", "query"] ) """The Azure SKU name of the machines in the pool. Known values are: \"Standard\", \"Premium\", and \"StandardSSD\".""" - data_disks: Optional[List["_models.DataDisk"]] = rest_field(name="dataDisks") + data_disks: Optional[List["_models.DataDisk"]] = rest_field( + name="dataDisks", visibility=["read", "create", "update", "delete", "query"] + ) """A list of empty data disks to attach.""" @overload @@ -1830,7 +2061,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) @@ -1853,19 +2084,29 @@ class SystemData(_model_base.Model): :vartype last_modified_at: ~datetime.datetime """ - created_by: Optional[str] = rest_field(name="createdBy") + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) """The identity that created the resource.""" - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="createdByType") + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of identity that created the resource. Known values are: \"User\", \"Application\", \"ManagedIdentity\", and \"Key\".""" - created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The timestamp of resource creation (UTC).""" - last_modified_by: Optional[str] = rest_field(name="lastModifiedBy") + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) """The identity that last modified the resource.""" - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="lastModifiedByType") + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) """The type of identity that last modified the resource. Known values are: \"User\", \"Application\", \"ManagedIdentity\", and \"Key\".""" - last_modified_at: Optional[datetime.datetime] = rest_field(name="lastModifiedAt", format="rfc3339") + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) """The timestamp of resource last modification (UTC).""" @overload @@ -1887,7 +2128,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) @@ -1896,16 +2137,16 @@ class UserAssignedIdentity(_model_base.Model): Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str :ivar client_id: The client ID of the assigned identity. :vartype client_id: str + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str """ - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The principal ID of the assigned identity.""" client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) """The client ID of the assigned identity.""" + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" class VmssFabricProfile(FabricProfile, discriminator="Vmss"): @@ -1926,17 +2167,23 @@ class VmssFabricProfile(FabricProfile, discriminator="Vmss"): :vartype network_profile: ~azure.mgmt.devopsinfrastructure.models.NetworkProfile """ - kind: Literal["Vmss"] = rest_discriminator(name="kind") # type: ignore + kind: Literal["Vmss"] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Virtual Machine Scale Sets. Required. Default value is \"Vmss\".""" - sku: "_models.DevOpsAzureSku" = rest_field() + sku: "_models.DevOpsAzureSku" = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The Azure SKU of the machines in the pool. Required.""" - images: List["_models.PoolImage"] = rest_field() + images: List["_models.PoolImage"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The VM images of the machines in the pool. Required.""" - os_profile: Optional["_models.OsProfile"] = rest_field(name="osProfile") + os_profile: Optional["_models.OsProfile"] = rest_field( + name="osProfile", visibility=["read", "create", "update", "delete", "query"] + ) """The OS profile of the machines in the pool.""" - storage_profile: Optional["_models.StorageProfile"] = rest_field(name="storageProfile") + storage_profile: Optional["_models.StorageProfile"] = rest_field( + name="storageProfile", visibility=["read", "create", "update", "delete", "query"] + ) """The storage profile of the machines in the pool.""" - network_profile: Optional["_models.NetworkProfile"] = rest_field(name="networkProfile") + network_profile: Optional["_models.NetworkProfile"] = rest_field( + name="networkProfile", visibility=["read", "create", "update", "delete", "query"] + ) """The network profile of the machines in the pool.""" @overload @@ -1957,5 +2204,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..914553d97283 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 @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -12,6 +12,7 @@ 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, @@ -32,8 +33,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._model_base import SdkJSONEncoder, _deserialize -from .._serialization import Serializer +from .._configuration import DevOpsInfrastructureMgmtClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -51,7 +53,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,11 +74,11 @@ def build_pools_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -101,11 +103,11 @@ def build_pools_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -132,11 +134,11 @@ def build_pools_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -162,11 +164,11 @@ def build_pools_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -190,11 +192,11 @@ def build_pools_list_by_resource_group_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -215,7 +217,7 @@ def build_pools_list_by_subscription_request(subscription_id: str, **kwargs: Any _headers = case_insensitive_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-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -235,17 +237,46 @@ def build_pools_list_by_subscription_request(subscription_id: str, **kwargs: Any return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_pools_check_name_availability_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/checkNameAvailability" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + 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_resource_details_list_by_pool_request( # pylint: disable=name-too-long resource_group_name: str, pool_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-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}/resources" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}/resources" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -267,7 +298,7 @@ def build_sku_list_by_location_request(location_name: 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", "2024-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -292,7 +323,7 @@ def build_subscription_usages_usages_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", "2024-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,11 +350,11 @@ def build_image_versions_list_by_image_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-19")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-21")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/images/{imageName}/versions" # pylint: disable=line-too-long + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/images/{imageName}/versions" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -353,23 +384,25 @@ 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: DevOpsInfrastructureMgmtClientConfiguration = ( + 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._models.Operation"]: + def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devopsinfrastructure.models._models.Operation] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devopsinfrastructure.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models._models.Operation]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -418,7 +451,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models._models.Operation], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -434,7 +467,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -454,10 +487,12 @@ class PoolsOperations: 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: DevOpsInfrastructureMgmtClientConfiguration = ( + 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, pool_name: str, **kwargs: Any) -> _models.Pool: @@ -512,7 +547,7 @@ def get(self, resource_group_name: str, pool_name: str, **kwargs: Any) -> _model except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: @@ -577,7 +612,7 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -798,7 +833,7 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1008,7 +1043,7 @@ def _delete_initial(self, resource_group_name: str, pool_name: str, **kwargs: An except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1161,7 +1196,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1245,13 +1280,139 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + @overload + def check_name_availability( + self, body: _models.CheckNameAvailability, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResult: + """Checks that the pool name is valid and is not already in use. + + :param body: The CheckAvailability request. Required. + :type body: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailability + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckNameAvailabilityResult. The CheckNameAvailabilityResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_name_availability( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResult: + """Checks that the pool name is valid and is not already in use. + + :param body: The CheckAvailability request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckNameAvailabilityResult. The CheckNameAvailabilityResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_name_availability( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResult: + """Checks that the pool name is valid and is not already in use. + + :param body: The CheckAvailability request. Required. + :type body: 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: CheckNameAvailabilityResult. The CheckNameAvailabilityResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def check_name_availability( + self, body: Union[_models.CheckNameAvailability, JSON, IO[bytes]], **kwargs: Any + ) -> _models.CheckNameAvailabilityResult: + """Checks that the pool name is valid and is not already in use. + + :param body: The CheckAvailability request. Is one of the following types: + CheckNameAvailability, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailability or JSON or IO[bytes] + :return: CheckNameAvailabilityResult. The CheckNameAvailabilityResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.devopsinfrastructure.models.CheckNameAvailabilityResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResult] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_pools_check_name_availability_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = kwargs.pop("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]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.CheckNameAvailabilityResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + class ResourceDetailsOperations: """ @@ -1265,10 +1426,12 @@ class ResourceDetailsOperations: 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: DevOpsInfrastructureMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_pool( @@ -1357,7 +1520,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1377,10 +1540,12 @@ class SkuOperations: 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: DevOpsInfrastructureMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_models.ResourceSku"]: @@ -1462,7 +1627,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1482,10 +1647,12 @@ class SubscriptionUsagesOperations: 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: DevOpsInfrastructureMgmtClientConfiguration = ( + 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 usages(self, location: str, **kwargs: Any) -> Iterable["_models.Quota"]: @@ -1567,7 +1734,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1587,10 +1754,12 @@ class ImageVersionsOperations: 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: DevOpsInfrastructureMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_image( @@ -1678,7 +1847,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize(_models.ErrorResponse, response.json()) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/create_or_update_pool.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/create_or_update_pool.py index d896c6b32b09..5eda17fd7695 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/create_or_update_pool.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/create_or_update_pool.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,14 +40,26 @@ def main(): "agentProfile": {"kind": "Stateless"}, "devCenterProjectResourceId": "/subscriptions/222e81d0-cf38-4dab-baa5-289bf16baaa4/resourceGroups/rg-1es-devcenter/providers/Microsoft.DevCenter/projects/1ES", "fabricProfile": { - "images": [{"resourceId": "/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest"}], + "images": [ + { + "ephemeralType": "Automatic", + "resourceId": "/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest", + } + ], "kind": "Vmss", + "osProfile": { + "secretsManagementSettings": { + "certificateStoreName": "Root", + "keyExportable": False, + "observedCertificates": ["https://abc.vault.azure.net/secrets/one"], + } + }, "sku": {"name": "Standard_D4ads_v5"}, }, "maximumConcurrency": 10, "organizationProfile": { "kind": "AzureDevOps", - "organizations": [{"url": "https://mseng.visualstudio.com"}], + "organizations": [{"openAccess": True, "url": "https://mseng.visualstudio.com"}], }, "provisioningState": "Succeeded", }, @@ -55,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: 2024-10-19/CreateOrUpdatePool.json +# x-ms-original-file: 2025-01-21/CreateOrUpdatePool.json if __name__ == "__main__": main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/delete_pool.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/delete_pool.py index 18c0e5cf2f59..85920625f94a 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/delete_pool.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/delete_pool.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2024-10-19/DeletePool.json +# x-ms-original-file: 2025-01-21/DeletePool.json if __name__ == "__main__": main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/get_pool.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/get_pool.py index b310a7c5b50a..f1212362332d 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/get_pool.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/get_pool.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2024-10-19/GetPool.json +# x-ms-original-file: 2025-01-21/GetPool.json if __name__ == "__main__": main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/image_versions_list_by_image.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/image_versions_list_by_image.py index 93a6cc0fd26c..cecea9c0449e 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/image_versions_list_by_image.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/image_versions_list_by_image.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-10-19/ImageVersions_ListByImage.json +# x-ms-original-file: 2025-01-21/ImageVersions_ListByImage.json if __name__ == "__main__": main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_operations.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_operations.py index 9953b51a2180..091648396044 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_operations.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_operations.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-10-19/ListOperations.json +# x-ms-original-file: 2025-01-21/ListOperations.json if __name__ == "__main__": main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_pools_by_subscription.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_pools_by_subscription.py index 01fbc3deeecf..441a651d7625 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_pools_by_subscription.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_pools_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-10-19/ListPoolsBySubscription.json +# x-ms-original-file: 2025-01-21/ListPoolsBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_pools_by_subscription_and_resource_group.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_pools_by_subscription_and_resource_group.py index 44690730eddf..8c7b2558ab72 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_pools_by_subscription_and_resource_group.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/list_pools_by_subscription_and_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2024-10-19/ListPoolsBySubscriptionAndResourceGroup.json +# x-ms-original-file: 2025-01-21/ListPoolsBySubscriptionAndResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/pools_check_name_availability.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/pools_check_name_availability.py new file mode 100644 index 000000000000..7bfb843b9ff7 --- /dev/null +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/pools_check_name_availability.py @@ -0,0 +1,41 @@ +# 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 pools_check_name_availability.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.pools.check_name_availability( + body={"name": "mydevopspool", "type": "Microsoft.DevOpsInfrastructure/pools"}, + ) + print(response) + + +# x-ms-original-file: 2025-01-21/Pools_CheckNameAvailability.json +if __name__ == "__main__": + main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/resource_details_list_by_pool.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/resource_details_list_by_pool.py index 4c34a6ddbf69..fbdb0832d8c7 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/resource_details_list_by_pool.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/resource_details_list_by_pool.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-10-19/ResourceDetails_ListByPool.json +# x-ms-original-file: 2025-01-21/ResourceDetails_ListByPool.json if __name__ == "__main__": main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/sku_list_by_location.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/sku_list_by_location.py index 530f60131b5d..dcfbcd699a43 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/sku_list_by_location.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/sku_list_by_location.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2024-10-19/Sku_ListByLocation.json +# x-ms-original-file: 2025-01-21/Sku_ListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/subscription_usages_usages.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/subscription_usages_usages.py index c2605175de27..176d759960b3 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/subscription_usages_usages.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_samples/subscription_usages_usages.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2024-10-19/SubscriptionUsages_Usages.json +# x-ms-original-file: 2025-01-21/SubscriptionUsages_Usages.json if __name__ == "__main__": main() diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_pools_operations.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_pools_operations.py index 937e352ee1f8..e561cf16702b 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_pools_operations.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_pools_operations.py @@ -125,3 +125,13 @@ def test_pools_list_by_subscription(self, resource_group): result = [r for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_pools_check_name_availability(self, resource_group): + response = self.client.pools.check_name_availability( + body={"name": "str", "type": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_pools_operations_async.py b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_pools_operations_async.py index 14334ae0959a..3b840763fab9 100644 --- a/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_pools_operations_async.py +++ b/sdk/devopsinfrastructure/azure-mgmt-devopsinfrastructure/generated_tests/test_dev_ops_infrastructure_mgmt_pools_operations_async.py @@ -132,3 +132,13 @@ async def test_pools_list_by_subscription(self, resource_group): 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_pools_check_name_availability(self, resource_group): + response = await self.client.pools.check_name_availability( + body={"name": "str", "type": "str"}, + ) + + # 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..319dd0919f69 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: 3350b3c1fe16b906adc33891c41ef8ace067c3dd repo: Azure/azure-rest-api-specs additionalDirectories: