Skip to content

Commit 231cc94

Browse files
author
SDKAuto
committed
CodeGen from PR 3577 in test-repo-billy/azure-rest-api-specs
Merge 562fb1af0d7f7c98dbf1aaf024f56821896ef70c into 12b6b0a52d97b23a3732f66d80c77aa45bf83a1e
1 parent cb0221a commit 231cc94

File tree

1,003 files changed

+1513579
-3906
lines changed

Some content is hidden

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

1,003 files changed

+1513579
-3906
lines changed

sdk/appservice/azure-mgmt-web/_meta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"commit": "ff7b8e12e78b352561e2e470dd045be310a313fa",
3-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
2+
"commit": "576df3041a85f90ff55503462d927d7b21d72f8b",
3+
"repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.26.4",
6+
"@autorest/python@6.27.4",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/web/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/python@6.26.4 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/web/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/python@6.27.4 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/web/resource-manager/readme.md",
1111
"package-2023-01": "fatal: invalid object name 'from'. from: WebApps.json",
1212
"package-2022-09": "fatal: invalid object name 'from'. from: WebApps.json",

sdk/appservice/azure-mgmt-web/azure/mgmt/web/_serialization.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def _create_xml_node(tag, prefix=None, ns=None):
309309
return ET.Element(tag)
310310

311311

312-
class Model(object):
312+
class Model:
313313
"""Mixin for all client request body/response body models to support
314314
serialization and deserialization.
315315
"""
@@ -562,7 +562,7 @@ def _decode_attribute_map_key(key):
562562
return key.replace("\\.", ".")
563563

564564

565-
class Serializer(object): # pylint: disable=too-many-public-methods
565+
class Serializer: # pylint: disable=too-many-public-methods
566566
"""Request object model serializer."""
567567

568568
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -1440,7 +1440,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
14401440
return children[0]
14411441

14421442

