Skip to content

Commit cc59db2

Browse files
[AutoRelease] t2-playwrighttesting-2024-12-16-49641(can only be merged by SDK owner) (Azure#38890)
* code and test * Update CHANGELOG.md * update testcases --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 25dc58f commit cc59db2

File tree

54 files changed

+6382
-3654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+6382
-3654
lines changed

sdk/playwrighttesting/azure-mgmt-playwrighttesting/CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
11
# Release History
22

3+
## 1.0.0 (2024-12-18)
4+
5+
### Features Added
6+
7+
- Client `PlaywrightTestingMgmtClient` added method `send_request`
8+
- Client `PlaywrightTestingMgmtClient` added operation group `account_quotas`
9+
- Model `AccountProperties` added property `local_auth`
10+
- Model `AccountUpdateProperties` added property `local_auth`
11+
- Enum `FreeTrialState` added member `NOT_ELIGIBLE`
12+
- Enum `FreeTrialState` added member `NOT_REGISTERED`
13+
- Enum `ProvisioningState` added member `CREATING`
14+
- Enum `QuotaNames` added member `REPORTING`
15+
- Model `QuotaProperties` added property `offering_type`
16+
- Added model `AccountFreeTrialProperties`
17+
- Added model `AccountQuota`
18+
- Added model `AccountQuotaProperties`
19+
- Added enum `CheckNameAvailabilityReason`
20+
- Added model `CheckNameAvailabilityRequest`
21+
- Added model `CheckNameAvailabilityResponse`
22+
- Added enum `OfferingType`
23+
- Operation group `AccountsOperations` added method `check_name_availability`
24+
- Added operation group `AccountQuotasOperations`
25+
26+
### Breaking Changes
27+
28+
- Model `Account` deleted or renamed its instance variable `additional_properties`
29+
- Model `AccountProperties` deleted or renamed its instance variable `additional_properties`
30+
- Model `AccountUpdate` deleted or renamed its instance variable `additional_properties`
31+
- Model `AccountUpdateProperties` deleted or renamed its instance variable `additional_properties`
32+
- Model `ErrorAdditionalInfo` deleted or renamed its instance variable `additional_properties`
33+
- Model `ErrorDetail` deleted or renamed its instance variable `additional_properties`
34+
- Model `ErrorResponse` deleted or renamed its instance variable `additional_properties`
35+
- Model `FreeTrialProperties` deleted or renamed its instance variable `created_at`
36+
- Model `FreeTrialProperties` deleted or renamed its instance variable `expiry_at`
37+
- Model `FreeTrialProperties` deleted or renamed its instance variable `allocated_value`
38+
- Model `FreeTrialProperties` deleted or renamed its instance variable `used_value`
39+
- Model `FreeTrialProperties` deleted or renamed its instance variable `percentage_used`
40+
- Model `FreeTrialProperties` deleted or renamed its instance variable `additional_properties`
41+
- Model `Operation` deleted or renamed its instance variable `additional_properties`
42+
- Model `OperationDisplay` deleted or renamed its instance variable `additional_properties`
43+
- Model `ProxyResource` deleted or renamed its instance variable `additional_properties`
44+
- Model `Quota` deleted or renamed its instance variable `additional_properties`
45+
- Model `QuotaProperties` deleted or renamed its instance variable `additional_properties`
46+
- Model `Resource` deleted or renamed its instance variable `additional_properties`
47+
- Model `SystemData` deleted or renamed its instance variable `additional_properties`
48+
- Model `TrackedResource` deleted or renamed its instance variable `additional_properties`
49+
- Method `AccountsOperations.begin_create_or_update` renamed its parameter `name` to `account_name`
50+
- Method `AccountsOperations.begin_delete` renamed its parameter `name` to `account_name`
51+
- Method `AccountsOperations.get` renamed its parameter `name` to `account_name`
52+
- Method `AccountsOperations.update` renamed its parameter `name` to `account_name`
53+
- Method `QuotasOperations.get` renamed its parameter `name` to `quota_name`
54+
355
## 1.0.0b2 (2024-03-04)
456

557
### Features Added
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "51a6e410cf9752dfdaad71f0f9778645d737d8c4",
2+
"commit": "58740206b853320974ef5e4864f7be8120b15a27",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/playwrighttesting/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
10-
"readme": "specification/playwrighttesting/resource-manager/readme.md"
4+
"typespec_src": "specification/playwrighttesting/PlaywrightTesting.Management",
5+
"@azure-tools/typespec-python": "0.37.1"
116
}

sdk/playwrighttesting/azure-mgmt-playwrighttesting/assets.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
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
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._playwright_testing_mgmt_client import PlaywrightTestingMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import PlaywrightTestingMgmtClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"PlaywrightTestingMgmtClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()
Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,46 @@
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

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
1315
from azure.mgmt.core import ARMPipelineClient
16+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1417

15-
from . import models as _models
1618
from ._configuration import PlaywrightTestingMgmtClientConfiguration
1719
from ._serialization import Deserializer, Serializer
18-
from .operations import AccountsOperations, Operations, QuotasOperations
20+
from .operations import AccountQuotasOperations, AccountsOperations, Operations, QuotasOperations
1921

2022
if 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

sdk/playwrighttesting/azure-mgmt-playwrighttesting/azure/mgmt/playwrighttesting/_configuration.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,46 @@
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

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

1514
from ._version import VERSION
1615

1716
if TYPE_CHECKING:
18-
# pylint: disable=unused-import,ungrouped-imports
1917
from azure.core.credentials import TokenCredential
2018

2119

22-
class PlaywrightTestingMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
20+
class PlaywrightTestingMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes
2321
"""Configuration for PlaywrightTestingMgmtClient.
2422
2523
Note that all parameters used to create this instance are saved as instance
2624
attributes.
2725
28-
:param credential: Credential needed for the client to connect to Azure. Required.
26+
:param credential: Credential used to authenticate requests to the service. Required.
2927
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The ID of the target subscription. Required.
28+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3129
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-10-01-preview". Note that overriding
33-
this default value may result in unsupported behavior.
30+
:param base_url: Service host. Default value is "https://management.azure.com".
31+
:type base_url: str
32+
:keyword api_version: The API version to use for this operation. Default value is "2024-12-01".
33+
Note that overriding this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

37-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
super(PlaywrightTestingMgmtClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-10-01-preview")
37+
def __init__(
38+
self,
39+
credential: "TokenCredential",
40+
subscription_id: str,
41+
base_url: str = "https://management.azure.com",
42+
**kwargs: Any
43+
) -> None:
44+
api_version: str = kwargs.pop("api_version", "2024-12-01")
4045

4146
if credential is None:
4247
raise ValueError("Parameter 'credential' must not be None.")
@@ -45,9 +50,11 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4550

4651
self.credential = credential
4752
self.subscription_id = subscription_id
53+
self.base_url = base_url
4854
self.api_version = api_version
4955
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5056
kwargs.setdefault("sdk_moniker", "mgmt-playwrighttesting/{}".format(VERSION))
57+
self.polling_interval = kwargs.get("polling_interval", 30)
5158
self._configure(**kwargs)
5259

5360
def _configure(self, **kwargs: Any) -> None:
@@ -56,9 +63,9 @@ def _configure(self, **kwargs: Any) -> None:
5663
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5764
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5865
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
59-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6066
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6167
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
68+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6269
self.authentication_policy = kwargs.get("authentication_policy")
6370
if self.credential and not self.authentication_policy:
6471
self.authentication_policy = ARMChallengeAuthenticationPolicy(

0 commit comments

Comments
 (0)