22# --------------------------------------------------------------------------
33# Copyright (c) Microsoft Corporation. All rights reserved.
44# Licensed under the MIT License. See License.txt in the project root for license information.
5- # Code generated by Microsoft (R) AutoRest Code Generator.
5+ # Code generated by Microsoft (R) Python Code Generator.
66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING
11+ from typing_extensions import Self
1112
13+ from azure .core .pipeline import policies
1214from azure .core .rest import HttpRequest , HttpResponse
1315from azure .mgmt .core import ARMPipelineClient
16+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1417
15- from . import models as _models
1618from ._configuration import PlaywrightTestingMgmtClientConfiguration
1719from ._serialization import Deserializer , Serializer
18- from .operations import AccountsOperations , Operations , QuotasOperations
20+ from .operations import AccountQuotasOperations , AccountsOperations , Operations , QuotasOperations
1921
2022if TYPE_CHECKING :
21- # pylint: disable=unused-import,ungrouped-imports
2223 from azure .core .credentials import TokenCredential
2324
2425
25- class PlaywrightTestingMgmtClient : # pylint: disable=client-accepts-api-version-keyword
26- """Azure Playwright testing management service .
26+ class PlaywrightTestingMgmtClient :
27+ """Microsoft.AzurePlaywrightService Resource Provider Management API .
2728
2829 :ivar operations: Operations operations
2930 :vartype operations: azure.mgmt.playwrighttesting.operations.Operations
3031 :ivar accounts: AccountsOperations operations
3132 :vartype accounts: azure.mgmt.playwrighttesting.operations.AccountsOperations
3233 :ivar quotas: QuotasOperations operations
3334 :vartype quotas: azure.mgmt.playwrighttesting.operations.QuotasOperations
34- :param credential: Credential needed for the client to connect to Azure. Required.
35+ :ivar account_quotas: AccountQuotasOperations operations
36+ :vartype account_quotas: azure.mgmt.playwrighttesting.operations.AccountQuotasOperations
37+ :param credential: Credential used to authenticate requests to the service. Required.
3538 :type credential: ~azure.core.credentials.TokenCredential
36- :param subscription_id: The ID of the target subscription. Required.
39+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3740 :type subscription_id: str
38- :param base_url: Service URL . Default value is "https://management.azure.com".
41+ :param base_url: Service host . Default value is "https://management.azure.com".
3942 :type base_url: str
40- :keyword api_version: Api Version . Default value is "2023-10 -01-preview". Note that overriding
41- this default value may result in unsupported behavior.
43+ :keyword api_version: The API version to use for this operation . Default value is "2024-12 -01".
44+ Note that overriding this default value may result in unsupported behavior.
4245 :paramtype api_version: str
4346 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4447 Retry-After header is present.
@@ -51,26 +54,45 @@ def __init__(
5154 base_url : str = "https://management.azure.com" ,
5255 ** kwargs : Any
5356 ) -> None :
57+ _endpoint = "{endpoint}"
5458 self ._config = PlaywrightTestingMgmtClientConfiguration (
55- credential = credential , subscription_id = subscription_id , ** kwargs
59+ credential = credential , subscription_id = subscription_id , base_url = base_url , ** kwargs
5660 )
57- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
58-
59- client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
60- self ._serialize = Serializer (client_models )
61- self ._deserialize = Deserializer (client_models )
61+ _policies = kwargs .pop ("policies" , None )
62+ if _policies is None :
63+ _policies = [
64+ policies .RequestIdPolicy (** kwargs ),
65+ self ._config .headers_policy ,
66+ self ._config .user_agent_policy ,
67+ self ._config .proxy_policy ,
68+ policies .ContentDecodePolicy (** kwargs ),
69+ ARMAutoResourceProviderRegistrationPolicy (),
70+ self ._config .redirect_policy ,
71+ self ._config .retry_policy ,
72+ self ._config .authentication_policy ,
73+ self ._config .custom_hook_policy ,
74+ self ._config .logging_policy ,
75+ policies .DistributedTracingPolicy (** kwargs ),
76+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
77+ self ._config .http_logging_policy ,
78+ ]
79+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
80+
81+ self ._serialize = Serializer ()
82+ self ._deserialize = Deserializer ()
6283 self ._serialize .client_side_validation = False
6384 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
6485 self .accounts = AccountsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
6586 self .quotas = QuotasOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
87+ self .account_quotas = AccountQuotasOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
6688
67- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
89+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
6890 """Runs the network request through the client's chained policies.
6991
7092 >>> from azure.core.rest import HttpRequest
7193 >>> request = HttpRequest("GET", "https://www.example.org/")
7294 <HttpRequest [GET], url: 'https://www.example.org/'>
73- >>> response = client._send_request (request)
95+ >>> response = client.send_request (request)
7496 <HttpResponse: 200 OK>
7597
7698 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -83,13 +105,17 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
83105 """
84106
85107 request_copy = deepcopy (request )
86- request_copy .url = self ._client .format_url (request_copy .url )
87- return self ._client .send_request (request_copy , ** kwargs )
108+ path_format_arguments = {
109+ "endpoint" : self ._serialize .url ("self._config.base_url" , self ._config .base_url , "str" , skip_quote = True ),
110+ }
111+
112+ request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
113+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
88114
89115 def close (self ) -> None :
90116 self ._client .close ()
91117
92- def __enter__ (self ) -> "PlaywrightTestingMgmtClient" :
118+ def __enter__ (self ) -> Self :
93119 self ._client .__enter__ ()
94120 return self
95121
0 commit comments