diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/CHANGELOG.md b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/LICENSE b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/LICENSE new file mode 100644 index 000000000000..b2f52a2bad4e --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/MANIFEST.in b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/MANIFEST.in new file mode 100644 index 000000000000..2c31e8da0cb1 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py +include LICENSE diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/README.md b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/README.md new file mode 100644 index 000000000000..58d8e85967fa --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/README.md @@ -0,0 +1,30 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 3.6+. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + +## _Disclaimer_ + +_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-hardwaresecuritymodules%2FREADME.png) diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/_meta.json b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/_meta.json new file mode 100644 index 000000000000..6168e05b3f6c --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.7.2", + "use": [ + "@autorest/python@5.12.0", + "@autorest/modelerfour@4.19.3" + ], + "commit": "fb8e80cb9407ee7166cc7c1a75f8321a3b66db68", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/hardwaresecuritymodules/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "readme": "specification/hardwaresecuritymodules/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/__init__.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/__init__.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/__init__.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/__init__.py new file mode 100644 index 000000000000..e9eac96ac8be --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_dedicated_hsm_resource_provider import AzureDedicatedHSMResourceProvider +from ._version import VERSION + +__version__ = VERSION +__all__ = ['AzureDedicatedHSMResourceProvider'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_azure_dedicated_hsm_resource_provider.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_azure_dedicated_hsm_resource_provider.py new file mode 100644 index 000000000000..11681a607c6d --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_azure_dedicated_hsm_resource_provider.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +from . import models +from ._configuration import AzureDedicatedHSMResourceProviderConfiguration +from .operations import DedicatedHsmOperations, Operations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + +class AzureDedicatedHSMResourceProvider: + """The Azure management API provides a RESTful set of web services that interact with Azure Dedicated HSM RP. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.hardwaresecuritymodules.operations.Operations + :ivar dedicated_hsm: DedicatedHsmOperations operations + :vartype dedicated_hsm: azure.mgmt.hardwaresecuritymodules.operations.DedicatedHsmOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = AzureDedicatedHSMResourceProviderConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.dedicated_hsm = DedicatedHsmOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: Any + ) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AzureDedicatedHSMResourceProvider + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_configuration.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_configuration.py new file mode 100644 index 000000000000..83f48c519034 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_configuration.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class AzureDedicatedHSMResourceProviderConfiguration(Configuration): + """Configuration for AzureDedicatedHSMResourceProvider. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(AzureDedicatedHSMResourceProviderConfiguration, self).__init__(**kwargs) + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-11-30" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-hardwaresecuritymodules/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_metadata.json b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_metadata.json new file mode 100644 index 000000000000..e35027fb76ba --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_metadata.json @@ -0,0 +1,103 @@ +{ + "chosen_version": "2021-11-30", + "total_api_version_list": ["2021-11-30"], + "client": { + "name": "AzureDedicatedHSMResourceProvider", + "filename": "_azure_dedicated_hsm_resource_provider", + "description": "The Azure management API provides a RESTful set of web services that interact with Azure Dedicated HSM RP.", + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureDedicatedHSMResourceProviderConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureDedicatedHSMResourceProviderConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=\"https://management.azure.com\", # type: str", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "dedicated_hsm": "DedicatedHsmOperations" + } +} \ No newline at end of file diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_patch.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_vendor.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_version.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_version.py new file mode 100644 index 000000000000..fe0d5a0b414c --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2019-05-01T00:00:00.000Z" diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/__init__.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/__init__.py new file mode 100644 index 000000000000..746aeb199a04 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_dedicated_hsm_resource_provider import AzureDedicatedHSMResourceProvider +__all__ = ['AzureDedicatedHSMResourceProvider'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/_azure_dedicated_hsm_resource_provider.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/_azure_dedicated_hsm_resource_provider.py new file mode 100644 index 000000000000..ad4c0e4d4129 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/_azure_dedicated_hsm_resource_provider.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from .. import models +from ._configuration import AzureDedicatedHSMResourceProviderConfiguration +from .operations import DedicatedHsmOperations, Operations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class AzureDedicatedHSMResourceProvider: + """The Azure management API provides a RESTful set of web services that interact with Azure Dedicated HSM RP. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.hardwaresecuritymodules.aio.operations.Operations + :ivar dedicated_hsm: DedicatedHsmOperations operations + :vartype dedicated_hsm: + azure.mgmt.hardwaresecuritymodules.aio.operations.DedicatedHsmOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = AzureDedicatedHSMResourceProviderConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.dedicated_hsm = DedicatedHsmOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AzureDedicatedHSMResourceProvider": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/_configuration.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/_configuration.py new file mode 100644 index 000000000000..6433b7ea47b0 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class AzureDedicatedHSMResourceProviderConfiguration(Configuration): + """Configuration for AzureDedicatedHSMResourceProvider. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(AzureDedicatedHSMResourceProviderConfiguration, self).__init__(**kwargs) + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-11-30" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-hardwaresecuritymodules/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/_patch.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/operations/__init__.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/operations/__init__.py new file mode 100644 index 000000000000..505a8fd156c2 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/operations/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._dedicated_hsm_operations import DedicatedHsmOperations + +__all__ = [ + 'Operations', + 'DedicatedHsmOperations', +] diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/operations/_dedicated_hsm_operations.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/operations/_dedicated_hsm_operations.py new file mode 100644 index 000000000000..0ce2c33982b3 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/operations/_dedicated_hsm_operations.py @@ -0,0 +1,664 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._dedicated_hsm_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_outbound_network_dependencies_endpoints_request, build_update_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DedicatedHsmOperations: + """DedicatedHsmOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.hardwaresecuritymodules.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + parameters: "_models.DedicatedHsm", + **kwargs: Any + ) -> "_models.DedicatedHsm": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsm"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DedicatedHsm') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + parameters: "_models.DedicatedHsm", + **kwargs: Any + ) -> AsyncLROPoller["_models.DedicatedHsm"]: + """Create or Update a dedicated HSM in the specified subscription. + + :param resource_group_name: The name of the Resource Group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the dedicated Hsm. + :type name: str + :param parameters: Parameters to create or update the dedicated hsm. + :type parameters: ~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsm + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DedicatedHsm or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsm] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsm"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + name: str, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> "_models.DedicatedHsm": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsm"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _parameters = _models.DedicatedHsmPatchParameters(tags=tags) + _json = self._serialize.body(_parameters, 'DedicatedHsmPatchParameters') + + request = build_update_request_initial( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + name: str, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> AsyncLROPoller["_models.DedicatedHsm"]: + """Update a dedicated HSM in the specified subscription. + + :param resource_group_name: The name of the Resource Group to which the server belongs. + :type resource_group_name: str + :param name: Name of the dedicated HSM. + :type name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DedicatedHsm or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsm] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsm"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + name=name, + tags=tags, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified Azure Dedicated HSM. + + :param resource_group_name: The name of the Resource Group to which the dedicated HSM belongs. + :type resource_group_name: str + :param name: The name of the dedicated HSM to delete. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.DedicatedHsm": + """Gets the specified Azure dedicated HSM. + + :param resource_group_name: The name of the Resource Group to which the dedicated hsm belongs. + :type resource_group_name: str + :param name: The name of the dedicated HSM. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedHsm, or the result of cls(response) + :rtype: ~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsm + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsm"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DedicatedHsmError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.DedicatedHsmListResult"]: + """The List operation gets information about the dedicated hsms associated with the subscription + and within the specified resource group. + + :param resource_group_name: The name of the Resource Group to which the dedicated HSM belongs. + :type resource_group_name: str + :param top: Maximum number of results to return. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DedicatedHsmListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsmListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsmListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DedicatedHsmListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DedicatedHsmError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs'} # type: ignore + + @distributed_trace + def list_by_subscription( + self, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.DedicatedHsmListResult"]: + """The List operation gets information about the dedicated HSMs associated with the subscription. + + :param top: Maximum number of results to return. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DedicatedHsmListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsmListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsmListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DedicatedHsmListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DedicatedHsmError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs'} # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified dedicated hsm resource. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified dedicated hsm resource. The operation returns properties of each egress endpoint. + + :param resource_group_name: The name of the Resource Group to which the dedicated hsm belongs. + :type resource_group_name: str + :param name: The name of the dedicated HSM. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hardwaresecuritymodules.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_outbound_network_dependencies_endpoints_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_outbound_network_dependencies_endpoints_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DedicatedHsmError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/operations/_operations.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/operations/_operations.py new file mode 100644 index 000000000000..a39b80276277 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/aio/operations/_operations.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.hardwaresecuritymodules.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.DedicatedHsmOperationListResult"]: + """Get a list of Dedicated HSM operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DedicatedHsmOperationListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsmOperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsmOperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DedicatedHsmOperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DedicatedHsmError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.HardwareSecurityModules/operations'} # type: ignore diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/models/__init__.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/models/__init__.py new file mode 100644 index 000000000000..8f61a9e26e80 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/models/__init__.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._models_py3 import ApiEntityReference +from ._models_py3 import DedicatedHsm +from ._models_py3 import DedicatedHsmError +from ._models_py3 import DedicatedHsmListResult +from ._models_py3 import DedicatedHsmOperation +from ._models_py3 import DedicatedHsmOperationDisplay +from ._models_py3 import DedicatedHsmOperationListResult +from ._models_py3 import DedicatedHsmPatchParameters +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import Error +from ._models_py3 import NetworkInterface +from ._models_py3 import NetworkProfile +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +from ._models_py3 import Resource +from ._models_py3 import ResourceListResult +from ._models_py3 import Sku +from ._models_py3 import SystemData + + +from ._azure_dedicated_hsm_resource_provider_enums import ( + IdentityType, + JsonWebKeyType, + SkuName, +) + +__all__ = [ + 'ApiEntityReference', + 'DedicatedHsm', + 'DedicatedHsmError', + 'DedicatedHsmListResult', + 'DedicatedHsmOperation', + 'DedicatedHsmOperationDisplay', + 'DedicatedHsmOperationListResult', + 'DedicatedHsmPatchParameters', + 'EndpointDependency', + 'EndpointDetail', + 'Error', + 'NetworkInterface', + 'NetworkProfile', + 'OutboundEnvironmentEndpoint', + 'OutboundEnvironmentEndpointCollection', + 'Resource', + 'ResourceListResult', + 'Sku', + 'SystemData', + 'IdentityType', + 'JsonWebKeyType', + 'SkuName', +] diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/models/_azure_dedicated_hsm_resource_provider_enums.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/models/_azure_dedicated_hsm_resource_provider_enums.py new file mode 100644 index 000000000000..e93585353714 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/models/_azure_dedicated_hsm_resource_provider_enums.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class IdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class JsonWebKeyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state. + """ + + #: The dedicated HSM has been full provisioned. + SUCCEEDED = "Succeeded" + #: The dedicated HSM is currently being provisioned. + PROVISIONING = "Provisioning" + #: A device is currently being allocated for the dedicated HSM resource. + ALLOCATING = "Allocating" + #: The dedicated HSM is being connected to the virtual network. + CONNECTING = "Connecting" + #: Provisioning of the dedicated HSM has failed. + FAILED = "Failed" + #: Validating the subscription has sufficient quota to allocate a dedicated HSM device. + CHECKING_QUOTA = "CheckingQuota" + #: The dedicated HSM is currently being deleted. + DELETING = "Deleting" + +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """SKU of the dedicated HSM + """ + + #: The dedicated HSM is a Safenet Luna Network HSM A790 device. + SAFE_NET_LUNA_NETWORK_HSM_A790 = "SafeNet Luna Network HSM A790" + #: The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with + #: 1 local master key which supports up to 60 calls per second. + PAY_SHIELD10_K_LMK1_CPS60 = "payShield10K_LMK1_CPS60" + #: The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with + #: 1 local master key which supports up to 250 calls per second. + PAY_SHIELD10_K_LMK1_CPS250 = "payShield10K_LMK1_CPS250" + #: The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with + #: 1 local master key which supports up to 2500 calls per second. + PAY_SHIELD10_K_LMK1_CPS2500 = "payShield10K_LMK1_CPS2500" + #: The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with + #: 2 local master keys which supports up to 60 calls per second. + PAY_SHIELD10_K_LMK2_CPS60 = "payShield10K_LMK2_CPS60" + #: The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with + #: 2 local master keys which supports up to 250 calls per second. + PAY_SHIELD10_K_LMK2_CPS250 = "payShield10K_LMK2_CPS250" + #: The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with + #: 2 local master keys which supports up to 2500 calls per second. + PAY_SHIELD10_K_LMK2_CPS2500 = "payShield10K_LMK2_CPS2500" diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/models/_models_py3.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/models/_models_py3.py new file mode 100644 index 000000000000..bf43e572e20c --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/models/_models_py3.py @@ -0,0 +1,798 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._azure_dedicated_hsm_resource_provider_enums import * + + +class ApiEntityReference(msrest.serialization.Model): + """The API entity reference. + + :ivar id: The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :vartype id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + """ + :keyword id: The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :paramtype id: str + """ + super(ApiEntityReference, self).__init__(**kwargs) + self.id = id + + +class Resource(msrest.serialization.Model): + """Dedicated HSM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The Azure Resource Manager resource ID for the dedicated HSM. + :vartype id: str + :ivar name: The name of the dedicated HSM. + :vartype name: str + :ivar type: The resource type of the dedicated HSM. + :vartype type: str + :ivar location: Required. The supported Azure location where the dedicated HSM should be + created. + :vartype location: str + :ivar sku: SKU details. + :vartype sku: ~azure.mgmt.hardwaresecuritymodules.models.Sku + :ivar zones: The Dedicated Hsm zones. + :vartype zones: list[str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + location: str, + sku: Optional["Sku"] = None, + zones: Optional[List[str]] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword location: Required. The supported Azure location where the dedicated HSM should be + created. + :paramtype location: str + :keyword sku: SKU details. + :paramtype sku: ~azure.mgmt.hardwaresecuritymodules.models.Sku + :keyword zones: The Dedicated Hsm zones. + :paramtype zones: list[str] + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.sku = sku + self.zones = zones + self.tags = tags + + +class DedicatedHsm(Resource): + """Resource information with extended details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The Azure Resource Manager resource ID for the dedicated HSM. + :vartype id: str + :ivar name: The name of the dedicated HSM. + :vartype name: str + :ivar type: The resource type of the dedicated HSM. + :vartype type: str + :ivar location: Required. The supported Azure location where the dedicated HSM should be + created. + :vartype location: str + :ivar sku: SKU details. + :vartype sku: ~azure.mgmt.hardwaresecuritymodules.models.Sku + :ivar zones: The Dedicated Hsm zones. + :vartype zones: list[str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.hardwaresecuritymodules.models.SystemData + :ivar network_profile: Specifies the network interfaces of the dedicated hsm. + :vartype network_profile: ~azure.mgmt.hardwaresecuritymodules.models.NetworkProfile + :ivar management_network_profile: Specifies the management network interfaces of the dedicated + hsm. + :vartype management_network_profile: ~azure.mgmt.hardwaresecuritymodules.models.NetworkProfile + :ivar stamp_id: This field will be used when RP does not support Availability zones. + :vartype stamp_id: str + :ivar status_message: Resource Status Message. + :vartype status_message: str + :ivar provisioning_state: Provisioning state. Possible values include: "Succeeded", + "Provisioning", "Allocating", "Connecting", "Failed", "CheckingQuota", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.hardwaresecuritymodules.models.JsonWebKeyType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'status_message': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'management_network_profile': {'key': 'properties.managementNetworkProfile', 'type': 'NetworkProfile'}, + 'stamp_id': {'key': 'properties.stampId', 'type': 'str'}, + 'status_message': {'key': 'properties.statusMessage', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + sku: Optional["Sku"] = None, + zones: Optional[List[str]] = None, + tags: Optional[Dict[str, str]] = None, + network_profile: Optional["NetworkProfile"] = None, + management_network_profile: Optional["NetworkProfile"] = None, + stamp_id: Optional[str] = None, + **kwargs + ): + """ + :keyword location: Required. The supported Azure location where the dedicated HSM should be + created. + :paramtype location: str + :keyword sku: SKU details. + :paramtype sku: ~azure.mgmt.hardwaresecuritymodules.models.Sku + :keyword zones: The Dedicated Hsm zones. + :paramtype zones: list[str] + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword network_profile: Specifies the network interfaces of the dedicated hsm. + :paramtype network_profile: ~azure.mgmt.hardwaresecuritymodules.models.NetworkProfile + :keyword management_network_profile: Specifies the management network interfaces of the + dedicated hsm. + :paramtype management_network_profile: + ~azure.mgmt.hardwaresecuritymodules.models.NetworkProfile + :keyword stamp_id: This field will be used when RP does not support Availability zones. + :paramtype stamp_id: str + """ + super(DedicatedHsm, self).__init__(location=location, sku=sku, zones=zones, tags=tags, **kwargs) + self.system_data = None + self.network_profile = network_profile + self.management_network_profile = management_network_profile + self.stamp_id = stamp_id + self.status_message = None + self.provisioning_state = None + + +class DedicatedHsmError(msrest.serialization.Model): + """The error exception. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: The error detail of the operation if any. + :vartype error: ~azure.mgmt.hardwaresecuritymodules.models.Error + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DedicatedHsmError, self).__init__(**kwargs) + self.error = None + + +class DedicatedHsmListResult(msrest.serialization.Model): + """List of dedicated HSMs. + + :ivar value: The list of dedicated HSMs. + :vartype value: list[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsm] + :ivar next_link: The URL to get the next set of dedicated hsms. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DedicatedHsm]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["DedicatedHsm"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: The list of dedicated HSMs. + :paramtype value: list[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsm] + :keyword next_link: The URL to get the next set of dedicated hsms. + :paramtype next_link: str + """ + super(DedicatedHsmListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DedicatedHsmOperation(msrest.serialization.Model): + """REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the Dedicated HSM Resource Provider Operation. + :vartype name: str + :ivar is_data_action: Gets or sets a value indicating whether it is a data plane action. + :vartype is_data_action: str + :ivar display: The display string. + :vartype display: ~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsmOperationDisplay + """ + + _validation = { + 'is_data_action': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'DedicatedHsmOperationDisplay'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["DedicatedHsmOperationDisplay"] = None, + **kwargs + ): + """ + :keyword name: The name of the Dedicated HSM Resource Provider Operation. + :paramtype name: str + :keyword display: The display string. + :paramtype display: ~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsmOperationDisplay + """ + super(DedicatedHsmOperation, self).__init__(**kwargs) + self.name = name + self.is_data_action = None + self.display = display + + +class DedicatedHsmOperationDisplay(msrest.serialization.Model): + """The display string. + + :ivar provider: The Resource Provider of the operation. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + :ivar description: The object that represents the operation. + :vartype description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + """ + :keyword provider: The Resource Provider of the operation. + :paramtype provider: str + :keyword resource: Resource on which the operation is performed. + :paramtype resource: str + :keyword operation: Operation type: Read, write, delete, etc. + :paramtype operation: str + :keyword description: The object that represents the operation. + :paramtype description: str + """ + super(DedicatedHsmOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class DedicatedHsmOperationListResult(msrest.serialization.Model): + """Result of the request to list Dedicated HSM Provider operations. It contains a list of operations. + + :ivar value: List of Dedicated HSM Resource Provider operations. + :vartype value: list[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsmOperation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DedicatedHsmOperation]'}, + } + + def __init__( + self, + *, + value: Optional[List["DedicatedHsmOperation"]] = None, + **kwargs + ): + """ + :keyword value: List of Dedicated HSM Resource Provider operations. + :paramtype value: list[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsmOperation] + """ + super(DedicatedHsmOperationListResult, self).__init__(**kwargs) + self.value = value + + +class DedicatedHsmPatchParameters(msrest.serialization.Model): + """Patchable properties of the dedicated HSM. + + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ + super(DedicatedHsmPatchParameters, self).__init__(**kwargs) + self.tags = tags + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that dedicated hsm services are reaching at. + + :ivar domain_name: The domain name of the dependency. + :vartype domain_name: str + :ivar endpoint_details: The Ports and Protocols used when connecting to domainName. + :vartype endpoint_details: list[~azure.mgmt.hardwaresecuritymodules.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[List["EndpointDetail"]] = None, + **kwargs + ): + """ + :keyword domain_name: The domain name of the dependency. + :paramtype domain_name: str + :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. + :paramtype endpoint_details: list[~azure.mgmt.hardwaresecuritymodules.models.EndpointDetail] + """ + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = domain_name + self.endpoint_details = endpoint_details + + +class EndpointDetail(msrest.serialization.Model): + """Connect information from the dedicated hsm service to a single endpoint. + + :ivar ip_address: An IP Address that Domain Name currently resolves to. + :vartype ip_address: str + :ivar port: The port an endpoint is connected to. + :vartype port: int + :ivar protocol: The protocol used for connection. + :vartype protocol: str + :ivar description: Description of the detail. + :vartype description: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + """ + :keyword ip_address: An IP Address that Domain Name currently resolves to. + :paramtype ip_address: str + :keyword port: The port an endpoint is connected to. + :paramtype port: int + :keyword protocol: The protocol used for connection. + :paramtype protocol: str + :keyword description: Description of the detail. + :paramtype description: str + """ + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = ip_address + self.port = port + self.protocol = protocol + self.description = description + + +class Error(msrest.serialization.Model): + """The key vault server error. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar inner_error: Contains more specific error that narrows down the cause. May be null. + :vartype inner_error: ~azure.mgmt.hardwaresecuritymodules.models.Error + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'inner_error': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'inner_error': {'key': 'innererror', 'type': 'Error'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Error, self).__init__(**kwargs) + self.code = None + self.message = None + self.inner_error = None + + +class NetworkInterface(msrest.serialization.Model): + """The network interface definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :vartype id: str + :ivar private_ip_address: Private Ip address of the interface. + :vartype private_ip_address: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + private_ip_address: Optional[str] = None, + **kwargs + ): + """ + :keyword private_ip_address: Private Ip address of the interface. + :paramtype private_ip_address: str + """ + super(NetworkInterface, self).__init__(**kwargs) + self.id = None + self.private_ip_address = private_ip_address + + +class NetworkProfile(msrest.serialization.Model): + """The network profile definition. + + :ivar subnet: Specifies the identifier of the subnet. + :vartype subnet: ~azure.mgmt.hardwaresecuritymodules.models.ApiEntityReference + :ivar network_interfaces: Specifies the list of resource Ids for the network interfaces + associated with the dedicated HSM. + :vartype network_interfaces: list[~azure.mgmt.hardwaresecuritymodules.models.NetworkInterface] + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'ApiEntityReference'}, + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[NetworkInterface]'}, + } + + def __init__( + self, + *, + subnet: Optional["ApiEntityReference"] = None, + network_interfaces: Optional[List["NetworkInterface"]] = None, + **kwargs + ): + """ + :keyword subnet: Specifies the identifier of the subnet. + :paramtype subnet: ~azure.mgmt.hardwaresecuritymodules.models.ApiEntityReference + :keyword network_interfaces: Specifies the list of resource Ids for the network interfaces + associated with the dedicated HSM. + :paramtype network_interfaces: + list[~azure.mgmt.hardwaresecuritymodules.models.NetworkInterface] + """ + super(NetworkProfile, self).__init__(**kwargs) + self.subnet = subnet + self.network_interfaces = network_interfaces + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Egress endpoints which dedicated hsm service connects to for common purpose. + + :ivar category: The category of endpoints accessed by the dedicated hsm service, e.g. + azure-resource-management, apiserver, etc. + :vartype category: str + :ivar endpoints: The endpoints that dedicated hsm service connects to. + :vartype endpoints: list[~azure.mgmt.hardwaresecuritymodules.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["EndpointDependency"]] = None, + **kwargs + ): + """ + :keyword category: The category of endpoints accessed by the dedicated hsm service, e.g. + azure-resource-management, apiserver, etc. + :paramtype category: str + :keyword endpoints: The endpoints that dedicated hsm service connects to. + :paramtype endpoints: list[~azure.mgmt.hardwaresecuritymodules.models.EndpointDependency] + """ + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = category + self.endpoints = endpoints + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of OutboundEnvironmentEndpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar value: Required. Collection of resources. + :vartype value: list[~azure.mgmt.hardwaresecuritymodules.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["OutboundEnvironmentEndpoint"], + **kwargs + ): + """ + :keyword value: Required. Collection of resources. + :paramtype value: list[~azure.mgmt.hardwaresecuritymodules.models.OutboundEnvironmentEndpoint] + """ + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceListResult(msrest.serialization.Model): + """List of dedicated HSM resources. + + :ivar value: The list of dedicated HSM resources. + :vartype value: list[~azure.mgmt.hardwaresecuritymodules.models.Resource] + :ivar next_link: The URL to get the next set of dedicated HSM resources. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Resource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Resource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: The list of dedicated HSM resources. + :paramtype value: list[~azure.mgmt.hardwaresecuritymodules.models.Resource] + :keyword next_link: The URL to get the next set of dedicated HSM resources. + :paramtype next_link: str + """ + super(ResourceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Sku(msrest.serialization.Model): + """SKU of the dedicated HSM. + + :ivar name: SKU of the dedicated HSM. Possible values include: "SafeNet Luna Network HSM A790", + "payShield10K_LMK1_CPS60", "payShield10K_LMK1_CPS250", "payShield10K_LMK1_CPS2500", + "payShield10K_LMK2_CPS60", "payShield10K_LMK2_CPS250", "payShield10K_LMK2_CPS2500". + :vartype name: str or ~azure.mgmt.hardwaresecuritymodules.models.SkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "SkuName"]] = None, + **kwargs + ): + """ + :keyword name: SKU of the dedicated HSM. Possible values include: "SafeNet Luna Network HSM + A790", "payShield10K_LMK1_CPS60", "payShield10K_LMK1_CPS250", "payShield10K_LMK1_CPS2500", + "payShield10K_LMK2_CPS60", "payShield10K_LMK2_CPS250", "payShield10K_LMK2_CPS2500". + :paramtype name: str or ~azure.mgmt.hardwaresecuritymodules.models.SkuName + """ + super(Sku, self).__init__(**kwargs) + self.name = name + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of dedicated hsm resource. + + :ivar created_by: The identity that created dedicated hsm resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created dedicated hsm resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.hardwaresecuritymodules.models.IdentityType + :ivar created_at: The timestamp of dedicated hsm resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified dedicated hsm resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified dedicated hsm resource. + Possible values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.hardwaresecuritymodules.models.IdentityType + :ivar last_modified_at: The timestamp of dedicated hsm resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "IdentityType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "IdentityType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword created_by: The identity that created dedicated hsm resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created dedicated hsm resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or ~azure.mgmt.hardwaresecuritymodules.models.IdentityType + :keyword created_at: The timestamp of dedicated hsm resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified dedicated hsm resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified dedicated hsm resource. + Possible values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or + ~azure.mgmt.hardwaresecuritymodules.models.IdentityType + :keyword last_modified_at: The timestamp of dedicated hsm resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/operations/__init__.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/operations/__init__.py new file mode 100644 index 000000000000..505a8fd156c2 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/operations/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._dedicated_hsm_operations import DedicatedHsmOperations + +__all__ = [ + 'Operations', + 'DedicatedHsmOperations', +] diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/operations/_dedicated_hsm_operations.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/operations/_dedicated_hsm_operations.py new file mode 100644 index 000000000000..62be02f89fe3 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/operations/_dedicated_hsm_operations.py @@ -0,0 +1,929 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_or_update_request_initial( + resource_group_name: str, + name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_request_initial( + resource_group_name: str, + name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-11-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name: str, + name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "name": _SERIALIZER.url("name", name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name: str, + name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "name": _SERIALIZER.url("name", name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + resource_group_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if top is not None: + query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_subscription_request( + subscription_id: str, + *, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if top is not None: + query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_outbound_network_dependencies_endpoints_request( + resource_group_name: str, + name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "name": _SERIALIZER.url("name", name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class DedicatedHsmOperations(object): + """DedicatedHsmOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.hardwaresecuritymodules.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + parameters: "_models.DedicatedHsm", + **kwargs: Any + ) -> "_models.DedicatedHsm": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsm"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DedicatedHsm') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + name: str, + parameters: "_models.DedicatedHsm", + **kwargs: Any + ) -> LROPoller["_models.DedicatedHsm"]: + """Create or Update a dedicated HSM in the specified subscription. + + :param resource_group_name: The name of the Resource Group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the dedicated Hsm. + :type name: str + :param parameters: Parameters to create or update the dedicated hsm. + :type parameters: ~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsm + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either DedicatedHsm or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsm] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsm"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + def _update_initial( + self, + resource_group_name: str, + name: str, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> "_models.DedicatedHsm": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsm"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _parameters = _models.DedicatedHsmPatchParameters(tags=tags) + _json = self._serialize.body(_parameters, 'DedicatedHsmPatchParameters') + + request = build_update_request_initial( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + name: str, + tags: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> LROPoller["_models.DedicatedHsm"]: + """Update a dedicated HSM in the specified subscription. + + :param resource_group_name: The name of the Resource Group to which the server belongs. + :type resource_group_name: str + :param name: Name of the dedicated HSM. + :type name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either DedicatedHsm or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsm] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsm"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + name=name, + tags=tags, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified Azure Dedicated HSM. + + :param resource_group_name: The name of the Resource Group to which the dedicated HSM belongs. + :type resource_group_name: str + :param name: The name of the dedicated HSM to delete. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.DedicatedHsm": + """Gets the specified Azure dedicated HSM. + + :param resource_group_name: The name of the Resource Group to which the dedicated hsm belongs. + :type resource_group_name: str + :param name: The name of the dedicated HSM. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedHsm, or the result of cls(response) + :rtype: ~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsm + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsm"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DedicatedHsmError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DedicatedHsm', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}'} # type: ignore + + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + top: Optional[int] = None, + **kwargs: Any + ) -> Iterable["_models.DedicatedHsmListResult"]: + """The List operation gets information about the dedicated hsms associated with the subscription + and within the specified resource group. + + :param resource_group_name: The name of the Resource Group to which the dedicated HSM belongs. + :type resource_group_name: str + :param top: Maximum number of results to return. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DedicatedHsmListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsmListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsmListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + top=top, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DedicatedHsmListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DedicatedHsmError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs'} # type: ignore + + @distributed_trace + def list_by_subscription( + self, + top: Optional[int] = None, + **kwargs: Any + ) -> Iterable["_models.DedicatedHsmListResult"]: + """The List operation gets information about the dedicated HSMs associated with the subscription. + + :param top: Maximum number of results to return. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DedicatedHsmListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsmListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsmListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + top=top, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DedicatedHsmListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DedicatedHsmError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs'} # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified dedicated hsm resource. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified dedicated hsm resource. The operation returns properties of each egress endpoint. + + :param resource_group_name: The name of the Resource Group to which the dedicated hsm belongs. + :type resource_group_name: str + :param name: The name of the dedicated HSM. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.hardwaresecuritymodules.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_outbound_network_dependencies_endpoints_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_outbound_network_dependencies_endpoints_request( + resource_group_name=resource_group_name, + name=name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DedicatedHsmError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/operations/_operations.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/operations/_operations.py new file mode 100644 index 000000000000..d297224d02b2 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/operations/_operations.py @@ -0,0 +1,137 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2021-11-30" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.HardwareSecurityModules/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.hardwaresecuritymodules.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> Iterable["_models.DedicatedHsmOperationListResult"]: + """Get a list of Dedicated HSM operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DedicatedHsmOperationListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.hardwaresecuritymodules.models.DedicatedHsmOperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedHsmOperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DedicatedHsmOperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DedicatedHsmError, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.HardwareSecurityModules/operations'} # type: ignore diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/py.typed b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/azure/mgmt/hardwaresecuritymodules/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/sdk_packaging.toml b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/sdk_packaging.toml new file mode 100644 index 000000000000..e99670f11351 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-mgmt-hardwaresecuritymodules" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true diff --git a/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/setup.py b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/setup.py new file mode 100644 index 000000000000..b3e37ec8f213 --- /dev/null +++ b/sdk/hardwaresecuritymodules/azure-mgmt-hardwaresecuritymodules/setup.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-hardwaresecuritymodules" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.6.21', + 'azure-common~=1.1', + 'azure-mgmt-core>=1.3.0,<2.0.0', + ], + python_requires=">=3.6" +) diff --git a/sdk/hardwaresecuritymodules/ci.yml b/sdk/hardwaresecuritymodules/ci.yml new file mode 100644 index 000000000000..6f4e3bc89ab3 --- /dev/null +++ b/sdk/hardwaresecuritymodules/ci.yml @@ -0,0 +1,33 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/hardwaresecuritymodules/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/hardwaresecuritymodules/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: hardwaresecuritymodules + Artifacts: + - name: azure-mgmt-hardwaresecuritymodules + safeName: azuremgmthardwaresecuritymodules