Skip to content

Commit cfd6e6a

Browse files
author
SDKAuto
committed
CodeGen from PR 20467 in Azure/azure-rest-api-specs
Merge 58153c4cc41140067071e0895c5e4484527f9b20 into 9366804c62e024801daf8a578924099ff644ccf6
1 parent d0f5c86 commit cfd6e6a

40 files changed

+12116
-6387
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.5",
2+
"commit": "307cc50c6ca925d51773420cde8de4e9365cf743",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.8.4",
5-
"@autorest/modelerfour@4.19.2"
6+
"@autorest/python@6.1.11",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "f6de239922d6b23e97750ca3f508ac55c1d2f235",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/webpubsub/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.4.5",
9+
"autorest_command": "autorest specification/webpubsub/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/webpubsub/resource-manager/readme.md"
1111
}

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['WebPubSubManagementClient']
1413

1514
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
1817
except ImportError:
19-
pass
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = ["WebPubSubManagementClient"]
22+
__all__.extend([p for p in _patch_all if p not in __all__])
23+
24+
_patch_sdk()

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

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,66 +6,65 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import TYPE_CHECKING
9+
from typing import Any, TYPE_CHECKING
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1414

1515
from ._version import VERSION
1616

1717
if TYPE_CHECKING:
1818
# pylint: disable=unused-import,ungrouped-imports
19-
from typing import Any
20-
2119
from azure.core.credentials import TokenCredential
2220

2321

24-
class WebPubSubManagementClientConfiguration(Configuration):
22+
class WebPubSubManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2523
"""Configuration for WebPubSubManagementClient.
2624
2725
Note that all parameters used to create this instance are saved as instance
2826
attributes.
2927
30-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
3129
:type credential: ~azure.core.credentials.TokenCredential
32-
:param subscription_id: Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
30+
:param subscription_id: Gets subscription Id which uniquely identify the Microsoft Azure
31+
subscription. The subscription ID forms part of the URI for every service call. Required.
3332
:type subscription_id: str
33+
:keyword api_version: Api Version. Default value is "2022-08-01-preview". Note that overriding
34+
this default value may result in unsupported behavior.
35+
:paramtype api_version: str
3436
"""
3537

36-
def __init__(
37-
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
38+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
39+
super(WebPubSubManagementClientConfiguration, self).__init__(**kwargs)
40+
api_version = kwargs.pop("api_version", "2022-08-01-preview") # type: str
41+
4342
if credential is None:
4443
raise ValueError("Parameter 'credential' must not be None.")
4544
if subscription_id is None:
4645
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(WebPubSubManagementClientConfiguration, self).__init__(**kwargs)
4846

4947
self.credential = credential
5048
self.subscription_id = subscription_id
51-
self.api_version = "2021-10-01"
52-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53-
kwargs.setdefault('sdk_moniker', 'mgmt-webpubsub/{}'.format(VERSION))
49+
self.api_version = api_version
50+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
51+
kwargs.setdefault("sdk_moniker", "mgmt-webpubsub/{}".format(VERSION))
5452
self._configure(**kwargs)
5553

5654
def _configure(
57-
self,
58-
**kwargs # type: Any
55+
self, **kwargs # type: Any
5956
):
6057
# type: (...) -> None
61-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
62-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
63-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
64-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
66-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
67-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
68-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
69-
self.authentication_policy = kwargs.get('authentication_policy')
58+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
59+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
60+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
61+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
62+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
63+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
64+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
65+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
66+
self.authentication_policy = kwargs.get("authentication_policy")
7067
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
68+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
69+
self.credential, *self.credential_scopes, **kwargs
70+
)

sdk/webpubsub/azure-mgmt-webpubsub/azure/mgmt/webpubsub/_metadata.json

Lines changed: 0 additions & 109 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
"""Customize generated code here.
6+
7+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8+
"""
9+
from typing import List
10+
11+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
12+
13+
14+
def patch_sdk():
15+
"""Do not remove from this file.
16+
17+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
18+
you can't accomplish using the techniques described in
19+
https://aka.ms/azsdk/python/dpcodegen/python/customize
20+
"""

0 commit comments

Comments
 (0)