Skip to content

Commit 6fc8c6e

Browse files
generate from typespec
1 parent 531e393 commit 6fc8c6e

File tree

55 files changed

+17606
-6025
lines changed

Some content is hidden

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

55 files changed

+17606
-6025
lines changed
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
2+
"apiVersion": "2024-11-01",
23
"commit": "6539401b58d326bc975e91645102bbe09dd747c8",
34
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=D:\\spec-config\\azure-sdk-for-python\\sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/readme.md"
5+
"typespec_src": "specification/domainregistration/DomainRegistration.Management",
6+
"emitterVersion": "0.52.1"
117
}

sdk/domainregistration/azure-mgmt-domainregistration/apiview-properties.json

Lines changed: 84 additions & 86 deletions
Large diffs are not rendered by default.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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
# pylint: disable=wrong-import-position
@@ -12,7 +12,7 @@
1212
if TYPE_CHECKING:
1313
from ._patch import * # pylint: disable=unused-wildcard-import
1414

15-
from ._web_site_management_client import WebSiteManagementClient # type: ignore
15+
from ._client import DomainRegistrationClient # type: ignore
1616
from ._version import VERSION
1717

1818
__version__ = VERSION
@@ -25,7 +25,7 @@
2525
from ._patch import patch_sdk as _patch_sdk
2626

2727
__all__ = [
28-
"WebSiteManagementClient",
28+
"DomainRegistrationClient",
2929
]
3030
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
3131

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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

@@ -17,8 +17,7 @@
1717
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1818
from azure.mgmt.core.tools import get_arm_endpoints
1919

20-
from . import models as _models
21-
from ._configuration import WebSiteManagementClientConfiguration
20+
from ._configuration import DomainRegistrationClientConfiguration
2221
from ._utils.serialization import Deserializer, Serializer
2322
from .operations import DomainRegistrationProviderOperations, DomainsOperations, TopLevelDomainsOperations
2423

@@ -27,27 +26,27 @@
2726
from azure.core.credentials import TokenCredential
2827

2928

30-
class WebSiteManagementClient:
31-
"""Domain Registration Client.
29+
class DomainRegistrationClient:
30+
"""DomainRegistrationClient.
3231
33-
:ivar domain_registration_provider: DomainRegistrationProviderOperations operations
34-
:vartype domain_registration_provider:
35-
azure.mgmt.domainregistration.operations.DomainRegistrationProviderOperations
3632
:ivar domains: DomainsOperations operations
3733
:vartype domains: azure.mgmt.domainregistration.operations.DomainsOperations
3834
:ivar top_level_domains: TopLevelDomainsOperations operations
3935
:vartype top_level_domains: azure.mgmt.domainregistration.operations.TopLevelDomainsOperations
40-
:param credential: Credential needed for the client to connect to Azure. Required.
36+
:ivar domain_registration_provider: DomainRegistrationProviderOperations operations
37+
:vartype domain_registration_provider:
38+
azure.mgmt.domainregistration.operations.DomainRegistrationProviderOperations
39+
:param credential: Credential used to authenticate requests to the service. Required.
4140
:type credential: ~azure.core.credentials.TokenCredential
42-
:param subscription_id: The ID of the target subscription. Required.
41+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4342
:type subscription_id: str
44-
:param base_url: Service URL. Default value is None.
43+
:param base_url: Service host. Default value is None.
4544
:type base_url: str
4645
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
4746
None.
4847
:paramtype cloud_setting: ~azure.core.AzureClouds
49-
:keyword api_version: Api Version. Default value is "2024-11-01". Note that overriding this
50-
default value may result in unsupported behavior.
48+
:keyword api_version: The API version to use for this operation. Default value is "2024-11-01".
49+
Note that overriding this default value may result in unsupported behavior.
5150
:paramtype api_version: str
5251
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
5352
Retry-After header is present.
@@ -62,14 +61,16 @@ def __init__(
6261
cloud_setting: Optional["AzureClouds"] = None,
6362
**kwargs: Any
6463
) -> None:
64+
_endpoint = "{endpoint}"
6565
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
6666
_endpoints = get_arm_endpoints(_cloud)
6767
if not base_url:
6868
base_url = _endpoints["resource_manager"]
6969
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
70-
self._config = WebSiteManagementClientConfiguration(
70+
self._config = DomainRegistrationClientConfiguration(
7171
credential=credential,
7272
subscription_id=subscription_id,
73+
base_url=cast(str, base_url),
7374
cloud_setting=cloud_setting,
7475
credential_scopes=credential_scopes,
7576
**kwargs
@@ -93,27 +94,26 @@ def __init__(
9394
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
9495
self._config.http_logging_policy,
9596
]
96-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
97+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
9798

98-
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
99-
self._serialize = Serializer(client_models)
100-
self._deserialize = Deserializer(client_models)
99+
self._serialize = Serializer()
100+
self._deserialize = Deserializer()
101101
self._serialize.client_side_validation = False
102-
self.domain_registration_provider = DomainRegistrationProviderOperations(
103-
self._client, self._config, self._serialize, self._deserialize
104-
)
105102
self.domains = DomainsOperations(self._client, self._config, self._serialize, self._deserialize)
106103
self.top_level_domains = TopLevelDomainsOperations(
107104
self._client, self._config, self._serialize, self._deserialize
108105
)
106+
self.domain_registration_provider = DomainRegistrationProviderOperations(
107+
self._client, self._config, self._serialize, self._deserialize
108+
)
109109

110-
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
110+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
111111
"""Runs the network request through the client's chained policies.
112112
113113
>>> from azure.core.rest import HttpRequest
114114
>>> request = HttpRequest("GET", "https://www.example.org/")
115115
<HttpRequest [GET], url: 'https://www.example.org/'>
116-
>>> response = client._send_request(request)
116+
>>> response = client.send_request(request)
117117
<HttpResponse: 200 OK>
118118
119119
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -126,7 +126,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
126126
"""
127127

128128
request_copy = deepcopy(request)
129-
request_copy.url = self._client.format_url(request_copy.url)
129+
path_format_arguments = {
130+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
131+
}
132+
133+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
130134
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
131135

132136
def close(self) -> None:

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

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

@@ -18,28 +18,31 @@
1818
from azure.core.credentials import TokenCredential
1919

2020

21-
class WebSiteManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
22-
"""Configuration for WebSiteManagementClient.
21+
class DomainRegistrationClientConfiguration: # pylint: disable=too-many-instance-attributes
22+
"""Configuration for DomainRegistrationClient.
2323
2424
Note that all parameters used to create this instance are saved as instance
2525
attributes.
2626
27-
:param credential: Credential needed for the client to connect to Azure. Required.
27+
:param credential: Credential used to authenticate requests to the service. Required.
2828
:type credential: ~azure.core.credentials.TokenCredential
29-
:param subscription_id: The ID of the target subscription. Required.
29+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3030
:type subscription_id: str
31+
:param base_url: Service host. Default value is "https://management.azure.com".
32+
:type base_url: str
3133
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
3234
None.
3335
:type cloud_setting: ~azure.core.AzureClouds
34-
:keyword api_version: Api Version. Default value is "2024-11-01". Note that overriding this
35-
default value may result in unsupported behavior.
36+
:keyword api_version: The API version to use for this operation. Default value is "2024-11-01".
37+
Note that overriding this default value may result in unsupported behavior.
3638
:paramtype api_version: str
3739
"""
3840

3941
def __init__(
4042
self,
4143
credential: "TokenCredential",
4244
subscription_id: str,
45+
base_url: str = "https://management.azure.com",
4346
cloud_setting: Optional["AzureClouds"] = None,
4447
**kwargs: Any
4548
) -> None:
@@ -52,6 +55,7 @@ def __init__(
5255

5356
self.credential = credential
5457
self.subscription_id = subscription_id
58+
self.base_url = base_url
5559
self.cloud_setting = cloud_setting
5660
self.api_version = api_version
5761
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# --------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# Code generated by Microsoft (R) AutoRest Code Generator.
4+
# Code generated by Microsoft (R) Python Code Generator.
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)