Skip to content

Commit 578d77b

Browse files
committed
generate from typespec
1 parent ca2153c commit 578d77b

File tree

84 files changed

+15638
-386
lines changed

Some content is hidden

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

84 files changed

+15638
-386
lines changed

sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Release History
22

3+
## 1.0.0 (2025-06-30)
4+
5+
### Features Added
6+
- Enum `ProvisioningState` added member `UPDATING`
7+
- Model `CloudHsmClusterBackupStatusOperations` added method `begin_get`
8+
- Model `CloudHsmClusterRestoreStatusOperations` added method `begin_get`
9+
10+
### Breaking Changes
11+
- Deleted or renamed client `HardwareSecurityModulesMgmtClient`
12+
- Deleted or renamed model `CloudHsmClusterResource`
13+
- Deleted or renamed model `IdentityType`
14+
- Deleted or renamed model `OutboundEnvironmentEndpointCollection`
15+
- Deleted or renamed method `CloudHsmClusterBackupStatusOperations.get`
16+
- Deleted or renamed method `CloudHsmClusterRestoreStatusOperations.get`
17+
- Method `CloudHsmClustersOperations.begin_create_or_update` inserted a `positional_or_keyword` parameter `body`
18+
- Method `CloudHsmClustersOperations.begin_create_or_update` deleted or renamed its parameter `location` of kind `positional_or_keyword`
19+
- Method `CloudHsmClustersOperations.begin_create_or_update` deleted or renamed its parameter `tags` of kind `positional_or_keyword`
20+
- Method `CloudHsmClustersOperations.begin_create_or_update` deleted or renamed its parameter `identity` of kind `positional_or_keyword`
21+
- Method `CloudHsmClustersOperations.begin_create_or_update` deleted or renamed its parameter `sku` of kind `positional_or_keyword`
22+
- Method `CloudHsmClustersOperations.begin_create_or_update` deleted or renamed its parameter `properties` of kind `positional_or_keyword`
23+
- Method `CloudHsmClustersOperations.begin_update` inserted a `positional_or_keyword` parameter `body`
24+
- Method `CloudHsmClustersOperations.begin_update` deleted or renamed its parameter `tags` of kind `positional_or_keyword`
25+
- Method `CloudHsmClustersOperations.begin_update` deleted or renamed its parameter `identity` of kind `positional_or_keyword`
26+
- Method `CloudHsmClustersOperations.list_by_resource_group` changed its parameter `skiptoken` from `positional_or_keyword` to `keyword_only`
27+
- Method `CloudHsmClustersOperations.list_by_subscription` changed its parameter `skiptoken` from `positional_or_keyword` to `keyword_only`
28+
- Method `DedicatedHsmOperations.begin_update` inserted a `positional_or_keyword` parameter `parameters`
29+
- Method `DedicatedHsmOperations.begin_update` deleted or renamed its parameter `tags` of kind `positional_or_keyword`
30+
- Method `DedicatedHsmOperations.begin_update` re-ordered its parameters from `['self', 'resource_group_name', 'name', 'tags', 'kwargs']` to `['self', 'resource_group_name', 'name', 'parameters', 'kwargs']`
31+
332
## 1.0.0b2 (2025-02-06)
433

534
### Features Added
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
include _meta.json
2-
recursive-include tests *.py *.json
3-
recursive-include samples *.py *.md
41
include *.md
5-
include azure/__init__.py
6-
include azure/mgmt/__init__.py
72
include LICENSE
83
include azure/mgmt/hardwaresecuritymodules/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/mgmt/__init__.py
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"apiVersion": "2025-03-31"
3+
}

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

Lines changed: 111 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/__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) 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
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._hardware_security_modules_mgmt_client import HardwareSecurityModulesMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import HardwareSecurityModulesClient # 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-
"HardwareSecurityModulesMgmtClient",
28+
"HardwareSecurityModulesClient",
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()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# pylint: disable=line-too-long,useless-suppression
2+
# coding=utf-8
3+
# --------------------------------------------------------------------------
4+
# Copyright (c) Microsoft Corporation. All rights reserved.
5+
# Licensed under the MIT License. See License.txt in the project root for license information.
6+
# Code generated by Microsoft (R) Python Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
8+
# --------------------------------------------------------------------------
9+
10+
from copy import deepcopy
11+
from typing import Any, Optional, TYPE_CHECKING, cast
12+
from typing_extensions import Self
13+
14+
from azure.core.pipeline import policies
15+
from azure.core.rest import HttpRequest, HttpResponse
16+
from azure.core.settings import settings
17+
from azure.mgmt.core import ARMPipelineClient
18+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
19+
from azure.mgmt.core.tools import get_arm_endpoints
20+
21+
from ._configuration import HardwareSecurityModulesClientConfiguration
22+
from ._utils.serialization import Deserializer, Serializer
23+
from .operations import (
24+
CloudHsmClusterBackupStatusOperations,
25+
CloudHsmClusterPrivateEndpointConnectionsOperations,
26+
CloudHsmClusterPrivateLinkResourcesOperations,
27+
CloudHsmClusterRestoreStatusOperations,
28+
CloudHsmClustersOperations,
29+
DedicatedHsmOperations,
30+
Operations,
31+
PrivateEndpointConnectionsOperations,
32+
)
33+
34+
if TYPE_CHECKING:
35+
from azure.core.credentials import TokenCredential
36+
37+
38+
class HardwareSecurityModulesClient: # pylint: disable=too-many-instance-attributes
39+
"""The Azure management API provides a RESTful set of web services that interact with Hardware
40+
Security Modules.
41+
42+
:ivar operations: Operations operations
43+
:vartype operations: azure.mgmt.hardwaresecuritymodules.operations.Operations
44+
:ivar cloud_hsm_clusters: CloudHsmClustersOperations operations
45+
:vartype cloud_hsm_clusters:
46+
azure.mgmt.hardwaresecuritymodules.operations.CloudHsmClustersOperations
47+
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
48+
:vartype private_endpoint_connections:
49+
azure.mgmt.hardwaresecuritymodules.operations.PrivateEndpointConnectionsOperations
50+
:ivar cloud_hsm_cluster_private_link_resources: CloudHsmClusterPrivateLinkResourcesOperations
51+
operations
52+
:vartype cloud_hsm_cluster_private_link_resources:
53+
azure.mgmt.hardwaresecuritymodules.operations.CloudHsmClusterPrivateLinkResourcesOperations
54+
:ivar cloud_hsm_cluster_backup_status: CloudHsmClusterBackupStatusOperations operations
55+
:vartype cloud_hsm_cluster_backup_status:
56+
azure.mgmt.hardwaresecuritymodules.operations.CloudHsmClusterBackupStatusOperations
57+
:ivar cloud_hsm_cluster_restore_status: CloudHsmClusterRestoreStatusOperations operations
58+
:vartype cloud_hsm_cluster_restore_status:
59+
azure.mgmt.hardwaresecuritymodules.operations.CloudHsmClusterRestoreStatusOperations
60+
:ivar cloud_hsm_cluster_private_endpoint_connections:
61+
CloudHsmClusterPrivateEndpointConnectionsOperations operations
62+
:vartype cloud_hsm_cluster_private_endpoint_connections:
63+
azure.mgmt.hardwaresecuritymodules.operations.CloudHsmClusterPrivateEndpointConnectionsOperations
64+
:ivar dedicated_hsm: DedicatedHsmOperations operations
65+
:vartype dedicated_hsm: azure.mgmt.hardwaresecuritymodules.operations.DedicatedHsmOperations
66+
:param credential: Credential used to authenticate requests to the service. Required.
67+
:type credential: ~azure.core.credentials.TokenCredential
68+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
69+
:type subscription_id: str
70+
:param base_url: Service host. Default value is None.
71+
:type base_url: str
72+
:keyword api_version: The API version to use for this operation. Default value is "2025-03-31".
73+
Note that overriding this default value may result in unsupported behavior.
74+
:paramtype api_version: str
75+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
76+
Retry-After header is present.
77+
"""
78+
79+
def __init__(
80+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
81+
) -> None:
82+
_endpoint = "{endpoint}"
83+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
84+
_endpoints = get_arm_endpoints(_cloud)
85+
if not base_url:
86+
base_url = _endpoints["resource_manager"]
87+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
88+
self._config = HardwareSecurityModulesClientConfiguration(
89+
credential=credential,
90+
subscription_id=subscription_id,
91+
base_url=cast(str, base_url),
92+
credential_scopes=credential_scopes,
93+
**kwargs
94+
)
95+
96+
_policies = kwargs.pop("policies", None)
97+
if _policies is None:
98+
_policies = [
99+
policies.RequestIdPolicy(**kwargs),
100+
self._config.headers_policy,
101+
self._config.user_agent_policy,
102+
self._config.proxy_policy,
103+
policies.ContentDecodePolicy(**kwargs),
104+
ARMAutoResourceProviderRegistrationPolicy(),
105+
self._config.redirect_policy,
106+
self._config.retry_policy,
107+
self._config.authentication_policy,
108+
self._config.custom_hook_policy,
109+
self._config.logging_policy,
110+
policies.DistributedTracingPolicy(**kwargs),
111+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
112+
self._config.http_logging_policy,
113+
]
114+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
115+
116+
self._serialize = Serializer()
117+
self._deserialize = Deserializer()
118+
self._serialize.client_side_validation = False
119+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
120+
self.cloud_hsm_clusters = CloudHsmClustersOperations(
121+
self._client, self._config, self._serialize, self._deserialize
122+
)
123+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
124+
self._client, self._config, self._serialize, self._deserialize
125+
)
126+
self.cloud_hsm_cluster_private_link_resources = CloudHsmClusterPrivateLinkResourcesOperations(
127+
self._client, self._config, self._serialize, self._deserialize
128+
)
129+
self.cloud_hsm_cluster_backup_status = CloudHsmClusterBackupStatusOperations(
130+
self._client, self._config, self._serialize, self._deserialize
131+
)
132+
self.cloud_hsm_cluster_restore_status = CloudHsmClusterRestoreStatusOperations(
133+
self._client, self._config, self._serialize, self._deserialize
134+
)
135+
self.cloud_hsm_cluster_private_endpoint_connections = CloudHsmClusterPrivateEndpointConnectionsOperations(
136+
self._client, self._config, self._serialize, self._deserialize
137+
)
138+
self.dedicated_hsm = DedicatedHsmOperations(self._client, self._config, self._serialize, self._deserialize)
139+
140+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
141+
"""Runs the network request through the client's chained policies.
142+
143+
>>> from azure.core.rest import HttpRequest
144+
>>> request = HttpRequest("GET", "https://www.example.org/")
145+
<HttpRequest [GET], url: 'https://www.example.org/'>
146+
>>> response = client.send_request(request)
147+
<HttpResponse: 200 OK>
148+
149+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
150+
151+
:param request: The network request you want to make. Required.
152+
:type request: ~azure.core.rest.HttpRequest
153+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
154+
:return: The response of your network call. Does not do error handling on your response.
155+
:rtype: ~azure.core.rest.HttpResponse
156+
"""
157+
158+
request_copy = deepcopy(request)
159+
path_format_arguments = {
160+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
161+
}
162+
163+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
164+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
165+
166+
def close(self) -> None:
167+
self._client.close()
168+
169+
def __enter__(self) -> Self:
170+
self._client.__enter__()
171+
return self
172+
173+
def __exit__(self, *exc_details: Any) -> None:
174+
self._client.__exit__(*exc_details)

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

