diff --git a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/_meta.json b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/_meta.json index 9f176a81256b..86e21cbd7a5f 100644 --- a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/_meta.json +++ b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/_meta.json @@ -1,6 +1,6 @@ { - "commit": "58740206b853320974ef5e4864f7be8120b15a27", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "commit": "3cf4e3486139ea687e909cb85779d31ae2ebfc2d", + "repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs", "typespec_src": "specification/playwrighttesting/PlaywrightTesting.Management", - "@azure-tools/typespec-python": "0.37.1" + "@azure-tools/typespec-python": "0.38.2" } \ No newline at end of file diff --git a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/apiview-properties.json b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/apiview-properties.json new file mode 100644 index 000000000000..145fc25f4bbe --- /dev/null +++ b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/apiview-properties.json @@ -0,0 +1,47 @@ +{ + "CrossLanguagePackageId": "Microsoft.AzurePlaywrightService", + "CrossLanguageDefinitionId": { + "azure.mgmt.playwrighttesting.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.playwrighttesting.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.playwrighttesting.models.Account": "Microsoft.AzurePlaywrightService.Account", + "azure.mgmt.playwrighttesting.models.AccountFreeTrialProperties": "Microsoft.AzurePlaywrightService.AccountFreeTrialProperties", + "azure.mgmt.playwrighttesting.models.AccountProperties": "Microsoft.AzurePlaywrightService.AccountProperties", + "azure.mgmt.playwrighttesting.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.playwrighttesting.models.AccountQuota": "Microsoft.AzurePlaywrightService.AccountQuota", + "azure.mgmt.playwrighttesting.models.AccountQuotaProperties": "Microsoft.AzurePlaywrightService.AccountQuotaProperties", + "azure.mgmt.playwrighttesting.models.AccountUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.playwrighttesting.models.AccountUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.playwrighttesting.models.CheckNameAvailabilityRequest": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest", + "azure.mgmt.playwrighttesting.models.CheckNameAvailabilityResponse": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse", + "azure.mgmt.playwrighttesting.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.playwrighttesting.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.playwrighttesting.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.playwrighttesting.models.FreeTrialProperties": "Microsoft.AzurePlaywrightService.FreeTrialProperties", + "azure.mgmt.playwrighttesting.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.playwrighttesting.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.playwrighttesting.models.Quota": "Microsoft.AzurePlaywrightService.Quota", + "azure.mgmt.playwrighttesting.models.QuotaProperties": "Microsoft.AzurePlaywrightService.QuotaProperties", + "azure.mgmt.playwrighttesting.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.playwrighttesting.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.playwrighttesting.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.playwrighttesting.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.playwrighttesting.models.EnablementStatus": "Microsoft.AzurePlaywrightService.EnablementStatus", + "azure.mgmt.playwrighttesting.models.ProvisioningState": "Microsoft.AzurePlaywrightService.ProvisioningState", + "azure.mgmt.playwrighttesting.models.CheckNameAvailabilityReason": "Azure.ResourceManager.CommonTypes.CheckNameAvailabilityReason", + "azure.mgmt.playwrighttesting.models.FreeTrialState": "Microsoft.AzurePlaywrightService.FreeTrialState", + "azure.mgmt.playwrighttesting.models.OfferingType": "Microsoft.AzurePlaywrightService.OfferingType", + "azure.mgmt.playwrighttesting.models.QuotaNames": "Microsoft.AzurePlaywrightService.QuotaNames", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.accounts.get": "Azure.ResourceManager.Accounts.get", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.accounts.begin_create_or_update": "Microsoft.AzurePlaywrightService.Accounts.createOrUpdate", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.accounts.update": "Microsoft.AzurePlaywrightService.Accounts.update", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.accounts.begin_delete": "Microsoft.AzurePlaywrightService.Accounts.delete", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.accounts.list_by_resource_group": "Azure.ResourceManager.Accounts.listByResourceGroup", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.accounts.list_by_subscription": "Azure.ResourceManager.Accounts.listBySubscription", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.accounts.check_name_availability": "Microsoft.AzurePlaywrightService.Accounts.checkNameAvailability", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.quotas.get": "Microsoft.AzurePlaywrightService.Quotas.get", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.quotas.list_by_subscription": "Microsoft.AzurePlaywrightService.Quotas.listBySubscription", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.account_quotas.get": "Microsoft.AzurePlaywrightService.AccountQuotas.get", + "azure.mgmt.playwrighttesting.PlaywrightTestingMgmtClient.account_quotas.list_by_account": "Microsoft.AzurePlaywrightService.AccountQuotas.listByAccount" + } +} \ No newline at end of file diff --git a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_model_base.py b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_model_base.py index 7f73b97b23ef..3072ee252ed9 100644 --- a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_model_base.py +++ b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_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) @@ -910,6 +957,19 @@ def _failsafe_deserialize( 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/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_serialization.py b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_serialization.py index b24ab2885450..a066e16a64dd 100644 --- a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_serialization.py +++ b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_serialization.py @@ -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 @@ -480,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 @@ -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): @@ -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 """ @@ -1717,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 """ @@ -1799,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 @@ -1845,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 @@ -1936,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 @@ -1949,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 @@ -1964,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): @@ -1982,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 @@ -1995,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 @@ -2013,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 @@ -2029,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 @@ -2044,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) @@ -2067,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 @@ -2105,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/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_version.py b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_version.py index 0ec13ea52bbf..be71c81bd282 100644 --- a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_version.py +++ b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_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/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/aio/operations/_operations.py b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/aio/operations/_operations.py index 06bc8d6e1f7e..5d650635178d 100644 --- a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/aio/operations/_operations.py +++ b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/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, @@ -34,6 +35,7 @@ from ... import models as _models from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._serialization import Deserializer, Serializer from ...operations._operations import ( build_account_quotas_get_request, build_account_quotas_list_by_account_request, @@ -48,6 +50,7 @@ build_quotas_get_request, build_quotas_list_by_subscription_request, ) +from .._configuration import PlaywrightTestingMgmtClientConfiguration if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -70,10 +73,12 @@ class Operations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PlaywrightTestingMgmtClientConfiguration = ( + 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"]: @@ -171,10 +176,12 @@ class AccountsOperations: 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: PlaywrightTestingMgmtClientConfiguration = ( + 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, account_name: str, **kwargs: Any) -> _models.Account: @@ -1065,10 +1072,12 @@ class QuotasOperations: 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: PlaywrightTestingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get(self, location: str, quota_name: Union[str, _models.QuotaNames], **kwargs: Any) -> _models.Quota: @@ -1238,10 +1247,12 @@ class AccountQuotasOperations: 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: PlaywrightTestingMgmtClientConfiguration = ( + 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( diff --git a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/models/_models.py b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/models/_models.py index 60a82c26e314..866813d48b84 100644 --- a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/models/_models.py +++ b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/models/_models.py @@ -194,8 +194,8 @@ class AccountProperties(_model_base.Model): results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. Known values are: "Enabled" and "Disabled". :vartype reporting: str or ~azure.mgmt.playwrighttesting.models.EnablementStatus - :ivar local_auth: When enabled, this feature allows the workspace to use local auth(through - access key) for authentication of test runs. Known values are: "Enabled" and "Disabled". + :ivar local_auth: When enabled, this feature allows the workspace to use local auth (through + service access token) for executing operations. Known values are: "Enabled" and "Disabled". :vartype local_auth: str or ~azure.mgmt.playwrighttesting.models.EnablementStatus :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", "Failed", "Canceled", "Creating", "Deleting", and "Accepted". @@ -218,8 +218,8 @@ class AccountProperties(_model_base.Model): artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. Known values are: \"Enabled\" and \"Disabled\".""" local_auth: Optional[Union[str, "_models.EnablementStatus"]] = rest_field(name="localAuth") - """When enabled, this feature allows the workspace to use local auth(through access key) for - authentication of test runs. Known values are: \"Enabled\" and \"Disabled\".""" + """When enabled, this feature allows the workspace to use local auth (through service access + token) for executing operations. Known values are: \"Enabled\" and \"Disabled\".""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -395,8 +395,8 @@ class AccountUpdateProperties(_model_base.Model): results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. Known values are: "Enabled" and "Disabled". :vartype reporting: str or ~azure.mgmt.playwrighttesting.models.EnablementStatus - :ivar local_auth: When enabled, this feature allows the workspace to use local auth(through - access key) for authentication of test runs. Known values are: "Enabled" and "Disabled". + :ivar local_auth: When enabled, this feature allows the workspace to use local auth (through + service access token) for executing operations. Known values are: "Enabled" and "Disabled". :vartype local_auth: str or ~azure.mgmt.playwrighttesting.models.EnablementStatus """ @@ -414,8 +414,8 @@ class AccountUpdateProperties(_model_base.Model): artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. Known values are: \"Enabled\" and \"Disabled\".""" local_auth: Optional[Union[str, "_models.EnablementStatus"]] = rest_field(name="localAuth") - """When enabled, this feature allows the workspace to use local auth(through access key) for - authentication of test runs. Known values are: \"Enabled\" and \"Disabled\".""" + """When enabled, this feature allows the workspace to use local auth (through service access + token) for executing operations. Known values are: \"Enabled\" and \"Disabled\".""" @overload def __init__( diff --git a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/operations/_operations.py b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/operations/_operations.py index 07df81570497..a3c4864e6435 100644 --- a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/operations/_operations.py +++ b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/operations/_operations.py @@ -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 .._configuration import PlaywrightTestingMgmtClientConfiguration from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from .._serialization import Serializer +from .._serialization import Deserializer, Serializer if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -394,10 +396,12 @@ class Operations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: PlaywrightTestingMgmtClientConfiguration = ( + 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"]: @@ -495,10 +499,12 @@ class AccountsOperations: 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: PlaywrightTestingMgmtClientConfiguration = ( + 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, account_name: str, **kwargs: Any) -> _models.Account: @@ -1389,10 +1395,12 @@ class QuotasOperations: 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: PlaywrightTestingMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get(self, location: str, quota_name: Union[str, _models.QuotaNames], **kwargs: Any) -> _models.Quota: @@ -1562,10 +1570,12 @@ class AccountQuotasOperations: 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: PlaywrightTestingMgmtClientConfiguration = ( + 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( diff --git a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/tsp-location.yaml b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/tsp-location.yaml index 8883f3883170..9fd2d225abb7 100644 --- a/sdk/playwrighttesting/azure-mgmt-playwrighttesting/tsp-location.yaml +++ b/sdk/playwrighttesting/azure-mgmt-playwrighttesting/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/playwrighttesting/PlaywrightTesting.Management -commit: 58740206b853320974ef5e4864f7be8120b15a27 -repo: Azure/azure-rest-api-specs +commit: 3cf4e3486139ea687e909cb85779d31ae2ebfc2d +repo: test-repo-billy/azure-rest-api-specs additionalDirectories: