зеркало из
1
0
Форкнуть 0

[AutoRelease] t2-trustedsigning-2024-09-27-28223(can only be merged by SDK owner) (#37611)

* code and test

* Update CHANGELOG.md

* update-testcase

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com>
Co-authored-by: ChenxiJiang333 <v-chenjiang@microsoft.com>
This commit is contained in:
Azure SDK Bot 2024-09-28 18:49:51 -07:00 коммит произвёл GitHub
Родитель e2bf17551d
Коммит 66d1575d88
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
60 изменённых файлов: 10660 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,7 @@
# Release History
## 1.0.0b1 (2024-09-27)
### Other Changes
- Initial version

Просмотреть файл

@ -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.

Просмотреть файл

@ -0,0 +1,8 @@
include _meta.json
recursive-include tests *.py *.json
recursive-include samples *.py *.md
include *.md
include azure/__init__.py
include azure/mgmt/__init__.py
include LICENSE
include azure/mgmt/trustedsigning/py.typed

Просмотреть файл

@ -0,0 +1,61 @@
# Microsoft Azure SDK for Python
This is the Microsoft Azure Trustedsigning Management Client Library.
This package has been tested with Python 3.8+.
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_
## Getting started
### Prerequisites
- Python 3.8+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)
### Install the package
```bash
pip install azure-mgmt-trustedsigning
pip install azure-identity
```
### Authentication
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` for Azure client secret.
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
With above configuration, client can be authenticated by following code:
```python
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
import os
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = TrustedSigningMgmtClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
```
## Examples
Code samples for this package can be found at:
- [Search Trustedsigning Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
## Troubleshooting
## Next steps
## 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.

Просмотреть файл

@ -0,0 +1,6 @@
{
"commit": "e6fde2ac19d0202f0e72217a3e0f9edb63dba273",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/codesigning/CodeSigning.Management",
"@azure-tools/typespec-python": "0.33.0"
}

Просмотреть файл

@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

Просмотреть файл

@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

Просмотреть файл

@ -0,0 +1,26 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._client import TrustedSigningMgmtClient
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"TrustedSigningMgmtClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -0,0 +1,128 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from ._configuration import TrustedSigningMgmtClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import CertificateProfilesOperations, CodeSigningAccountsOperations, Operations
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class TrustedSigningMgmtClient: # pylint: disable=client-accepts-api-version-keyword
"""Code Signing resource provider api.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.trustedsigning.operations.Operations
:ivar code_signing_accounts: CodeSigningAccountsOperations operations
:vartype code_signing_accounts:
azure.mgmt.trustedsigning.operations.CodeSigningAccountsOperations
:ivar certificate_profiles: CertificateProfilesOperations operations
:vartype certificate_profiles:
azure.mgmt.trustedsigning.operations.CertificateProfilesOperations
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service host. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-02-05-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: 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:
_endpoint = "{endpoint}"
self._config = TrustedSigningMgmtClientConfiguration(
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
ARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
self._serialize = Serializer()
self._deserialize = Deserializer()
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.code_signing_accounts = CodeSigningAccountsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.certificate_profiles = CertificateProfilesOperations(
self._client, self._config, self._serialize, self._deserialize
)
def send_request(self, request: HttpRequest, *, stream: bool = False, **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/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client.send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
: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)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
def close(self) -> None:
self._client.close()
def __enter__(self) -> Self:
self._client.__enter__()
return self
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)

Просмотреть файл

@ -0,0 +1,75 @@
# 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) Python 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.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 TrustedSigningMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for TrustedSigningMgmtClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service host. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-02-05-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2024-02-05-preview")
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.base_url = base_url
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-trustedsigning/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
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.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**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
)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,20 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
VERSION = "1.0.0b1"

Просмотреть файл

@ -0,0 +1,23 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._client import TrustedSigningMgmtClient
try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"TrustedSigningMgmtClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -0,0 +1,130 @@
# 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) Python 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, TYPE_CHECKING
from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
from .._serialization import Deserializer, Serializer
from ._configuration import TrustedSigningMgmtClientConfiguration
from .operations import CertificateProfilesOperations, CodeSigningAccountsOperations, Operations
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class TrustedSigningMgmtClient: # pylint: disable=client-accepts-api-version-keyword
"""Code Signing resource provider api.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.trustedsigning.aio.operations.Operations
:ivar code_signing_accounts: CodeSigningAccountsOperations operations
:vartype code_signing_accounts:
azure.mgmt.trustedsigning.aio.operations.CodeSigningAccountsOperations
:ivar certificate_profiles: CertificateProfilesOperations operations
:vartype certificate_profiles:
azure.mgmt.trustedsigning.aio.operations.CertificateProfilesOperations
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service host. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-02-05-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: 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:
_endpoint = "{endpoint}"
self._config = TrustedSigningMgmtClientConfiguration(
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
AsyncARMAutoResourceProviderRegistrationPolicy(),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
self._serialize = Serializer()
self._deserialize = Deserializer()
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.code_signing_accounts = CodeSigningAccountsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.certificate_profiles = CertificateProfilesOperations(
self._client, self._config, self._serialize, self._deserialize
)
def send_request(
self, request: HttpRequest, *, stream: bool = False, **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/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = await client.send_request(request)
<AsyncHttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
: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)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
async def close(self) -> None:
await self._client.close()
async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)

Просмотреть файл

@ -0,0 +1,75 @@
# 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) Python 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.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 TrustedSigningMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for TrustedSigningMgmtClient.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service host. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-02-05-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2024-02-05-preview")
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.base_url = base_url
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-trustedsigning/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
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.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**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
)

Просмотреть файл

@ -0,0 +1,20 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

Просмотреть файл

@ -0,0 +1,23 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._operations import Operations
from ._operations import CodeSigningAccountsOperations
from ._operations import CertificateProfilesOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"Operations",
"CodeSigningAccountsOperations",
"CertificateProfilesOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,20 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

Просмотреть файл

@ -0,0 +1,79 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._models import AccountSku
from ._models import Certificate
from ._models import CertificateProfile
from ._models import CertificateProfileProperties
from ._models import CheckNameAvailability
from ._models import CheckNameAvailabilityResult
from ._models import CodeSigningAccount
from ._models import CodeSigningAccountPatch
from ._models import CodeSigningAccountPatchProperties
from ._models import CodeSigningAccountProperties
from ._models import ErrorAdditionalInfo
from ._models import ErrorDetail
from ._models import ErrorResponse
from ._models import Operation
from ._models import OperationDisplay
from ._models import ProxyResource
from ._models import Resource
from ._models import Revocation
from ._models import RevokeCertificate
from ._models import SystemData
from ._models import TrackedResource
from ._enums import ActionType
from ._enums import CertificateProfileStatus
from ._enums import CertificateStatus
from ._enums import CreatedByType
from ._enums import NameUnavailabilityReason
from ._enums import Origin
from ._enums import ProfileType
from ._enums import ProvisioningState
from ._enums import RevocationStatus
from ._enums import SkuName
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"AccountSku",
"Certificate",
"CertificateProfile",
"CertificateProfileProperties",
"CheckNameAvailability",
"CheckNameAvailabilityResult",
"CodeSigningAccount",
"CodeSigningAccountPatch",
"CodeSigningAccountPatchProperties",
"CodeSigningAccountProperties",
"ErrorAdditionalInfo",
"ErrorDetail",
"ErrorResponse",
"Operation",
"OperationDisplay",
"ProxyResource",
"Resource",
"Revocation",
"RevokeCertificate",
"SystemData",
"TrackedResource",
"ActionType",
"CertificateProfileStatus",
"CertificateStatus",
"CreatedByType",
"NameUnavailabilityReason",
"Origin",
"ProfileType",
"ProvisioningState",
"RevocationStatus",
"SkuName",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -0,0 +1,130 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from enum import Enum
from azure.core import CaseInsensitiveEnumMeta
class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal
only APIs.
"""
INTERNAL = "Internal"
"""Actions are for internal-only APIs."""
class CertificateProfileStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Status of the certificate profiles."""
ACTIVE = "Active"
"""The certificate profile is active."""
DISABLED = "Disabled"
"""The certificate profile is disabled."""
SUSPENDED = "Suspended"
"""The certificate profile is suspended."""
class CertificateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Status of the certificate."""
ACTIVE = "Active"
"""The certificate is active."""
EXPIRED = "Expired"
"""The certificate is expired."""
REVOKED = "Revoked"
"""The certificate is revoked."""
class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The kind of entity that created the resource."""
USER = "User"
"""The entity was created by a user."""
APPLICATION = "Application"
"""The entity was created by an application."""
MANAGED_IDENTITY = "ManagedIdentity"
"""The entity was created by a managed identity."""
KEY = "Key"
"""The entity was created by a key."""
class NameUnavailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The reason that a trusted signing account name could not be used. The Reason element is only
returned if nameAvailable is false.
"""
ACCOUNT_NAME_INVALID = "AccountNameInvalid"
"""Account name is invalid"""
ALREADY_EXISTS = "AlreadyExists"
"""Account name already exists"""
class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit
logs UX. Default value is "user,system".
"""
USER = "user"
"""Indicates the operation is initiated by a user."""
SYSTEM = "system"
"""Indicates the operation is initiated by a system."""
USER_SYSTEM = "user,system"
"""Indicates the operation is initiated by a user or system."""
class ProfileType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Type of the certificate."""
PUBLIC_TRUST = "PublicTrust"
"""Used for signing files which are distributed publicly."""
PRIVATE_TRUST = "PrivateTrust"
"""Used for signing files which are distributed internally within organization or group boundary."""
PRIVATE_TRUST_CI_POLICY = "PrivateTrustCIPolicy"
"""Used for signing CI policy files."""
VBS_ENCLAVE = "VBSEnclave"
"""Used for signing files which are run in secure vbs enclave."""
PUBLIC_TRUST_TEST = "PublicTrustTest"
"""Used for signing files for testing purpose."""
class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The status of the current operation."""
SUCCEEDED = "Succeeded"
"""Resource has been created."""
FAILED = "Failed"
"""Resource creation failed."""
CANCELED = "Canceled"
"""Resource creation was canceled."""
UPDATING = "Updating"
"""Updating in progress."""
DELETING = "Deleting"
"""Deletion in progress."""
ACCEPTED = "Accepted"
"""Resource creation started."""
class RevocationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Revocation status of the certificate."""
SUCCEEDED = "Succeeded"
"""Certificate revocation succeeded."""
IN_PROGRESS = "InProgress"
"""Certificate revocation is in progress."""
FAILED = "Failed"
"""Certificate revocation failed."""
class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Name of the sku."""
BASIC = "Basic"
"""Basic sku."""
PREMIUM = "Premium"
"""Premium sku."""

Просмотреть файл

@ -0,0 +1,964 @@
# coding=utf-8
# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import datetime
from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload
from .. import _model_base
from .._model_base import rest_field
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
class AccountSku(_model_base.Model):
"""SKU of the trusted signing account.
:ivar name: Name of the SKU. Required. Known values are: "Basic" and "Premium".
:vartype name: str or ~azure.mgmt.trustedsigning.models.SkuName
"""
name: Union[str, "_models.SkuName"] = rest_field()
"""Name of the SKU. Required. Known values are: \"Basic\" and \"Premium\"."""
@overload
def __init__(
self,
*,
name: Union[str, "_models.SkuName"],
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class Certificate(_model_base.Model):
"""Properties of the certificate.
:ivar serial_number: Serial number of the certificate.
:vartype serial_number: str
:ivar subject_name: Subject name of the certificate.
:vartype subject_name: str
:ivar thumbprint: Thumbprint of the certificate.
:vartype thumbprint: str
:ivar created_date: Certificate created date.
:vartype created_date: str
:ivar expiry_date: Certificate expiry date.
:vartype expiry_date: str
:ivar status: Status of the certificate. Known values are: "Active", "Expired", and "Revoked".
:vartype status: str or ~azure.mgmt.trustedsigning.models.CertificateStatus
:ivar revocation: Revocations history of a certificate.
:vartype revocation: ~azure.mgmt.trustedsigning.models.Revocation
"""
serial_number: Optional[str] = rest_field(name="serialNumber")
"""Serial number of the certificate."""
subject_name: Optional[str] = rest_field(name="subjectName")
"""Subject name of the certificate."""
thumbprint: Optional[str] = rest_field()
"""Thumbprint of the certificate."""
created_date: Optional[str] = rest_field(name="createdDate")
"""Certificate created date."""
expiry_date: Optional[str] = rest_field(name="expiryDate")
"""Certificate expiry date."""
status: Optional[Union[str, "_models.CertificateStatus"]] = rest_field()
"""Status of the certificate. Known values are: \"Active\", \"Expired\", and \"Revoked\"."""
revocation: Optional["_models.Revocation"] = rest_field()
"""Revocations history of a certificate."""
__flattened_items = ["requested_at", "effective_at", "reason", "remarks", "status", "failure_reason"]
@overload
def __init__(
self,
*,
serial_number: Optional[str] = None,
subject_name: Optional[str] = None,
thumbprint: Optional[str] = None,
created_date: Optional[str] = None,
expiry_date: Optional[str] = None,
status: Optional[Union[str, "_models.CertificateStatus"]] = None,
revocation: Optional["_models.Revocation"] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
_flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
super().__init__(*args, **kwargs)
for k, v in _flattened_input.items():
setattr(self, k, v)
def __getattr__(self, name: str) -> Any:
if name in self.__flattened_items:
if self.revocation is None:
return None
return getattr(self.revocation, name)
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")
def __setattr__(self, key: str, value: Any) -> None:
if key in self.__flattened_items:
if self.revocation is None:
self.revocation = self._attr_to_rest_field["revocation"]._class_type()
setattr(self.properties, key, value)
else:
super().__setattr__(key, value)
class Resource(_model_base.Model):
"""Common fields that are returned in the response for all Azure Resource Manager resources.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.trustedsigning.models.SystemData
"""
id: Optional[str] = rest_field(visibility=["read"])
"""Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long"""
name: Optional[str] = rest_field(visibility=["read"])
"""The name of the resource."""
type: Optional[str] = rest_field(visibility=["read"])
"""The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or
\"Microsoft.Storage/storageAccounts\"."""
system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
"""Azure Resource Manager metadata containing createdBy and modifiedBy information."""
class ProxyResource(Resource):
"""The resource model definition for a Azure Resource Manager proxy resource. It will not have
tags and a location.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.trustedsigning.models.SystemData
"""
class CertificateProfile(ProxyResource):
"""Certificate profile resource.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.trustedsigning.models.SystemData
:ivar properties: The resource-specific properties for this resource.
:vartype properties: ~azure.mgmt.trustedsigning.models.CertificateProfileProperties
"""
properties: Optional["_models.CertificateProfileProperties"] = rest_field()
"""The resource-specific properties for this resource."""
@overload
def __init__(
self,
*,
properties: Optional["_models.CertificateProfileProperties"] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class CertificateProfileProperties(_model_base.Model): # pylint: disable=too-many-instance-attributes
"""Properties of the certificate profile.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar profile_type: Profile type of the certificate. Required. Known values are: "PublicTrust",
"PrivateTrust", "PrivateTrustCIPolicy", "VBSEnclave", and "PublicTrustTest".
:vartype profile_type: str or ~azure.mgmt.trustedsigning.models.ProfileType
:ivar common_name: Used as CN in the certificate subject name.
:vartype common_name: str
:ivar organization: Used as O in the certificate subject name.
:vartype organization: str
:ivar organization_unit: Used as OU in the private trust certificate subject name.
:vartype organization_unit: str
:ivar street_address: Used as STREET in the certificate subject name.
:vartype street_address: str
:ivar include_street_address: Whether to include STREET in the certificate subject name.
:vartype include_street_address: bool
:ivar city: Used as L in the certificate subject name.
:vartype city: str
:ivar include_city: Whether to include L in the certificate subject name. Applicable only for
private trust, private trust ci profile types.
:vartype include_city: bool
:ivar state: Used as S in the certificate subject name.
:vartype state: str
:ivar include_state: Whether to include S in the certificate subject name. Applicable only for
private trust, private trust ci profile types.
:vartype include_state: bool
:ivar country: Used as C in the certificate subject name.
:vartype country: str
:ivar include_country: Whether to include C in the certificate subject name. Applicable only
for private trust, private trust ci profile types.
:vartype include_country: bool
:ivar postal_code: Used as PC in the certificate subject name.
:vartype postal_code: str
:ivar include_postal_code: Whether to include PC in the certificate subject name.
:vartype include_postal_code: bool
:ivar enhanced_key_usage: Enhanced key usage of the certificate.
:vartype enhanced_key_usage: str
:ivar identity_validation_id: Identity validation id used for the certificate subject name.
:vartype identity_validation_id: str
:ivar provisioning_state: Status of the current operation on certificate profile. Known values
are: "Succeeded", "Failed", "Canceled", "Updating", "Deleting", and "Accepted".
:vartype provisioning_state: str or ~azure.mgmt.trustedsigning.models.ProvisioningState
:ivar status: Status of the certificate profile. Known values are: "Active", "Disabled", and
"Suspended".
:vartype status: str or ~azure.mgmt.trustedsigning.models.CertificateProfileStatus
:ivar certificates: List of renewed certificates.
:vartype certificates: list[~azure.mgmt.trustedsigning.models.Certificate]
"""
profile_type: Union[str, "_models.ProfileType"] = rest_field(name="profileType")
"""Profile type of the certificate. Required. Known values are: \"PublicTrust\", \"PrivateTrust\",
\"PrivateTrustCIPolicy\", \"VBSEnclave\", and \"PublicTrustTest\"."""
common_name: Optional[str] = rest_field(name="commonName", visibility=["read"])
"""Used as CN in the certificate subject name."""
organization: Optional[str] = rest_field(visibility=["read"])
"""Used as O in the certificate subject name."""
organization_unit: Optional[str] = rest_field(name="organizationUnit", visibility=["read"])
"""Used as OU in the private trust certificate subject name."""
street_address: Optional[str] = rest_field(name="streetAddress", visibility=["read"])
"""Used as STREET in the certificate subject name."""
include_street_address: Optional[bool] = rest_field(name="includeStreetAddress")
"""Whether to include STREET in the certificate subject name."""
city: Optional[str] = rest_field(visibility=["read"])
"""Used as L in the certificate subject name."""
include_city: Optional[bool] = rest_field(name="includeCity")
"""Whether to include L in the certificate subject name. Applicable only for private trust,
private trust ci profile types."""
state: Optional[str] = rest_field(visibility=["read"])
"""Used as S in the certificate subject name."""
include_state: Optional[bool] = rest_field(name="includeState")
"""Whether to include S in the certificate subject name. Applicable only for private trust,
private trust ci profile types."""
country: Optional[str] = rest_field(visibility=["read"])
"""Used as C in the certificate subject name."""
include_country: Optional[bool] = rest_field(name="includeCountry")
"""Whether to include C in the certificate subject name. Applicable only for private trust,
private trust ci profile types."""
postal_code: Optional[str] = rest_field(name="postalCode", visibility=["read"])
"""Used as PC in the certificate subject name."""
include_postal_code: Optional[bool] = rest_field(name="includePostalCode")
"""Whether to include PC in the certificate subject name."""
enhanced_key_usage: Optional[str] = rest_field(name="enhancedKeyUsage", visibility=["read"])
"""Enhanced key usage of the certificate."""
identity_validation_id: Optional[str] = rest_field(name="identityValidationId")
"""Identity validation id used for the certificate subject name."""
provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
name="provisioningState", visibility=["read"]
)
"""Status of the current operation on certificate profile. Known values are: \"Succeeded\",
\"Failed\", \"Canceled\", \"Updating\", \"Deleting\", and \"Accepted\"."""
status: Optional[Union[str, "_models.CertificateProfileStatus"]] = rest_field(visibility=["read"])
"""Status of the certificate profile. Known values are: \"Active\", \"Disabled\", and
\"Suspended\"."""
certificates: Optional[List["_models.Certificate"]] = rest_field(visibility=["read"])
"""List of renewed certificates."""
__flattened_items = [""]
@overload
def __init__(
self,
*,
profile_type: Union[str, "_models.ProfileType"],
include_street_address: Optional[bool] = None,
include_city: Optional[bool] = None,
include_state: Optional[bool] = None,
include_country: Optional[bool] = None,
include_postal_code: Optional[bool] = None,
identity_validation_id: Optional[str] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
_flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
super().__init__(*args, **kwargs)
for k, v in _flattened_input.items():
setattr(self, k, v)
def __getattr__(self, name: str) -> Any:
if name in self.__flattened_items:
if self.certificates is None:
return None
return getattr(self.certificates, name)
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")
def __setattr__(self, key: str, value: Any) -> None:
if key in self.__flattened_items:
if self.certificates is None:
self.certificates = self._attr_to_rest_field["certificates"]._class_type()
setattr(self.properties, key, value)
else:
super().__setattr__(key, value)
class CheckNameAvailability(_model_base.Model):
"""The parameters used to check the availability of the trusted signing account name.
All required parameters must be populated in order to send to server.
:ivar name: Trusted signing account name. Required.
:vartype name: str
"""
name: str = rest_field()
"""Trusted signing account name. Required."""
@overload
def __init__(
self,
*,
name: str,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class CheckNameAvailabilityResult(_model_base.Model):
"""The CheckNameAvailability operation response.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar name_available: A boolean value that indicates whether the name is available for you to
use. If true, the name is available. If false, the name has already been taken or is invalid
and cannot be used.
:vartype name_available: bool
:ivar reason: The reason that a trusted signing account name could not be used. The Reason
element is only returned if nameAvailable is false. Known values are: "AccountNameInvalid" and
"AlreadyExists".
:vartype reason: str or ~azure.mgmt.trustedsigning.models.NameUnavailabilityReason
:ivar message: An error message explaining the Reason value in more detail.
:vartype message: str
"""
name_available: Optional[bool] = rest_field(name="nameAvailable", visibility=["read"])
"""A boolean value that indicates whether the name is available for you to use. If true, the name
is available. If false, the name has already been taken or is invalid and cannot be used."""
reason: Optional[Union[str, "_models.NameUnavailabilityReason"]] = rest_field(visibility=["read"])
"""The reason that a trusted signing account name could not be used. The Reason element is only
returned if nameAvailable is false. Known values are: \"AccountNameInvalid\" and
\"AlreadyExists\"."""
message: Optional[str] = rest_field(visibility=["read"])
"""An error message explaining the Reason value in more detail."""
class TrackedResource(Resource):
"""The resource model definition for an Azure Resource Manager tracked top level resource which
has 'tags' and a 'location'.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.trustedsigning.models.SystemData
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
:vartype location: str
"""
tags: Optional[Dict[str, str]] = rest_field()
"""Resource tags."""
location: str = rest_field(visibility=["read", "create"])
"""The geo-location where the resource lives. Required."""
@overload
def __init__(
self,
*,
location: str,
tags: Optional[Dict[str, str]] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class CodeSigningAccount(TrackedResource):
"""Trusted signing account resource.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.trustedsigning.models.SystemData
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar location: The geo-location where the resource lives. Required.
:vartype location: str
:ivar properties: The resource-specific properties for this resource.
:vartype properties: ~azure.mgmt.trustedsigning.models.CodeSigningAccountProperties
"""
properties: Optional["_models.CodeSigningAccountProperties"] = rest_field()
"""The resource-specific properties for this resource."""
@overload
def __init__(
self,
*,
location: str,
tags: Optional[Dict[str, str]] = None,
properties: Optional["_models.CodeSigningAccountProperties"] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class CodeSigningAccountPatch(_model_base.Model):
"""Parameters for creating or updating a trusted signing account.
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar properties: Properties of the trusted signing account.
:vartype properties: ~azure.mgmt.trustedsigning.models.CodeSigningAccountPatchProperties
"""
tags: Optional[Dict[str, str]] = rest_field()
"""Resource tags."""
properties: Optional["_models.CodeSigningAccountPatchProperties"] = rest_field()
"""Properties of the trusted signing account."""
__flattened_items = ["sku"]
@overload
def __init__(
self,
*,
tags: Optional[Dict[str, str]] = None,
properties: Optional["_models.CodeSigningAccountPatchProperties"] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
_flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
super().__init__(*args, **kwargs)
for k, v in _flattened_input.items():
setattr(self, k, v)
def __getattr__(self, name: str) -> Any:
if name in self.__flattened_items:
if self.properties is None:
return None
return getattr(self.properties, name)
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")
def __setattr__(self, key: str, value: Any) -> None:
if key in self.__flattened_items:
if self.properties is None:
self.properties = self._attr_to_rest_field["properties"]._class_type()
setattr(self.properties, key, value)
else:
super().__setattr__(key, value)
class CodeSigningAccountPatchProperties(_model_base.Model):
"""Properties of the trusted signing account.
:ivar sku: SKU of the trusted signing account.
:vartype sku: ~azure.mgmt.trustedsigning.models.AccountSku
"""
sku: Optional["_models.AccountSku"] = rest_field()
"""SKU of the trusted signing account."""
@overload
def __init__(
self,
*,
sku: Optional["_models.AccountSku"] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class CodeSigningAccountProperties(_model_base.Model):
"""Properties of the trusted signing account.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar account_uri: The URI of the trusted signing account which is used during signing files.
:vartype account_uri: str
:ivar sku: SKU of the trusted signing account.
:vartype sku: ~azure.mgmt.trustedsigning.models.AccountSku
:ivar provisioning_state: Status of the current operation on trusted signing account. Known
values are: "Succeeded", "Failed", "Canceled", "Updating", "Deleting", and "Accepted".
:vartype provisioning_state: str or ~azure.mgmt.trustedsigning.models.ProvisioningState
"""
account_uri: Optional[str] = rest_field(name="accountUri", visibility=["read"])
"""The URI of the trusted signing account which is used during signing files."""
sku: Optional["_models.AccountSku"] = rest_field()
"""SKU of the trusted signing account."""
provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
name="provisioningState", visibility=["read"]
)
"""Status of the current operation on trusted signing account. Known values are: \"Succeeded\",
\"Failed\", \"Canceled\", \"Updating\", \"Deleting\", and \"Accepted\"."""
@overload
def __init__(
self,
*,
sku: Optional["_models.AccountSku"] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class ErrorAdditionalInfo(_model_base.Model):
"""The resource management error additional info.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar type: The additional info type.
:vartype type: str
:ivar info: The additional info.
:vartype info: any
"""
type: Optional[str] = rest_field(visibility=["read"])
"""The additional info type."""
info: Optional[Any] = rest_field(visibility=["read"])
"""The additional info."""
class ErrorDetail(_model_base.Model):
"""The error detail.
Readonly 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 target: The error target.
:vartype target: str
:ivar details: The error details.
:vartype details: list[~azure.mgmt.trustedsigning.models.ErrorDetail]
:ivar additional_info: The error additional info.
:vartype additional_info: list[~azure.mgmt.trustedsigning.models.ErrorAdditionalInfo]
"""
code: Optional[str] = rest_field(visibility=["read"])
"""The error code."""
message: Optional[str] = rest_field(visibility=["read"])
"""The error message."""
target: Optional[str] = rest_field(visibility=["read"])
"""The error target."""
details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"])
"""The error details."""
additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field(
name="additionalInfo", visibility=["read"]
)
"""The error additional info."""
class ErrorResponse(_model_base.Model):
"""Common error response for all Azure Resource Manager APIs to return error details for failed
operations.
:ivar error: The error object.
:vartype error: ~azure.mgmt.trustedsigning.models.ErrorDetail
"""
error: Optional["_models.ErrorDetail"] = rest_field()
"""The error object."""
@overload
def __init__(
self,
*,
error: Optional["_models.ErrorDetail"] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class Operation(_model_base.Model):
"""Details of a REST API operation, returned from the Resource Provider Operations API.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
"Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
:vartype name: str
:ivar is_data_action: Whether the operation applies to data-plane. This is "true" for
data-plane operations and "false" for Azure Resource Manager/control-plane operations.
:vartype is_data_action: bool
:ivar display: Localized display information for this particular operation.
:vartype display: ~azure.mgmt.trustedsigning.models.OperationDisplay
:ivar origin: The intended executor of the operation; as in Resource Based Access Control
(RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system",
and "user,system".
:vartype origin: str or ~azure.mgmt.trustedsigning.models.Origin
:ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions
that are for internal only APIs. "Internal"
:vartype action_type: str or ~azure.mgmt.trustedsigning.models.ActionType
"""
name: Optional[str] = rest_field(visibility=["read"])
"""The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
\"Microsoft.Compute/virtualMachines/write\",
\"Microsoft.Compute/virtualMachines/capture/action\"."""
is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"])
"""Whether the operation applies to data-plane. This is \"true\" for data-plane operations and
\"false\" for Azure Resource Manager/control-plane operations."""
display: Optional["_models.OperationDisplay"] = rest_field(visibility=["read"])
"""Localized display information for this particular operation."""
origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"])
"""The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit
logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and
\"user,system\"."""
action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType")
"""Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for
internal only APIs. \"Internal\""""
@overload
def __init__(
self,
*,
action_type: Optional[Union[str, "_models.ActionType"]] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class OperationDisplay(_model_base.Model):
"""Localized display information for and operation.
Readonly variables are only populated by the server, and will be ignored when sending a request.
:ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft
Monitoring Insights" or "Microsoft Compute".
:vartype provider: str
:ivar resource: The localized friendly name of the resource type related to this operation.
E.g. "Virtual Machines" or "Job Schedule Collections".
:vartype resource: str
:ivar operation: The concise, localized friendly name for the operation; suitable for
dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
:vartype operation: str
:ivar description: The short, localized friendly description of the operation; suitable for
tool tips and detailed views.
:vartype description: str
"""
provider: Optional[str] = rest_field(visibility=["read"])
"""The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring
Insights\" or \"Microsoft Compute\"."""
resource: Optional[str] = rest_field(visibility=["read"])
"""The localized friendly name of the resource type related to this operation. E.g. \"Virtual
Machines\" or \"Job Schedule Collections\"."""
operation: Optional[str] = rest_field(visibility=["read"])
"""The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create
or Update Virtual Machine\", \"Restart Virtual Machine\"."""
description: Optional[str] = rest_field(visibility=["read"])
"""The short, localized friendly description of the operation; suitable for tool tips and detailed
views."""
class Revocation(_model_base.Model):
"""Revocation details of the certificate.
:ivar requested_at: The timestamp when the revocation is requested.
:vartype requested_at: ~datetime.datetime
:ivar effective_at: The timestamp when the revocation is effective.
:vartype effective_at: ~datetime.datetime
:ivar reason: Reason for revocation.
:vartype reason: str
:ivar remarks: Remarks for the revocation.
:vartype remarks: str
:ivar status: Status of the revocation. Known values are: "Succeeded", "InProgress", and
"Failed".
:vartype status: str or ~azure.mgmt.trustedsigning.models.RevocationStatus
:ivar failure_reason: Reason for the revocation failure.
:vartype failure_reason: str
"""
requested_at: Optional[datetime.datetime] = rest_field(name="requestedAt", format="rfc3339")
"""The timestamp when the revocation is requested."""
effective_at: Optional[datetime.datetime] = rest_field(name="effectiveAt", format="rfc3339")
"""The timestamp when the revocation is effective."""
reason: Optional[str] = rest_field()
"""Reason for revocation."""
remarks: Optional[str] = rest_field()
"""Remarks for the revocation."""
status: Optional[Union[str, "_models.RevocationStatus"]] = rest_field()
"""Status of the revocation. Known values are: \"Succeeded\", \"InProgress\", and \"Failed\"."""
failure_reason: Optional[str] = rest_field(name="failureReason")
"""Reason for the revocation failure."""
@overload
def __init__(
self,
*,
requested_at: Optional[datetime.datetime] = None,
effective_at: Optional[datetime.datetime] = None,
reason: Optional[str] = None,
remarks: Optional[str] = None,
status: Optional[Union[str, "_models.RevocationStatus"]] = None,
failure_reason: Optional[str] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class RevokeCertificate(_model_base.Model):
"""Defines the certificate revocation properties.
All required parameters must be populated in order to send to server.
:ivar serial_number: Serial number of the certificate. Required.
:vartype serial_number: str
:ivar thumbprint: Thumbprint of the certificate. Required.
:vartype thumbprint: str
:ivar effective_at: The timestamp when the revocation is effective. Required.
:vartype effective_at: ~datetime.datetime
:ivar reason: Reason for the revocation. Required.
:vartype reason: str
:ivar remarks: Remarks for the revocation.
:vartype remarks: str
"""
serial_number: str = rest_field(name="serialNumber")
"""Serial number of the certificate. Required."""
thumbprint: str = rest_field()
"""Thumbprint of the certificate. Required."""
effective_at: datetime.datetime = rest_field(name="effectiveAt", format="rfc3339")
"""The timestamp when the revocation is effective. Required."""
reason: str = rest_field()
"""Reason for the revocation. Required."""
remarks: Optional[str] = rest_field()
"""Remarks for the revocation."""
@overload
def __init__(
self,
*,
serial_number: str,
thumbprint: str,
effective_at: datetime.datetime,
reason: str,
remarks: Optional[str] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class SystemData(_model_base.Model):
"""Metadata pertaining to creation and last modification of the resource.
:ivar created_by: The identity that created the resource.
:vartype created_by: str
:ivar created_by_type: The type of identity that created the resource. Known values are:
"User", "Application", "ManagedIdentity", and "Key".
:vartype created_by_type: str or ~azure.mgmt.trustedsigning.models.CreatedByType
:ivar created_at: The timestamp of resource creation (UTC).
:vartype created_at: ~datetime.datetime
:ivar last_modified_by: The identity that last modified the resource.
:vartype last_modified_by: str
:ivar last_modified_by_type: The type of identity that last modified the resource. Known values
are: "User", "Application", "ManagedIdentity", and "Key".
:vartype last_modified_by_type: str or ~azure.mgmt.trustedsigning.models.CreatedByType
:ivar last_modified_at: The timestamp of resource last modification (UTC).
:vartype last_modified_at: ~datetime.datetime
"""
created_by: Optional[str] = rest_field(name="createdBy")
"""The identity that created the resource."""
created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="createdByType")
"""The type of identity that created the resource. Known values are: \"User\", \"Application\",
\"ManagedIdentity\", and \"Key\"."""
created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339")
"""The timestamp of resource creation (UTC)."""
last_modified_by: Optional[str] = rest_field(name="lastModifiedBy")
"""The identity that last modified the resource."""
last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="lastModifiedByType")
"""The type of identity that last modified the resource. Known values are: \"User\",
\"Application\", \"ManagedIdentity\", and \"Key\"."""
last_modified_at: Optional[datetime.datetime] = rest_field(name="lastModifiedAt", format="rfc3339")
"""The timestamp of resource last modification (UTC)."""
@overload
def __init__(
self,
*,
created_by: Optional[str] = None,
created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
created_at: Optional[datetime.datetime] = None,
last_modified_by: Optional[str] = None,
last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
last_modified_at: Optional[datetime.datetime] = None,
): ...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)

Просмотреть файл

@ -0,0 +1,20 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

Просмотреть файл

@ -0,0 +1,23 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._operations import Operations
from ._operations import CodeSigningAccountsOperations
from ._operations import CertificateProfilesOperations
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
"Operations",
"CodeSigningAccountsOperations",
"CertificateProfilesOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,20 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Customize generated code here.
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.
`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

Просмотреть файл

@ -0,0 +1 @@
# Marker file for PEP 561.

Просмотреть файл

@ -0,0 +1,5 @@
-e ../../../tools/azure-sdk-tools
../../core/azure-core
../../identity/azure-identity
../../core/azure-mgmt-core
aiohttp

Просмотреть файл

@ -0,0 +1,51 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python certificate_profiles_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.certificate_profiles.begin_create(
resource_group_name="MyResourceGroup",
account_name="MyAccount",
profile_name="profileA",
resource={
"properties": {
"identityValidationId": "00000000-1234-5678-3333-444444444444",
"includePostalCode": True,
"includeStreetAddress": False,
"profileType": "PublicTrust",
}
},
).result()
print(response)
# x-ms-original-file: 2024-02-05-preview/CertificateProfiles_Create.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,42 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python certificate_profiles_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
client.certificate_profiles.begin_delete(
resource_group_name="MyResourceGroup",
account_name="MyAccount",
profile_name="profileA",
).result()
# x-ms-original-file: 2024-02-05-preview/CertificateProfiles_Delete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,43 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python certificate_profiles_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.certificate_profiles.get(
resource_group_name="MyResourceGroup",
account_name="MyAccount",
profile_name="profileA",
)
print(response)
# x-ms-original-file: 2024-02-05-preview/CertificateProfiles_Get.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,43 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python certificate_profiles_list_by_code_signing_account.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.certificate_profiles.list_by_code_signing_account(
resource_group_name="MyResourceGroup",
account_name="MyAccount",
)
for item in response:
print(item)
# x-ms-original-file: 2024-02-05-preview/CertificateProfiles_ListByCodeSigningAccount.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,49 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python certificate_profiles_revoke_certificate.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
client.certificate_profiles.revoke_certificate(
resource_group_name="MyResourceGroup",
account_name="MyAccount",
profile_name="profileA",
body={
"effectiveAt": "2023-11-12T23:40:25+00:00",
"reason": "KeyCompromised",
"remarks": "test",
"serialNumber": "xxxxxxxxxxxxxxxxxx",
"thumbprint": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
)
# x-ms-original-file: 2024-02-05-preview/CertificateProfiles_RevokeCertificate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,41 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python code_signing_accounts_check_name_availability.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.code_signing_accounts.check_name_availability(
body={"name": "sample-account"},
)
print(response)
# x-ms-original-file: 2024-02-05-preview/CodeSigningAccounts_CheckNameAvailability.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,43 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python code_signing_accounts_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.code_signing_accounts.begin_create(
resource_group_name="MyResourceGroup",
account_name="MyAccount",
resource={"location": "westus", "properties": {"sku": {"name": "Basic"}}},
).result()
print(response)
# x-ms-original-file: 2024-02-05-preview/CodeSigningAccounts_Create.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,41 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python code_signing_accounts_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
client.code_signing_accounts.begin_delete(
resource_group_name="MyResourceGroup",
account_name="MyAccount",
).result()
# x-ms-original-file: 2024-02-05-preview/CodeSigningAccounts_Delete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,42 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python code_signing_accounts_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.code_signing_accounts.get(
resource_group_name="MyResourceGroup",
account_name="MyAccount",
)
print(response)
# x-ms-original-file: 2024-02-05-preview/CodeSigningAccounts_Get.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,42 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python code_signing_accounts_list_by_resource_group.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.code_signing_accounts.list_by_resource_group(
resource_group_name="MyResourceGroup",
)
for item in response:
print(item)
# x-ms-original-file: 2024-02-05-preview/CodeSigningAccounts_ListByResourceGroup.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,40 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python code_signing_accounts_list_by_subscription.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.code_signing_accounts.list_by_subscription()
for item in response:
print(item)
# x-ms-original-file: 2024-02-05-preview/CodeSigningAccounts_ListBySubscription.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,43 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python code_signing_accounts_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.code_signing_accounts.begin_update(
resource_group_name="MyResourceGroup",
account_name="MyAccount",
properties={"tags": {"key1": "value1"}},
).result()
print(response)
# x-ms-original-file: 2024-02-05-preview/CodeSigningAccounts_Update.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,40 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from azure.identity import DefaultAzureCredential
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trustedsigning
# USAGE
python operations_list.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = TrustedSigningMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.operations.list()
for item in response:
print(item)
# x-ms-original-file: 2024-02-05-preview/Operations_List.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1,35 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import os
import pytest
from dotenv import load_dotenv
from devtools_testutils import (
test_proxy,
add_general_regex_sanitizer,
add_body_key_sanitizer,
add_header_regex_sanitizer,
)
load_dotenv()
# For security, please avoid record sensitive identity information in recordings
@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
trustedsigningmgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
trustedsigningmgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000")
trustedsigningmgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000")
trustedsigningmgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=trustedsigningmgmt_subscription_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=trustedsigningmgmt_tenant_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=trustedsigningmgmt_client_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=trustedsigningmgmt_client_secret, value="00000000-0000-0000-0000-000000000000")
add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
add_header_regex_sanitizer(key="Cookie", value="cookie;")
add_body_key_sanitizer(json_path="$..access_token", value="access_token")

Просмотреть файл

@ -0,0 +1,136 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
AZURE_LOCATION = "eastus"
@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestTrustedSigningMgmtCertificateProfilesOperations(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(TrustedSigningMgmtClient)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_certificate_profiles_get(self, resource_group):
response = self.client.certificate_profiles.get(
resource_group_name=resource_group.name,
account_name="str",
profile_name="str",
)
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_certificate_profiles_begin_create(self, resource_group):
response = self.client.certificate_profiles.begin_create(
resource_group_name=resource_group.name,
account_name="str",
profile_name="str",
resource={
"id": "str",
"name": "str",
"properties": {
"profileType": "str",
"certificates": [
{
"createdDate": "str",
"expiryDate": "str",
"revocation": {
"effectiveAt": "2020-02-20 00:00:00",
"failureReason": "str",
"reason": "str",
"remarks": "str",
"requestedAt": "2020-02-20 00:00:00",
"status": "str",
},
"serialNumber": "str",
"status": "str",
"subjectName": "str",
"thumbprint": "str",
}
],
"city": "str",
"commonName": "str",
"country": "str",
"enhancedKeyUsage": "str",
"identityValidationId": "str",
"includeCity": bool,
"includeCountry": bool,
"includePostalCode": bool,
"includeState": bool,
"includeStreetAddress": bool,
"organization": "str",
"organizationUnit": "str",
"postalCode": "str",
"provisioningState": "str",
"state": "str",
"status": "str",
"streetAddress": "str",
},
"systemData": {
"createdAt": "2020-02-20 00:00:00",
"createdBy": "str",
"createdByType": "str",
"lastModifiedAt": "2020-02-20 00:00:00",
"lastModifiedBy": "str",
"lastModifiedByType": "str",
},
"type": "str",
},
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_certificate_profiles_begin_delete(self, resource_group):
response = self.client.certificate_profiles.begin_delete(
resource_group_name=resource_group.name,
account_name="str",
profile_name="str",
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_certificate_profiles_list_by_code_signing_account(self, resource_group):
response = self.client.certificate_profiles.list_by_code_signing_account(
resource_group_name=resource_group.name,
account_name="str",
)
result = [r for r in response]
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_certificate_profiles_revoke_certificate(self, resource_group):
response = self.client.certificate_profiles.revoke_certificate(
resource_group_name=resource_group.name,
account_name="str",
profile_name="str",
body={
"effectiveAt": "2020-02-20 00:00:00",
"reason": "str",
"serialNumber": "str",
"thumbprint": "str",
"remarks": "str",
},
)
# please add some check logic here by yourself
# ...

Просмотреть файл

@ -0,0 +1,141 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.trustedsigning.aio import TrustedSigningMgmtClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
from devtools_testutils.aio import recorded_by_proxy_async
AZURE_LOCATION = "eastus"
@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestTrustedSigningMgmtCertificateProfilesOperationsAsync(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(TrustedSigningMgmtClient, is_async=True)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_certificate_profiles_get(self, resource_group):
response = await self.client.certificate_profiles.get(
resource_group_name=resource_group.name,
account_name="str",
profile_name="str",
)
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_certificate_profiles_begin_create(self, resource_group):
response = await (
await self.client.certificate_profiles.begin_create(
resource_group_name=resource_group.name,
account_name="str",
profile_name="str",
resource={
"id": "str",
"name": "str",
"properties": {
"profileType": "str",
"certificates": [
{
"createdDate": "str",
"expiryDate": "str",
"revocation": {
"effectiveAt": "2020-02-20 00:00:00",
"failureReason": "str",
"reason": "str",
"remarks": "str",
"requestedAt": "2020-02-20 00:00:00",
"status": "str",
},
"serialNumber": "str",
"status": "str",
"subjectName": "str",
"thumbprint": "str",
}
],
"city": "str",
"commonName": "str",
"country": "str",
"enhancedKeyUsage": "str",
"identityValidationId": "str",
"includeCity": bool,
"includeCountry": bool,
"includePostalCode": bool,
"includeState": bool,
"includeStreetAddress": bool,
"organization": "str",
"organizationUnit": "str",
"postalCode": "str",
"provisioningState": "str",
"state": "str",
"status": "str",
"streetAddress": "str",
},
"systemData": {
"createdAt": "2020-02-20 00:00:00",
"createdBy": "str",
"createdByType": "str",
"lastModifiedAt": "2020-02-20 00:00:00",
"lastModifiedBy": "str",
"lastModifiedByType": "str",
},
"type": "str",
},
)
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_certificate_profiles_begin_delete(self, resource_group):
response = await (
await self.client.certificate_profiles.begin_delete(
resource_group_name=resource_group.name,
account_name="str",
profile_name="str",
)
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_certificate_profiles_list_by_code_signing_account(self, resource_group):
response = self.client.certificate_profiles.list_by_code_signing_account(
resource_group_name=resource_group.name,
account_name="str",
)
result = [r async for r in response]
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_certificate_profiles_revoke_certificate(self, resource_group):
response = await self.client.certificate_profiles.revoke_certificate(
resource_group_name=resource_group.name,
account_name="str",
profile_name="str",
body={
"effectiveAt": "2020-02-20 00:00:00",
"reason": "str",
"serialNumber": "str",
"thumbprint": "str",
"remarks": "str",
},
)
# please add some check logic here by yourself
# ...

Просмотреть файл

@ -0,0 +1,108 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
AZURE_LOCATION = "eastus"
@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestTrustedSigningMgmtCodeSigningAccountsOperations(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(TrustedSigningMgmtClient)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_code_signing_accounts_get(self, resource_group):
response = self.client.code_signing_accounts.get(
resource_group_name=resource_group.name,
account_name="str",
)
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_code_signing_accounts_begin_create(self, resource_group):
response = self.client.code_signing_accounts.begin_create(
resource_group_name=resource_group.name,
account_name="str",
resource={
"location": "str",
"id": "str",
"name": "str",
"properties": {"accountUri": "str", "provisioningState": "str", "sku": {"name": "str"}},
"systemData": {
"createdAt": "2020-02-20 00:00:00",
"createdBy": "str",
"createdByType": "str",
"lastModifiedAt": "2020-02-20 00:00:00",
"lastModifiedBy": "str",
"lastModifiedByType": "str",
},
"tags": {"str": "str"},
"type": "str",
},
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_code_signing_accounts_begin_update(self, resource_group):
response = self.client.code_signing_accounts.begin_update(
resource_group_name=resource_group.name,
account_name="str",
properties={"properties": {"sku": {"name": "str"}}, "tags": {"str": "str"}},
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_code_signing_accounts_begin_delete(self, resource_group):
response = self.client.code_signing_accounts.begin_delete(
resource_group_name=resource_group.name,
account_name="str",
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_code_signing_accounts_list_by_resource_group(self, resource_group):
response = self.client.code_signing_accounts.list_by_resource_group(
resource_group_name=resource_group.name,
)
result = [r for r in response]
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_code_signing_accounts_list_by_subscription(self, resource_group):
response = self.client.code_signing_accounts.list_by_subscription()
result = [r for r in response]
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_code_signing_accounts_check_name_availability(self, resource_group):
response = self.client.code_signing_accounts.check_name_availability(
body={"name": "str"},
)
# please add some check logic here by yourself
# ...

Просмотреть файл

@ -0,0 +1,115 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.trustedsigning.aio import TrustedSigningMgmtClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
from devtools_testutils.aio import recorded_by_proxy_async
AZURE_LOCATION = "eastus"
@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestTrustedSigningMgmtCodeSigningAccountsOperationsAsync(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(TrustedSigningMgmtClient, is_async=True)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_code_signing_accounts_get(self, resource_group):
response = await self.client.code_signing_accounts.get(
resource_group_name=resource_group.name,
account_name="str",
)
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_code_signing_accounts_begin_create(self, resource_group):
response = await (
await self.client.code_signing_accounts.begin_create(
resource_group_name=resource_group.name,
account_name="str",
resource={
"location": "str",
"id": "str",
"name": "str",
"properties": {"accountUri": "str", "provisioningState": "str", "sku": {"name": "str"}},
"systemData": {
"createdAt": "2020-02-20 00:00:00",
"createdBy": "str",
"createdByType": "str",
"lastModifiedAt": "2020-02-20 00:00:00",
"lastModifiedBy": "str",
"lastModifiedByType": "str",
},
"tags": {"str": "str"},
"type": "str",
},
)
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_code_signing_accounts_begin_update(self, resource_group):
response = await (
await self.client.code_signing_accounts.begin_update(
resource_group_name=resource_group.name,
account_name="str",
properties={"properties": {"sku": {"name": "str"}}, "tags": {"str": "str"}},
)
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_code_signing_accounts_begin_delete(self, resource_group):
response = await (
await self.client.code_signing_accounts.begin_delete(
resource_group_name=resource_group.name,
account_name="str",
)
).result() # call '.result()' to poll until service return final result
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_code_signing_accounts_list_by_resource_group(self, resource_group):
response = self.client.code_signing_accounts.list_by_resource_group(
resource_group_name=resource_group.name,
)
result = [r async for r in response]
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_code_signing_accounts_list_by_subscription(self, resource_group):
response = self.client.code_signing_accounts.list_by_subscription()
result = [r async for r in response]
# please add some check logic here by yourself
# ...
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_code_signing_accounts_check_name_availability(self, resource_group):
response = await self.client.code_signing_accounts.check_name_availability(
body={"name": "str"},
)
# please add some check logic here by yourself
# ...

Просмотреть файл

@ -0,0 +1,27 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
AZURE_LOCATION = "eastus"
@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestTrustedSigningMgmtOperations(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(TrustedSigningMgmtClient)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_operations_list(self, resource_group):
response = self.client.operations.list()
result = [r for r in response]
# please add some check logic here by yourself
# ...

Просмотреть файл

@ -0,0 +1,28 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.trustedsigning.aio import TrustedSigningMgmtClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
from devtools_testutils.aio import recorded_by_proxy_async
AZURE_LOCATION = "eastus"
@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestTrustedSigningMgmtOperationsAsync(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(TrustedSigningMgmtClient, is_async=True)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_operations_list(self, resource_group):
response = self.client.operations.list()
result = [r async for r in response]
# please add some check logic here by yourself
# ...

Просмотреть файл

@ -0,0 +1,2 @@
[tool.azure-sdk-build]
breaking = false

Просмотреть файл

@ -0,0 +1,12 @@
[packaging]
package_name = "azure-mgmt-trustedsigning"
package_nspkg = "azure-mgmt-nspkg"
package_pprint_name = "Trustedsigning Management"
package_doc_id = ""
is_stable = false
is_arm = true
need_msrestazure = false
need_azuremgmtcore = true
sample_link = ""
exclude_folders = ""
title = "TrustedSigningMgmtClient"

Просмотреть файл

@ -0,0 +1,83 @@
#!/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-trustedsigning"
PACKAGE_PPRINT_NAME = "Trustedsigning 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.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"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",
]
),
include_package_data=True,
package_data={
"pytyped": ["py.typed"],
},
install_requires=[
"isodate>=0.6.1",
"typing-extensions>=4.6.0",
"azure-common>=1.1",
"azure-mgmt-core>=1.3.2",
],
python_requires=">=3.8",
)

Просмотреть файл

@ -0,0 +1,35 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import os
import pytest
from dotenv import load_dotenv
from devtools_testutils import (
test_proxy,
add_general_regex_sanitizer,
add_body_key_sanitizer,
add_header_regex_sanitizer,
)
load_dotenv()
# For security, please avoid record sensitive identity information in recordings
@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
trustedsigningmgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
trustedsigningmgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000")
trustedsigningmgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000")
trustedsigningmgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=trustedsigningmgmt_subscription_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=trustedsigningmgmt_tenant_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=trustedsigningmgmt_client_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=trustedsigningmgmt_client_secret, value="00000000-0000-0000-0000-000000000000")
add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
add_header_regex_sanitizer(key="Cookie", value="cookie;")
add_body_key_sanitizer(json_path="$..access_token", value="access_token")

Просмотреть файл

@ -0,0 +1,37 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.trustedsigning.aio import TrustedSigningMgmtClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
from devtools_testutils.aio import recorded_by_proxy_async
AZURE_LOCATION = "eastus"
@pytest.mark.live_test_only
class TestTrustedSigningMgmtCodeSigningAccountsOperationsAsync(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(TrustedSigningMgmtClient, is_async=True)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_code_signing_accounts_list_by_resource_group(self, resource_group):
response = self.client.code_signing_accounts.list_by_resource_group(
resource_group_name=resource_group.name,
)
result = [r async for r in response]
assert result == []
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_code_signing_accounts_list_by_subscription(self, resource_group):
response = self.client.code_signing_accounts.list_by_subscription()
result = [r async for r in response]
assert response

Просмотреть файл

@ -0,0 +1,37 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
AZURE_LOCATION = "eastus"
@pytest.mark.live_test_only
class TestTrustedSigningMgmtCodeSigningAccountsOperations(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(TrustedSigningMgmtClient)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_code_signing_accounts_list_by_resource_group(self, resource_group):
response = self.client.code_signing_accounts.list_by_resource_group(
resource_group_name=resource_group.name,
)
result = [r for r in response]
assert result == []
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_code_signing_accounts_list_by_subscription(self, resource_group):
response = self.client.code_signing_accounts.list_by_subscription()
result = [r for r in response]
assert response

Просмотреть файл

@ -0,0 +1,28 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.trustedsigning.aio import TrustedSigningMgmtClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
from devtools_testutils.aio import recorded_by_proxy_async
AZURE_LOCATION = "eastus"
@pytest.mark.live_test_only
class TestTrustedSigningMgmtOperationsAsync(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(TrustedSigningMgmtClient, is_async=True)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
async def test_operations_list(self, resource_group):
response = self.client.operations.list()
result = [r async for r in response]
assert result

Просмотреть файл

@ -0,0 +1,27 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import pytest
from azure.mgmt.trustedsigning import TrustedSigningMgmtClient
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
AZURE_LOCATION = "eastus"
@pytest.mark.live_test_only
class TestTrustedSigningMgmtOperations(AzureMgmtRecordedTestCase):
def setup_method(self, method):
self.client = self.create_mgmt_client(TrustedSigningMgmtClient)
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
def test_operations_list(self, resource_group):
response = self.client.operations.list()
result = [r for r in response]
assert result

Просмотреть файл

@ -0,0 +1,4 @@
directory: specification/codesigning/CodeSigning.Management
commit: e6fde2ac19d0202f0e72217a3e0f9edb63dba273
repo: Azure/azure-rest-api-specs
additionalDirectories:

34
sdk/trustedsigning/ci.yml Normal file
Просмотреть файл

@ -0,0 +1,34 @@
# 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/trustedsigning/
pr:
branches:
include:
- main
- feature/*
- hotfix/*
- release/*
- restapi*
paths:
include:
- sdk/trustedsigning/
extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: trustedsigning
TestProxy: true
Artifacts:
- name: azure-mgmt-trustedsigning
safeName: azuremgmttrustedsigning