From 06600727baf0c05e15a89c261bf922955f8534a2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 14 Mar 2025 04:43:09 +0000 Subject: [PATCH] CodeGen from PR 32938 in Azure/azure-rest-api-specs Merge 0a04a5454a0f5616f7cf7d6e728c8d0b7a8c12ba into 535377f6ef91e9d847bbee77d55871eb8b37b7b2 --- sdk/terraform/azure-mgmt-terraform/_meta.json | 4 +- .../apiview-properties.json | 24 +++ .../azure/mgmt/terraform/_model_base.py | 78 +++++++- .../azure/mgmt/terraform/_serialization.py | 168 ++++++------------ .../terraform/aio/operations/_operations.py | 25 +-- .../azure/mgmt/terraform/models/__init__.py | 2 + .../azure/mgmt/terraform/models/_enums.py | 19 +- .../azure/mgmt/terraform/models/_models.py | 118 +++++++----- .../mgmt/terraform/operations/_operations.py | 26 +-- ...est_terraform_mgmt_terraform_operations.py | 2 + ...rraform_mgmt_terraform_operations_async.py | 2 + sdk/terraform/azure-mgmt-terraform/setup.py | 8 +- .../azure-mgmt-terraform/tsp-location.yaml | 2 +- 13 files changed, 285 insertions(+), 193 deletions(-) create mode 100644 sdk/terraform/azure-mgmt-terraform/apiview-properties.json diff --git a/sdk/terraform/azure-mgmt-terraform/_meta.json b/sdk/terraform/azure-mgmt-terraform/_meta.json index d4ba5b700af0..261e5bf70bc5 100644 --- a/sdk/terraform/azure-mgmt-terraform/_meta.json +++ b/sdk/terraform/azure-mgmt-terraform/_meta.json @@ -1,6 +1,6 @@ { - "commit": "ed3e7186654df4ec286c3d92f03dfa6c14b37279", + "commit": "8f6744026f8f69f599f4713dadf1109f04e23a31", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/terraform/Microsoft.AzureTerraform.Management", - "@azure-tools/typespec-python": "0.36.1" + "@azure-tools/typespec-python": "0.39.1" } \ No newline at end of file diff --git a/sdk/terraform/azure-mgmt-terraform/apiview-properties.json b/sdk/terraform/azure-mgmt-terraform/apiview-properties.json new file mode 100644 index 000000000000..0b66bd293307 --- /dev/null +++ b/sdk/terraform/azure-mgmt-terraform/apiview-properties.json @@ -0,0 +1,24 @@ +{ + "CrossLanguagePackageId": "Microsoft.AzureTerraform", + "CrossLanguageDefinitionId": { + "azure.mgmt.terraform.models.BaseExportModel": "Microsoft.AzureTerraform.BaseExportModel", + "azure.mgmt.terraform.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.terraform.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.terraform.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.terraform.models.ExportQuery": "Microsoft.AzureTerraform.ExportQuery", + "azure.mgmt.terraform.models.ExportResource": "Microsoft.AzureTerraform.ExportResource", + "azure.mgmt.terraform.models.ExportResourceGroup": "Microsoft.AzureTerraform.ExportResourceGroup", + "azure.mgmt.terraform.models.ExportResult": "Microsoft.AzureTerraform.ExportResult", + "azure.mgmt.terraform.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.terraform.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.terraform.models.TerraformOperationStatus": "Microsoft.AzureTerraform.TerraformOperationStatus", + "azure.mgmt.terraform.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.terraform.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.terraform.models.ResourceProvisioningState": "Azure.ResourceManager.ResourceProvisioningState", + "azure.mgmt.terraform.models.Type": "Microsoft.AzureTerraform.Type", + "azure.mgmt.terraform.models.TargetProvider": "Microsoft.AzureTerraform.targetProvider", + "azure.mgmt.terraform.models.AuthorizationScopeFilter": "Microsoft.AzureTerraform.authorizationScopeFilter", + "azure.mgmt.terraform.TerraformMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.terraform.TerraformMgmtClient.terraform.begin_export_terraform": "Microsoft.AzureTerraform.Terraform.exportTerraform" + } +} \ No newline at end of file diff --git a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/_model_base.py b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/_model_base.py index e6a2730f9276..3072ee252ed9 100644 --- a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/_model_base.py +++ b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/_model_base.py @@ -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) @@ -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/terraform/azure-mgmt-terraform/azure/mgmt/terraform/_serialization.py b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/_serialization.py index ce17d1798ce7..7a0232de5ddc 100644 --- a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/_serialization.py +++ b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/_serialization.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,9 +48,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, ) @@ -61,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] @@ -185,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,8 +411,8 @@ def from_dict( :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong - :rtype: ModelType + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -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/terraform/azure-mgmt-terraform/azure/mgmt/terraform/aio/operations/_operations.py b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/aio/operations/_operations.py index 6c4c3e1fdd60..3952ee3e3322 100644 --- a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/aio/operations/_operations.py +++ b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/aio/operations/_operations.py @@ -11,6 +11,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, @@ -32,8 +33,10 @@ 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_operations_list_request, build_terraform_export_terraform_request +from .._configuration import TerraformMgmtClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -56,10 +59,10 @@ class Operations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: TerraformMgmtClientConfiguration = 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.Operation"]: @@ -137,7 +140,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 @@ -157,10 +160,10 @@ class TerraformOperations: 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: TerraformMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") async def _export_terraform_initial( self, body: Union[_models.BaseExportModel, JSON, IO[bytes]], **kwargs: Any @@ -212,7 +215,7 @@ async def _export_terraform_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 = {} diff --git a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/__init__.py b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/__init__.py index 5e94b558ff9e..81073410c444 100644 --- a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/__init__.py +++ b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/__init__.py @@ -29,6 +29,7 @@ from ._enums import ( # type: ignore ActionType, + AuthorizationScopeFilter, Origin, ResourceProvisioningState, TargetProvider, @@ -51,6 +52,7 @@ "OperationDisplay", "TerraformOperationStatus", "ActionType", + "AuthorizationScopeFilter", "Origin", "ResourceProvisioningState", "TargetProvider", diff --git a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/_enums.py b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/_enums.py index 73579b608cb3..1301214d223c 100644 --- a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/_enums.py +++ b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/_enums.py @@ -19,6 +19,19 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Actions are for internal-only APIs.""" +class AuthorizationScopeFilter(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Azure Resource Graph Authorization Scope Filter parameter.""" + + AT_SCOPE_AND_BELOW = "AtScopeAndBelow" + """Returns assignments for the given scope and all child scopes.""" + AT_SCOPE_AND_ABOVE = "AtScopeAndAbove" + """Returns assignments for the given scope and all parent scopes, but not child scopes.""" + AT_SCOPE_ABOVE_AND_BELOW = "AtScopeAboveAndBelow" + """Returns assignments for the given scope, all parent scopes, and all child scopes.""" + AT_SCOPE_EXACT = "AtScopeExact" + """Returns assignments only for the given scope; no parent or child scopes are included.""" + + class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". @@ -47,9 +60,11 @@ class TargetProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The target Azure Terraform Provider.""" AZURERM = "azurerm" - """https://registry.terraform.io/providers/hashicorp/azurerm/latest""" + """`https://registry.terraform.io/providers/hashicorp/azurerm/latest + `_""" AZAPI = "azapi" - """https://registry.terraform.io/providers/Azure/azapi/latest""" + """`https://registry.terraform.io/providers/Azure/azapi/latest + `_""" class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/_models.py b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/_models.py index cdf5ad48c4f8..8a01f61092f1 100644 --- a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/_models.py +++ b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/models/_models.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -24,8 +25,6 @@ class BaseExportModel(_model_base.Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ExportQuery, ExportResource, ExportResourceGroup - All required parameters must be populated in order to send to server. - :ivar type: The parameter type. Required. Known values are: "ExportResource", "ExportResourceGroup", and "ExportQuery". :vartype type: str or ~azure.mgmt.terraform.models.Type @@ -40,15 +39,21 @@ class BaseExportModel(_model_base.Model): """ __mapping__: Dict[str, _model_base.Model] = {} - type: str = rest_discriminator(name="type") + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) """The parameter type. Required. Known values are: \"ExportResource\", \"ExportResourceGroup\", and \"ExportQuery\".""" - target_provider: Optional[Union[str, "_models.TargetProvider"]] = rest_field(name="targetProvider") + target_provider: Optional[Union[str, "_models.TargetProvider"]] = rest_field( + name="targetProvider", visibility=["read", "create", "update", "delete", "query"] + ) """The target Azure Terraform Provider. Known values are: \"azurerm\" and \"azapi\".""" - full_properties: Optional[bool] = rest_field(name="fullProperties") + full_properties: Optional[bool] = rest_field( + name="fullProperties", visibility=["read", "create", "update", "delete", "query"] + ) """Whether to output all non-computed properties in the generated Terraform configuration? This probably needs manual modifications to make it valid.""" - mask_sensitive: Optional[bool] = rest_field(name="maskSensitive") + mask_sensitive: Optional[bool] = rest_field( + name="maskSensitive", visibility=["read", "create", "update", "delete", "query"] + ) """Mask sensitive attributes in the Terraform configuration.""" @overload @@ -75,8 +80,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ErrorAdditionalInfo(_model_base.Model): """The resource management error additional info. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. @@ -92,8 +95,6 @@ class ErrorAdditionalInfo(_model_base.Model): class ErrorDetail(_model_base.Model): """The error detail. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar code: The error code. :vartype code: str :ivar message: The error message. @@ -128,7 +129,7 @@ class ErrorResponse(_model_base.Model): :vartype error: ~azure.mgmt.terraform.models.ErrorDetail """ - error: Optional["_models.ErrorDetail"] = rest_field() + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The error object.""" @overload @@ -152,8 +153,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ExportQuery(BaseExportModel, discriminator="ExportQuery"): """Export parameter for resources queried by ARG (Azure Resource Graph). - All required parameters must be populated in order to send to server. - :ivar target_provider: The target Azure Terraform Provider. Known values are: "azurerm" and "azapi". :vartype target_provider: str or ~azure.mgmt.terraform.models.TargetProvider @@ -172,18 +171,33 @@ class ExportQuery(BaseExportModel, discriminator="ExportQuery"): :vartype recursive: bool :ivar type: The parameter type. Required. :vartype type: str or ~azure.mgmt.terraform.models.EXPORT_QUERY + :ivar table: The ARG table name. + :vartype table: str + :ivar authorization_scope_filter: The ARG Scope Filter parameter. Known values are: + "AtScopeAndBelow", "AtScopeAndAbove", "AtScopeAboveAndBelow", and "AtScopeExact". + :vartype authorization_scope_filter: str or + ~azure.mgmt.terraform.models.AuthorizationScopeFilter """ - query: str = rest_field() + query: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ARG where predicate. Note that you can combine multiple conditions in one ``where`` predicate, e.g. ``resourceGroup =~ \"my-rg\" and type =~ \"microsoft.network/virtualnetworks\"``. Required.""" - name_pattern: Optional[str] = rest_field(name="namePattern") + name_pattern: Optional[str] = rest_field( + name="namePattern", visibility=["read", "create", "update", "delete", "query"] + ) """The name pattern of the Terraform resources.""" - recursive: Optional[bool] = rest_field() + recursive: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Whether to recursively list child resources of the query result.""" - type: Literal[Type.EXPORT_QUERY] = rest_discriminator(name="type") # type: ignore + type: Literal[Type.EXPORT_QUERY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The parameter type. Required.""" + table: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ARG table name.""" + authorization_scope_filter: Optional[Union[str, "_models.AuthorizationScopeFilter"]] = rest_field( + name="authorizationScopeFilter", visibility=["read", "create", "update", "delete", "query"] + ) + """The ARG Scope Filter parameter. Known values are: \"AtScopeAndBelow\", \"AtScopeAndAbove\", + \"AtScopeAboveAndBelow\", and \"AtScopeExact\".""" @overload def __init__( @@ -195,6 +209,8 @@ def __init__( mask_sensitive: Optional[bool] = None, name_pattern: Optional[str] = None, recursive: Optional[bool] = None, + table: Optional[str] = None, + authorization_scope_filter: Optional[Union[str, "_models.AuthorizationScopeFilter"]] = None, ) -> None: ... @overload @@ -211,8 +227,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ExportResource(BaseExportModel, discriminator="ExportResource"): """Export parameter for individual resources. - All required parameters must be populated in order to send to server. - :ivar target_provider: The target Azure Terraform Provider. Known values are: "azurerm" and "azapi". :vartype target_provider: str or ~azure.mgmt.terraform.models.TargetProvider @@ -235,15 +249,21 @@ class ExportResource(BaseExportModel, discriminator="ExportResource"): :vartype type: str or ~azure.mgmt.terraform.models.EXPORT_RESOURCE """ - resource_ids: List[str] = rest_field(name="resourceIds") + resource_ids: List[str] = rest_field(name="resourceIds", visibility=["read", "create", "update", "delete", "query"]) """The id of the resource to be exported. Required.""" - resource_name: Optional[str] = rest_field(name="resourceName") + resource_name: Optional[str] = rest_field( + name="resourceName", visibility=["read", "create", "update", "delete", "query"] + ) """The Terraform resource name. Only works when ``resourceIds`` contains only one item.""" - resource_type: Optional[str] = rest_field(name="resourceType") + resource_type: Optional[str] = rest_field( + name="resourceType", visibility=["read", "create", "update", "delete", "query"] + ) """The Terraform resource type. Only works when ``resourceIds`` contains only one item.""" - name_pattern: Optional[str] = rest_field(name="namePattern") + name_pattern: Optional[str] = rest_field( + name="namePattern", visibility=["read", "create", "update", "delete", "query"] + ) """The name pattern of the Terraform resources.""" - type: Literal[Type.EXPORT_RESOURCE] = rest_discriminator(name="type") # type: ignore + type: Literal[Type.EXPORT_RESOURCE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The parameter type. Required.""" @overload @@ -273,8 +293,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ExportResourceGroup(BaseExportModel, discriminator="ExportResourceGroup"): """Export parameter for a resource group. - All required parameters must be populated in order to send to server. - :ivar target_provider: The target Azure Terraform Provider. Known values are: "azurerm" and "azapi". :vartype target_provider: str or ~azure.mgmt.terraform.models.TargetProvider @@ -291,11 +309,15 @@ class ExportResourceGroup(BaseExportModel, discriminator="ExportResourceGroup"): :vartype type: str or ~azure.mgmt.terraform.models.EXPORT_RESOURCE_GROUP """ - resource_group_name: str = rest_field(name="resourceGroupName") + resource_group_name: str = rest_field( + name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"] + ) """The name of the resource group to be exported. Required.""" - name_pattern: Optional[str] = rest_field(name="namePattern") + name_pattern: Optional[str] = rest_field( + name="namePattern", visibility=["read", "create", "update", "delete", "query"] + ) """The name pattern of the Terraform resources.""" - type: Literal[Type.EXPORT_RESOURCE_GROUP] = rest_discriminator(name="type") # type: ignore + type: Literal[Type.EXPORT_RESOURCE_GROUP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The parameter type. Required.""" @overload @@ -325,6 +347,9 @@ class ExportResult(_model_base.Model): :ivar configuration: The Terraform configuration content. :vartype configuration: str + :ivar import_property: The Terraform import blocks for the current export, which users can use + to run "terraform plan" with to import the resources. + :vartype import_property: str :ivar skipped_resources: A list of Azure resources which are not exported to Terraform due to there is no corresponding resources in Terraform. :vartype skipped_resources: list[str] @@ -332,12 +357,21 @@ class ExportResult(_model_base.Model): :vartype errors: list[~azure.mgmt.terraform.models.ErrorDetail] """ - configuration: Optional[str] = rest_field() + configuration: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The Terraform configuration content.""" - skipped_resources: Optional[List[str]] = rest_field(name="skippedResources") + import_property: Optional[str] = rest_field( + name="import", visibility=["read", "create", "update", "delete", "query"] + ) + """The Terraform import blocks for the current export, which users can use to run \"terraform + plan\" with to import the resources.""" + skipped_resources: Optional[List[str]] = rest_field( + name="skippedResources", visibility=["read", "create", "update", "delete", "query"] + ) """A list of Azure resources which are not exported to Terraform due to there is no corresponding resources in Terraform.""" - errors: Optional[List["_models.ErrorDetail"]] = rest_field() + errors: Optional[List["_models.ErrorDetail"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """A list of errors derived during exporting each resource.""" @overload @@ -345,6 +379,7 @@ def __init__( self, *, configuration: Optional[str] = None, + import_property: Optional[str] = None, skipped_resources: Optional[List[str]] = None, errors: Optional[List["_models.ErrorDetail"]] = None, ) -> None: ... @@ -363,8 +398,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class Operation(_model_base.Model): """Details of a REST API operation, returned from the Resource Provider Operations API. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". :vartype name: str @@ -389,13 +422,15 @@ 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.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.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.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\"""" @@ -403,7 +438,7 @@ class Operation(_model_base.Model): def __init__( self, *, - action_type: Optional[Union[str, "_models.ActionType"]] = None, + display: Optional["_models.OperationDisplay"] = None, ) -> None: ... @overload @@ -420,8 +455,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OperationDisplay(_model_base.Model): """Localized display information for and operation. - Readonly variables are only populated by the server, and will be ignored when sending a request. - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". :vartype provider: str @@ -453,9 +486,6 @@ class OperationDisplay(_model_base.Model): class TerraformOperationStatus(_model_base.Model): """The status of the LRO operation. - Readonly variables are only populated by the server, and will be ignored when sending a request. - - :ivar properties: RP-specific properties for the operationStatus resource, only appears when operation ended with Succeeded status. :vartype properties: ~azure.mgmt.terraform.models.ExportResult @@ -477,7 +507,9 @@ class TerraformOperationStatus(_model_base.Model): properties: Optional["_models.ExportResult"] = rest_field(visibility=["read"]) """RP-specific properties for the operationStatus resource, only appears when operation ended with Succeeded status.""" - status: Union[str, "_models.ResourceProvisioningState"] = rest_field() + status: Union[str, "_models.ResourceProvisioningState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) """The operation status. Required. Known values are: \"Succeeded\", \"Failed\", and \"Canceled\".""" name: Optional[str] = rest_field(visibility=["read"]) """The name of the operationStatus resource.""" diff --git a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/operations/_operations.py b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/operations/_operations.py index 82d24f5d80a9..6a0d3d9878e3 100644 --- a/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/operations/_operations.py +++ b/sdk/terraform/azure-mgmt-terraform/azure/mgmt/terraform/operations/_operations.py @@ -11,6 +11,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, @@ -31,8 +32,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 TerraformMgmtClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -104,10 +106,10 @@ class Operations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: TerraformMgmtClientConfiguration = 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.Operation"]: @@ -185,7 +187,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 @@ -205,10 +207,10 @@ class TerraformOperations: 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: TerraformMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") def _export_terraform_initial( self, body: Union[_models.BaseExportModel, JSON, IO[bytes]], **kwargs: Any @@ -260,7 +262,7 @@ def _export_terraform_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 = {} diff --git a/sdk/terraform/azure-mgmt-terraform/generated_tests/test_terraform_mgmt_terraform_operations.py b/sdk/terraform/azure-mgmt-terraform/generated_tests/test_terraform_mgmt_terraform_operations.py index ab3196692f43..add3ea8e096b 100644 --- a/sdk/terraform/azure-mgmt-terraform/generated_tests/test_terraform_mgmt_terraform_operations.py +++ b/sdk/terraform/azure-mgmt-terraform/generated_tests/test_terraform_mgmt_terraform_operations.py @@ -25,10 +25,12 @@ def test_terraform_begin_export_terraform(self, resource_group): body={ "query": "str", "type": "ExportQuery", + "authorizationScopeFilter": "str", "fullProperties": bool, "maskSensitive": bool, "namePattern": "str", "recursive": bool, + "table": "str", "targetProvider": "str", }, ).result() # call '.result()' to poll until service return final result diff --git a/sdk/terraform/azure-mgmt-terraform/generated_tests/test_terraform_mgmt_terraform_operations_async.py b/sdk/terraform/azure-mgmt-terraform/generated_tests/test_terraform_mgmt_terraform_operations_async.py index efd043adfd14..ab78356b420a 100644 --- a/sdk/terraform/azure-mgmt-terraform/generated_tests/test_terraform_mgmt_terraform_operations_async.py +++ b/sdk/terraform/azure-mgmt-terraform/generated_tests/test_terraform_mgmt_terraform_operations_async.py @@ -27,10 +27,12 @@ async def test_terraform_begin_export_terraform(self, resource_group): body={ "query": "str", "type": "ExportQuery", + "authorizationScopeFilter": "str", "fullProperties": bool, "maskSensitive": bool, "namePattern": "str", "recursive": bool, + "table": "str", "targetProvider": "str", }, ) diff --git a/sdk/terraform/azure-mgmt-terraform/setup.py b/sdk/terraform/azure-mgmt-terraform/setup.py index eebf3c3c8cff..8aa3e22191c7 100644 --- a/sdk/terraform/azure-mgmt-terraform/setup.py +++ b/sdk/terraform/azure-mgmt-terraform/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/terraform/azure-mgmt-terraform/tsp-location.yaml b/sdk/terraform/azure-mgmt-terraform/tsp-location.yaml index a944e5473578..38d4549010b1 100644 --- a/sdk/terraform/azure-mgmt-terraform/tsp-location.yaml +++ b/sdk/terraform/azure-mgmt-terraform/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/terraform/Microsoft.AzureTerraform.Management -commit: ed3e7186654df4ec286c3d92f03dfa6c14b37279 +commit: 8f6744026f8f69f599f4713dadf1109f04e23a31 repo: Azure/azure-rest-api-specs additionalDirectories: