Skip to content

Commit 906fba6

Browse files
author
SDKAuto
committed
CodeGen from PR 33150 in Azure/azure-rest-api-specs
Merge ffd85ca7c16034757db562f9ba88ef9664b1a03a into b0014d135f949a3db605b0b0999206f077acedd1
1 parent 1f7312f commit 906fba6

File tree

43 files changed

+5390
-6176
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

+5390
-6176
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": "c1ff15db6fcd2119f503ceadfd75cf88b2d0d6e3",
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: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
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
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._client import TrustedSigningMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._code_signing_management_client import CodeSigningManagementClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
22-
"TrustedSigningMgmtClient",
28+
"CodeSigningManagementClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

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 & 22 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,16 +15,16 @@
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

2223
if TYPE_CHECKING:
23-
# pylint: disable=unused-import,ungrouped-imports
2424
from azure.core.credentials import TokenCredential
2525

2626

27-
class TrustedSigningMgmtClient: # pylint: disable=client-accepts-api-version-keyword
27+
class CodeSigningManagementClient:
2828
"""Code Signing resource provider api.
2929
3030
:ivar operations: Operations operations
@@ -35,15 +35,14 @@ class TrustedSigningMgmtClient: # pylint: disable=client-accepts-api-version-ke
3535
:ivar certificate_profiles: CertificateProfilesOperations operations
3636
:vartype certificate_profiles:
3737
azure.mgmt.trustedsigning.operations.CertificateProfilesOperations
38-
:param credential: Credential used to authenticate requests to the service. Required.
38+
:param credential: Credential needed for the client to connect to Azure. Required.
3939
:type credential: ~azure.core.credentials.TokenCredential
4040
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4141
:type subscription_id: str
42-
:param base_url: Service host. Default value is "https://management.azure.com".
42+
:param base_url: Service URL. Default value is "https://management.azure.com".
4343
: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.
44+
:keyword api_version: Api Version. Default value is "2025-03-30". Note that overriding this
45+
default value may result in unsupported behavior.
4746
:paramtype api_version: str
4847
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4948
Retry-After header is present.
@@ -56,9 +55,8 @@ def __init__(
5655
base_url: str = "https://management.azure.com",
5756
**kwargs: Any
5857
) -> None:
59-
_endpoint = "{endpoint}"
60-
self._config = TrustedSigningMgmtClientConfiguration(
61-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
58+
self._config = CodeSigningManagementClientConfiguration(
59+
credential=credential, subscription_id=subscription_id, **kwargs
6260
)
6361
_policies = kwargs.pop("policies", None)
6462
if _policies is None:
@@ -78,10 +76,11 @@ def __init__(
7876
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
7977
self._config.http_logging_policy,
8078
]
81-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
79+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
8280

83-
self._serialize = Serializer()
84-
self._deserialize = Deserializer()
81+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
82+
self._serialize = Serializer(client_models)
83+
self._deserialize = Deserializer(client_models)
8584
self._serialize.client_side_validation = False
8685
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
8786
self.code_signing_accounts = CodeSigningAccountsOperations(
@@ -91,13 +90,13 @@ def __init__(
9190
self._client, self._config, self._serialize, self._deserialize
9291
)
9392

94-
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
93+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
9594
"""Runs the network request through the client's chained policies.
9695
9796
>>> from azure.core.rest import HttpRequest
9897
>>> request = HttpRequest("GET", "https://www.example.org/")
9998
<HttpRequest [GET], url: 'https://www.example.org/'>
100-
>>> response = client.send_request(request)
99+
>>> response = client._send_request(request)
101100
<HttpResponse: 200 OK>
102101
103102
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -110,11 +109,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
110109
"""
111110

112111
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)
112+
request_copy.url = self._client.format_url(request_copy.url)
118113
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
119114

120115
def close(self) -> None:

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

Lines changed: 8 additions & 19 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

@@ -14,36 +14,26 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

21-
class TrustedSigningMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
22-
"""Configuration for TrustedSigningMgmtClient.
20+
class CodeSigningManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
21+
"""Configuration for CodeSigningManagementClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
2524
attributes.
2625
27-
:param credential: Credential used to authenticate requests to the service. Required.
26+
:param credential: Credential needed for the client to connect to Azure. Required.
2827
:type credential: ~azure.core.credentials.TokenCredential
2928
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3029
: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.
30+
:keyword api_version: Api Version. Default value is "2025-03-30". Note that overriding this
31+
default value may result in unsupported behavior.
3632
:paramtype api_version: str
3733
"""
3834

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")
35+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
36+
api_version: str = kwargs.pop("api_version", "2025-03-30")
4737

4838
if credential is None:
4939
raise ValueError("Parameter 'credential' must not be None.")
@@ -52,7 +42,6 @@ def __init__(
5242

5343
self.credential = credential
5444
self.subscription_id = subscription_id
55-
self.base_url = base_url
5645
self.api_version = api_version
5746
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5847
kwargs.setdefault("sdk_moniker", "mgmt-trustedsigning/{}".format(VERSION))

0 commit comments

Comments
 (0)