Skip to content

Commit 3ccad7a

Browse files
author
SDKAuto
committed
CodeGen from PR 30980 in Azure/azure-rest-api-specs
Merge af08f354112856471cfb773eb9584a223720f282 into fcee3edac78a8afb8a402e4920c395998caf12fb
1 parent aa94cbe commit 3ccad7a

File tree

319 files changed

+501
-161188
lines changed

Some content is hidden

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

319 files changed

+501
-161188
lines changed

sdk/servicebus/azure-mgmt-servicebus/_meta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"commit": "690a7656d65a03b134fa44fc7bb8013dc18a15b5",
2+
"commit": "ae1d5690b2d8331c7a085d3452cfda2e9ea2e908",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
66
"@autorest/[email protected]",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/servicebus/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/servicebus/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/servicebus/resource-manager/readme.md",
1111
"package-2022-10-preview": "2023-04-13 07:43:12 +0530 9bc5a13776661d0bc699efadece14870e2846d7f Microsoft.ServiceBus/preview/2022-10-01-preview/migrationconfigs.json",
1212
"package-2022-01-preview": "2023-04-13 07:43:12 +0530 9bc5a13776661d0bc699efadece14870e2846d7f Microsoft.ServiceBus/preview/2022-01-01-preview/migrationconfigs.json",

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
# --------------------------------------------------------------------------
88

99
from ._service_bus_management_client import ServiceBusManagementClient
10-
11-
__all__ = ["ServiceBusManagementClient"]
10+
__all__ = ['ServiceBusManagementClient']
1211

1312
try:
1413
from ._patch import patch_sdk # type: ignore
15-
1614
patch_sdk()
1715
except ImportError:
1816
pass

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
# pylint: disable=unused-import,ungrouped-imports
2020
from azure.core.credentials import TokenCredential
2121

22-
2322
class ServiceBusManagementClientConfiguration:
2423
"""Configuration for ServiceBusManagementClient.
2524
@@ -32,30 +31,36 @@ class ServiceBusManagementClientConfiguration:
3231
:type subscription_id: str
3332
"""
3433

35-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any):
34+
def __init__(
35+
self,
36+
credential: "TokenCredential",
37+
subscription_id: str,
38+
**kwargs: Any
39+
):
3640
if credential is None:
3741
raise ValueError("Parameter 'credential' must not be None.")
3842
if subscription_id is None:
3943
raise ValueError("Parameter 'subscription_id' must not be None.")
4044

4145
self.credential = credential
4246
self.subscription_id = subscription_id
43-
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
44-
kwargs.setdefault("sdk_moniker", "azure-mgmt-servicebus/{}".format(VERSION))
47+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
48+
kwargs.setdefault('sdk_moniker', 'azure-mgmt-servicebus/{}'.format(VERSION))
4549
self.polling_interval = kwargs.get("polling_interval", 30)
4650
self._configure(**kwargs)
4751

48-
def _configure(self, **kwargs: Any):
49-
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
50-
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
51-
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
52-
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
53-
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
54-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
55-
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
56-
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
57-
self.authentication_policy = kwargs.get("authentication_policy")
52+
def _configure(
53+
self,
54+
**kwargs: Any
55+
):
56+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
57+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
58+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
59+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
60+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
61+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
62+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
63+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
64+
self.authentication_policy = kwargs.get('authentication_policy')
5865
if self.credential and not self.authentication_policy:
59-
self.authentication_policy = ARMChallengeAuthenticationPolicy(
60-
self.credential, *self.credential_scopes, **kwargs
61-
)
66+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/_serialization.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
351351
def as_dict(
352352
self,
353353
keep_readonly: bool = True,
354-
key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
354+
key_transformer: Callable[
355+
[str, Dict[str, Any], Any], Any
356+
] = attribute_transformer,
355357
**kwargs: Any
356358
) -> JSON:
357359
"""Return a dict that can be serialized using json.dump.
@@ -540,7 +542,7 @@ class Serializer(object):
540542
"multiple": lambda x, y: x % y != 0,
541543
}
542544

543-
def __init__(self, classes: Optional[Mapping[str, type]] = None):
545+
def __init__(self, classes: Optional[Mapping[str, type]]=None):
544546
self.serialize_type = {
545547
"iso-8601": Serializer.serialize_iso,
546548
"rfc-1123": Serializer.serialize_rfc,
@@ -748,7 +750,7 @@ def query(self, name, data, data_type, **kwargs):
748750
# Treat the list aside, since we don't want to encode the div separator
749751
if data_type.startswith("["):
750752
internal_data_type = data_type[1:-1]
751-
do_quote = not kwargs.get("skip_quote", False)
753+
do_quote = not kwargs.get('skip_quote', False)
752754
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
753755

754756
# Not a list, regular serialization
@@ -907,8 +909,12 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
907909
raise
908910
serialized.append(None)
909911

910-
if kwargs.get("do_quote", False):
911-
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
912+
if kwargs.get('do_quote', False):
913+
serialized = [
914+
'' if s is None else quote(str(s), safe='')
915+
for s
916+
in serialized
917+
]
912918

913919
if div:
914920
serialized = ["" if s is None else str(s) for s in serialized]
@@ -1365,7 +1371,7 @@ class Deserializer(object):
13651371

13661372
valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
13671373

1368-
def __init__(self, classes: Optional[Mapping[str, type]] = None):
1374+
def __init__(self, classes: Optional[Mapping[str, type]]=None):
13691375
self.deserialize_type = {
13701376
"iso-8601": Deserializer.deserialize_iso,
13711377
"rfc-1123": Deserializer.deserialize_rfc,

0 commit comments

Comments
 (0)