Lines changed: 17 additions & 9 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

@@ -14,27 +14,34 @@
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 HardwareSecurityModulesMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
22-
"""Configuration for HardwareSecurityModulesMgmtClient.
20+
class HardwareSecurityModulesClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
21+
"""Configuration for HardwareSecurityModulesClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
2524
attributes.
2625
27-
:param credential: Credential needed for the client to connect to Azure. Required.
26+
:param credential: Credential used to authenticate requests to the service. 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-
:keyword api_version: Api Version. Default value is "2024-06-30-preview". Note that overriding
32-
this default value may result in unsupported behavior.
30+
:param base_url: Service host. Default value is "https://management.azure.com".
31+
:type base_url: str
32+
:keyword api_version: The API version to use for this operation. Default value is "2025-03-31".
33+
Note that overriding this default value may result in unsupported behavior.
3334
:paramtype api_version: str
3435
"""
3536

36-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
37-
api_version: str = kwargs.pop("api_version", "2024-06-30-preview")
37+
def __init__(
38+
self,
39+
credential: "TokenCredential",
40+
subscription_id: str,
41+
base_url: str = "https://management.azure.com",
42+
**kwargs: Any
43+
) -> None:
44+
api_version: str = kwargs.pop("api_version", "2025-03-31")
3845

3946
if credential is None:
4047
raise ValueError("Parameter 'credential' must not be None.")
@@ -43,6 +50,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4350

4451
self.credential = credential
4552
self.subscription_id = subscription_id
53+
self.base_url = base_url
4654
self.api_version = api_version
4755
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4856
kwargs.setdefault("sdk_moniker", "mgmt-hardwaresecuritymodules/{}".format(VERSION))

sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_hardware_security_modules_mgmt_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# pylint: disable=line-too-long,useless-suppression
12
# coding=utf-8
23
# --------------------------------------------------------------------------
34
# Copyright (c) Microsoft Corporation. All rights reserved.

0 commit comments

Comments
 (0)