1443-
class Deserializer(object):
1443+
class Deserializer:
14441444
"""Response object model deserializer.
14451445
14461446
:param dict classes: Class type dictionary for deserializing complex types.
@@ -1682,17 +1682,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
16821682
subtype = getattr(response, "_subtype_map", {})
16831683
try:
16841684
readonly = [
1685-
k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access
1685+
k
1686+
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
1687+
if v.get("readonly")
16861688
]
16871689
const = [
1688-
k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
1690+
k
1691+
for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
1692+
if v.get("constant")
16891693
]
16901694
kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
16911695
response_obj = response(**kwargs)
16921696
for attr in readonly:
16931697
setattr(response_obj, attr, attrs.get(attr))
16941698
if additional_properties:
1695-
response_obj.additional_properties = additional_properties
1699+
response_obj.additional_properties = additional_properties # type: ignore
16961700
return response_obj
16971701
except TypeError as err:
16981702
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore

sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(
9898
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
9999
self._config.http_logging_policy,
100100
]
101-
self._client = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
101+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
102102
super(WebSiteManagementClient, self).__init__(
103103
api_version=api_version,
104104
profile=profile

sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(
9898
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
9999
self._config.http_logging_policy,
100100
]
101-
self._client = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
101+
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
102102
super(WebSiteManagementClient, self).__init__(
103103
api_version=api_version,
104104
profile=profile
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
9+
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._web_site_management_client import WebSiteManagementClient # type: ignore
16+
from ._version import VERSION
17+
18+
__version__ = VERSION
19+
20+
try:
21+
from ._patch import __all__ as _patch_all
22+
from ._patch import *
23+
except ImportError:
24+
_patch_all = []
25+
from ._patch import patch_sdk as _patch_sdk
26+
27+
__all__ = [
28+
"WebSiteManagementClient",
29+
]
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
31+
32+
_patch_sdk()
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import Any, TYPE_CHECKING
10+
11+
from azure.core.pipeline import policies
12+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
13+
14+
from ._version import VERSION
15+
16+
if TYPE_CHECKING:
17+
from azure.core.credentials import TokenCredential
18+
19+
20+
class WebSiteManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
21+
"""Configuration for WebSiteManagementClient.
22+
23+
Note that all parameters used to create this instance are saved as instance
24+
attributes.
25+
26+
:param credential: Credential needed for the client to connect to Azure. Required.
27+
:type credential: ~azure.core.credentials.TokenCredential
28+
:param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g.
29+
00000000-0000-0000-0000-000000000000). Required.
30+
:type subscription_id: str
31+
:keyword api_version: Api Version. Default value is "2015-04-01". Note that overriding this
32+
default value may result in unsupported behavior.
33+
:paramtype api_version: str
34+
"""
35+
36+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
37+
api_version: str = kwargs.pop("api_version", "2015-04-01")
38+
39+
if credential is None:
40+
raise ValueError("Parameter 'credential' must not be None.")
41+
if subscription_id is None:
42+
raise ValueError("Parameter 'subscription_id' must not be None.")
43+
44+
self.credential = credential
45+
self.subscription_id = subscription_id
46+
self.api_version = api_version
47+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
48+
kwargs.setdefault("sdk_moniker", "mgmt-web/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
50+
self._configure(**kwargs)
51+
52+
def _configure(self, **kwargs: Any) -> None:
53+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
54+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
55+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
56+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
57+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
58+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
59+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
61+
self.authentication_policy = kwargs.get("authentication_policy")
62+
if self.credential and not self.authentication_policy:
63+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
64+
self.credential, *self.credential_scopes, **kwargs
65+
)
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"chosen_version": "2015-04-01",
3+
"total_api_version_list": ["2015-04-01"],
4+
"client": {
5+
"name": "WebSiteManagementClient",
6+
"filename": "_web_site_management_client",
7+
"description": "WebSite Management Client.",
8+
"host_value": "\"https://management.azure.com\"",
9+
"parameterized_host_template": null,
10+
"azure_arm": true,
11+
"has_public_lro_operations": true,
12+
"client_side_validation": false,
13+
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"WebSiteManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
14+
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"WebSiteManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
15+
},
16+
"global_parameters": {
17+
"sync": {
18+
"credential": {
19+
"signature": "credential: \"TokenCredential\",",
20+
"description": "Credential needed for the client to connect to Azure. Required.",
21+
"docstring_type": "~azure.core.credentials.TokenCredential",
22+
"required": true,
23+
"method_location": "positional"
24+
},
25+
"subscription_id": {
26+
"signature": "subscription_id: str,",
27+
"description": "Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). Required.",
28+
"docstring_type": "str",
29+
"required": true,
30+
"method_location": "positional"
31+
}
32+
},
33+
"async": {
34+
"credential": {
35+
"signature": "credential: \"AsyncTokenCredential\",",
36+
"description": "Credential needed for the client to connect to Azure. Required.",
37+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
38+
"required": true
39+
},
40+
"subscription_id": {
41+
"signature": "subscription_id: str,",
42+
"description": "Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). Required.",
43+
"docstring_type": "str",
44+
"required": true
45+
}
46+
},
47+
"constant": {
48+
},
49+
"call": "credential, subscription_id",
50+
"service_client_specific": {
51+
"sync": {
52+
"api_version": {
53+
"signature": "api_version: Optional[str]=None,",
54+
"description": "API version to use if no profile is provided, or if missing in profile.",
55+
"docstring_type": "str",
56+
"required": false,
57+
"method_location": "positional"
58+
},
59+
"base_url": {
60+
"signature": "base_url: str = \"https://management.azure.com\",",
61+
"description": "Service URL",
62+
"docstring_type": "str",
63+
"required": false,
64+
"method_location": "positional"
65+
},
66+
"profile": {
67+
"signature": "profile: KnownProfiles=KnownProfiles.default,",
68+
"description": "A profile definition, from KnownProfiles to dict.",
69+
"docstring_type": "azure.profiles.KnownProfiles",
70+
"required": false,
71+
"method_location": "positional"
72+
}
73+
},
74+
"async": {
75+
"api_version": {
76+
"signature": "api_version: Optional[str] = None,",
77+
"description": "API version to use if no profile is provided, or if missing in profile.",
78+
"docstring_type": "str",
79+
"required": false,
80+
"method_location": "positional"
81+
},
82+
"base_url": {
83+
"signature": "base_url: str = \"https://management.azure.com\",",
84+
"description": "Service URL",
85+
"docstring_type": "str",
86+
"required": false,
87+
"method_location": "positional"
88+
},
89+
"profile": {
90+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
91+
"description": "A profile definition, from KnownProfiles to dict.",
92+
"docstring_type": "azure.profiles.KnownProfiles",
93+
"required": false,
94+
"method_location": "positional"
95+
}
96+
}
97+
}
98+
},
99+
"config": {
100+
"credential": true,
101+
"credential_scopes": ["https://management.azure.com/.default"],
102+
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
103+
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
104+
"sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
105+
"async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
106+
},
107+
"operation_groups": {
108+
"domains": "DomainsOperations",
109+
"top_level_domains": "TopLevelDomainsOperations",
110+
"domain_registration_provider": "DomainRegistrationProviderOperations"
111+
}
112+
}
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+
"""
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
VERSION = "0.42.0"

0 commit comments

Comments
 (0)