Skip to content

Commit 12147d7

Browse files
author
SDKAuto
committed
CodeGen from PR 30820 in Azure/azure-rest-api-specs
Merge a921d8d9a1640a97adddbd2900688bbfa27465a6 into e605d439dda724fc2fc0274e0a82a3434a1524d7
1 parent d594ee8 commit 12147d7

File tree

43 files changed

+5483
-6411
lines changed

Some content is hidden

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

43 files changed

+5483
-6411
lines changed
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
2-
"commit": "e6fde2ac19d0202f0e72217a3e0f9edb63dba273",
2+
"commit": "cf2870c3d6554ef0543db96283c8820cb9ed7c2b",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/codesigning/CodeSigning.Management",
5-
"@azure-tools/typespec-python": "0.33.0"
5+
"@azure-tools/typespec-python": "0.33.0",
6+
"autorest": "3.10.2",
7+
"use": [
8+
"@autorest/[email protected]",
9+
"@autorest/[email protected]"
10+
],
11+
"autorest_command": "autorest specification/codesigning/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",
12+
"readme": "specification/codesigning/resource-manager/readme.md"
613
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
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) Python Code Generator.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from ._client import TrustedSigningMgmtClient
9+
from ._code_signing_management_client import CodeSigningManagementClient
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
@@ -19,7 +19,7 @@
1919
from ._patch import patch_sdk as _patch_sdk
2020

2121
__all__ = [
22-
"TrustedSigningMgmtClient",
22+
"CodeSigningManagementClient",
2323
]
2424
__all__.extend([p for p in _patch_all if p not in __all__])
2525

sdk/trustedsigning/azure-mgmt-trustedsigning/azure/mgmt/trustedsigning/_client.py renamed to sdk/trustedsigning/azure-mgmt-trustedsigning/azure/mgmt/trustedsigning/_code_signing_management_client.py

Lines changed: 17 additions & 21 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) Python Code Generator.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

@@ -15,7 +15,8 @@
1515
from azure.mgmt.core import ARMPipelineClient
1616
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1717

18-
from ._configuration import TrustedSigningMgmtClientConfiguration
18+
from . import models as _models
19+
from ._configuration import CodeSigningManagementClientConfiguration
1920
from ._serialization import Deserializer, Serializer
2021
from .operations import CertificateProfilesOperations, CodeSigningAccountsOperations, Operations
2122

@@ -24,7 +25,7 @@
2425
from azure.core.credentials import TokenCredential
2526

2627

27-
class TrustedSigningMgmtClient: # pylint: disable=client-accepts-api-version-keyword
28+
class CodeSigningManagementClient: # pylint: disable=client-accepts-api-version-keyword
2829
"""Code Signing resource provider api.
2930
3031
:ivar operations: Operations operations
@@ -35,15 +36,14 @@ class TrustedSigningMgmtClient: # pylint: disable=client-accepts-api-version-ke
3536
:ivar certificate_profiles: CertificateProfilesOperations operations
3637
:vartype certificate_profiles:
3738
azure.mgmt.trustedsigning.operations.CertificateProfilesOperations
38-
:param credential: Credential used to authenticate requests to the service. Required.
39+
:param credential: Credential needed for the client to connect to Azure. Required.
3940
:type credential: ~azure.core.credentials.TokenCredential
4041
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4142
:type subscription_id: str
42-
:param base_url: Service host. Default value is "https://management.azure.com".
43+
:param base_url: Service URL. Default value is "https://management.azure.com".
4344
:type base_url: str
44-
:keyword api_version: The API version to use for this operation. Default value is
45-
"2024-02-05-preview". Note that overriding this default value may result in unsupported
46-
behavior.
45+
:keyword api_version: Api Version. Default value is "2024-09-30-preview". Note that overriding
46+
this default value may result in unsupported behavior.
4747
:paramtype api_version: str
4848
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4949
Retry-After header is present.
@@ -56,9 +56,8 @@ def __init__(
5656
base_url: str = "https://management.azure.com",
5757
**kwargs: Any
5858
) -> None:
59-
_endpoint = "{endpoint}"
60-
self._config = TrustedSigningMgmtClientConfiguration(
61-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
59+
self._config = CodeSigningManagementClientConfiguration(
60+
credential=credential, subscription_id=subscription_id, **kwargs
6261
)
6362
_policies = kwargs.pop("policies", None)
6463
if _policies is None:
@@ -78,10 +77,11 @@ def __init__(
7877
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
7978
self._config.http_logging_policy,
8079
]
81-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
80+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
8281

83-
self._serialize = Serializer()
84-
self._deserialize = Deserializer()
82+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
83+
self._serialize = Serializer(client_models)
84+
self._deserialize = Deserializer(client_models)
8585
self._serialize.client_side_validation = False
8686
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
8787
self.code_signing_accounts = CodeSigningAccountsOperations(
@@ -91,13 +91,13 @@ def __init__(
9191
self._client, self._config, self._serialize, self._deserialize
9292
)
9393

94-
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
94+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
9595
"""Runs the network request through the client's chained policies.
9696
9797
>>> from azure.core.rest import HttpRequest
9898
>>> request = HttpRequest("GET", "https://www.example.org/")
9999
<HttpRequest [GET], url: 'https://www.example.org/'>
100-
>>> response = client.send_request(request)
100+
>>> response = client._send_request(request)
101101
<HttpResponse: 200 OK>
102102
103103
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -110,11 +110,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
110110
"""
111111

112112
request_copy = deepcopy(request)
113-
path_format_arguments = {
114-
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
115-
}
116-
117-
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
113+
request_copy.url = self._client.format_url(request_copy.url)
118114
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
119115

120116
def close(self) -> None:

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

Lines changed: 8 additions & 18 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) Python Code Generator.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

@@ -18,32 +18,23 @@
1818
from azure.core.credentials import TokenCredential
1919

2020

21-
class TrustedSigningMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
22-
"""Configuration for TrustedSigningMgmtClient.
21+
class CodeSigningManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
22+
"""Configuration for CodeSigningManagementClient.
2323
2424
Note that all parameters used to create this instance are saved as instance
2525
attributes.
2626
27-
:param credential: Credential used to authenticate requests to the service. Required.
27+
:param credential: Credential needed for the client to connect to Azure. Required.
2828
:type credential: ~azure.core.credentials.TokenCredential
2929
: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
33-
:keyword api_version: The API version to use for this operation. Default value is
34-
"2024-02-05-preview". Note that overriding this default value may result in unsupported
35-
behavior.
31+
:keyword api_version: Api Version. Default value is "2024-09-30-preview". Note that overriding
32+
this default value may result in unsupported behavior.
3633
:paramtype api_version: str
3734
"""
3835

39-
def __init__(
40-
self,
41-
credential: "TokenCredential",
42-
subscription_id: str,
43-
base_url: str = "https://management.azure.com",
44-
**kwargs: Any
45-
) -> None:
46-
api_version: str = kwargs.pop("api_version", "2024-02-05-preview")
36+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
37+
api_version: str = kwargs.pop("api_version", "2024-09-30-preview")
4738

4839
if credential is None:
4940
raise ValueError("Parameter 'credential' must not be None.")
@@ -52,7 +43,6 @@ def __init__(
5243

5344
self.credential = credential
5445
self.subscription_id = subscription_id
55-
self.base_url = base_url
5646
self.api_version = api_version
5747
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5848
kwargs.setdefault("sdk_moniker", "mgmt-trustedsigning/{}".format(VERSION))

0 commit comments

Comments
 (0)