forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 11821 in Azure/azure-rest-api-specs
Merge fb765140fdf87e723b930a122220e60f24f80c7e into 4b0ba85
- Loading branch information
SDKAuto
committed
Nov 26, 2020
1 parent
e1f2009
commit a559842
Showing
13 changed files
with
1,126 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
sdk/attestation/azure-attestation/azure/attestation/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._configuration import AttestationClientConfiguration | ||
from ._attestation_client import AttestationClient | ||
__all__ = ['AttestationClient', 'AttestationClientConfiguration'] | ||
|
||
from .version import VERSION | ||
|
||
__version__ = VERSION | ||
|
61 changes: 61 additions & 0 deletions
61
sdk/attestation/azure-attestation/azure/attestation/_attestation_client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from msrest.service_client import SDKClient | ||
from msrest import Serializer, Deserializer | ||
|
||
from ._configuration import AttestationClientConfiguration | ||
from .operations import PolicyOperations | ||
from .operations import PolicyCertificatesOperations | ||
from .operations import SigningCertificatesOperations | ||
from .operations import MetadataConfigurationOperations | ||
from . import models | ||
|
||
|
||
class AttestationClient(SDKClient): | ||
"""Describes the interface for the per-tenant enclave service. | ||
:ivar config: Configuration for client. | ||
:vartype config: AttestationClientConfiguration | ||
:ivar policy: Policy operations | ||
:vartype policy: azure.attestation.operations.PolicyOperations | ||
:ivar policy_certificates: PolicyCertificates operations | ||
:vartype policy_certificates: azure.attestation.operations.PolicyCertificatesOperations | ||
:ivar signing_certificates: SigningCertificates operations | ||
:vartype signing_certificates: azure.attestation.operations.SigningCertificatesOperations | ||
:ivar metadata_configuration: MetadataConfiguration operations | ||
:vartype metadata_configuration: azure.attestation.operations.MetadataConfigurationOperations | ||
:param credentials: Credentials needed for the client to connect to Azure. | ||
:type credentials: :mod:`A msrestazure Credentials | ||
object<msrestazure.azure_active_directory>` | ||
""" | ||
|
||
def __init__( | ||
self, credentials): | ||
|
||
self.config = AttestationClientConfiguration(credentials) | ||
super(AttestationClient, self).__init__(self.config.credentials, self.config) | ||
|
||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} | ||
self.api_version = '2018-09-01-preview' | ||
self._serialize = Serializer(client_models) | ||
self._deserialize = Deserializer(client_models) | ||
|
||
self.policy = PolicyOperations( | ||
self._client, self.config, self._serialize, self._deserialize) | ||
self.policy_certificates = PolicyCertificatesOperations( | ||
self._client, self.config, self._serialize, self._deserialize) | ||
self.signing_certificates = SigningCertificatesOperations( | ||
self._client, self.config, self._serialize, self._deserialize) | ||
self.metadata_configuration = MetadataConfigurationOperations( | ||
self._client, self.config, self._serialize, self._deserialize) |
41 changes: 41 additions & 0 deletions
41
sdk/attestation/azure-attestation/azure/attestation/_configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
from msrestazure import AzureConfiguration | ||
|
||
from .version import VERSION | ||
|
||
|
||
class AttestationClientConfiguration(AzureConfiguration): | ||
"""Configuration for AttestationClient | ||
Note that all parameters used to create this instance are saved as instance | ||
attributes. | ||
:param credentials: Credentials needed for the client to connect to Azure. | ||
:type credentials: :mod:`A msrestazure Credentials | ||
object<msrestazure.azure_active_directory>` | ||
""" | ||
|
||
def __init__( | ||
self, credentials): | ||
|
||
if credentials is None: | ||
raise ValueError("Parameter 'credentials' must not be None.") | ||
base_url = '{tenantBaseUrl}' | ||
|
||
super(AttestationClientConfiguration, self).__init__(base_url) | ||
|
||
# Starting Autorest.Python 4.0.64, make connection pool activated by default | ||
self.keep_alive = True | ||
|
||
self.add_user_agent('azure-attestation/{}'.format(VERSION)) | ||
self.add_user_agent('Azure-SDK-For-Python') | ||
|
||
self.credentials = credentials |
23 changes: 23 additions & 0 deletions
23
sdk/attestation/azure-attestation/azure/attestation/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
try: | ||
from ._models_py3 import AttestationPolicy | ||
except (SyntaxError, ImportError): | ||
from ._models import AttestationPolicy | ||
from ._attestation_client_enums import ( | ||
TeeKind, | ||
) | ||
|
||
__all__ = [ | ||
'AttestationPolicy', | ||
'TeeKind', | ||
] |
20 changes: 20 additions & 0 deletions
20
sdk/attestation/azure-attestation/azure/attestation/models/_attestation_client_enums.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from enum import Enum | ||
|
||
|
||
class TeeKind(str, Enum): | ||
|
||
sgx_enclave = "SgxEnclave" #: Intel Software Guard eXtensions | ||
open_enclave = "OpenEnclave" #: OpenEnclave extensions to SGX | ||
cy_res_component = "CyResComponent" #: IoT Edge validation | ||
vsm_enclave = "VSMEnclave" #: VSM Enclave Attestation |
80 changes: 80 additions & 0 deletions
80
sdk/attestation/azure-attestation/azure/attestation/models/_models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from msrest.serialization import Model | ||
from msrest.exceptions import HttpOperationError | ||
|
||
|
||
class AttestationPolicy(Model): | ||
"""AttestationPolicy. | ||
:param policy: JSON Web Token whose body is an AttestationPolicyRequest | ||
definition. | ||
:type policy: str | ||
""" | ||
|
||
_attribute_map = { | ||
'policy': {'key': 'policy', 'type': 'str'}, | ||
} | ||
|
||
def __init__(self, **kwargs): | ||
super(AttestationPolicy, self).__init__(**kwargs) | ||
self.policy = kwargs.get('policy', None) | ||
|
||
|
||
class CloudError(Model): | ||
"""An error response from Attestation. | ||
:param error: | ||
:type error: ~azure.attestation.models.CloudErrorBody | ||
""" | ||
|
||
_attribute_map = { | ||
'error': {'key': 'error', 'type': 'CloudErrorBody'}, | ||
} | ||
|
||
def __init__(self, **kwargs): | ||
super(CloudError, self).__init__(**kwargs) | ||
self.error = kwargs.get('error', None) | ||
|
||
|
||
class CloudErrorException(HttpOperationError): | ||
"""Server responsed with exception of type: 'CloudError'. | ||
:param deserialize: A deserializer | ||
:param response: Server response to be deserialized. | ||
""" | ||
|
||
def __init__(self, deserialize, response, *args): | ||
|
||
super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) | ||
|
||
|
||
class CloudErrorBody(Model): | ||
"""An error response from Attestation. | ||
:param code: An identifier for the error. Codes are invariant and are | ||
intended to be consumed programmatically. | ||
:type code: str | ||
:param message: A message describing the error, intended to be suitable | ||
for displaying in a user interface. | ||
:type message: str | ||
""" | ||
|
||
_attribute_map = { | ||
'code': {'key': 'code', 'type': 'str'}, | ||
'message': {'key': 'message', 'type': 'str'}, | ||
} | ||
|
||
def __init__(self, **kwargs): | ||
super(CloudErrorBody, self).__init__(**kwargs) | ||
self.code = kwargs.get('code', None) | ||
self.message = kwargs.get('message', None) |
80 changes: 80 additions & 0 deletions
80
sdk/attestation/azure-attestation/azure/attestation/models/_models_py3.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from msrest.serialization import Model | ||
from msrest.exceptions import HttpOperationError | ||
|
||
|
||
class AttestationPolicy(Model): | ||
"""AttestationPolicy. | ||
:param policy: JSON Web Token whose body is an AttestationPolicyRequest | ||
definition. | ||
:type policy: str | ||
""" | ||
|
||
_attribute_map = { | ||
'policy': {'key': 'policy', 'type': 'str'}, | ||
} | ||
|
||
def __init__(self, *, policy: str=None, **kwargs) -> None: | ||
super(AttestationPolicy, self).__init__(**kwargs) | ||
self.policy = policy | ||
|
||
|
||
class CloudError(Model): | ||
"""An error response from Attestation. | ||
:param error: | ||
:type error: ~azure.attestation.models.CloudErrorBody | ||
""" | ||
|
||
_attribute_map = { | ||
'error': {'key': 'error', 'type': 'CloudErrorBody'}, | ||
} | ||
|
||
def __init__(self, *, error=None, **kwargs) -> None: | ||
super(CloudError, self).__init__(**kwargs) | ||
self.error = error | ||
|
||
|
||
class CloudErrorException(HttpOperationError): | ||
"""Server responsed with exception of type: 'CloudError'. | ||
:param deserialize: A deserializer | ||
:param response: Server response to be deserialized. | ||
""" | ||
|
||
def __init__(self, deserialize, response, *args): | ||
|
||
super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) | ||
|
||
|
||
class CloudErrorBody(Model): | ||
"""An error response from Attestation. | ||
:param code: An identifier for the error. Codes are invariant and are | ||
intended to be consumed programmatically. | ||
:type code: str | ||
:param message: A message describing the error, intended to be suitable | ||
for displaying in a user interface. | ||
:type message: str | ||
""" | ||
|
||
_attribute_map = { | ||
'code': {'key': 'code', 'type': 'str'}, | ||
'message': {'key': 'message', 'type': 'str'}, | ||
} | ||
|
||
def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: | ||
super(CloudErrorBody, self).__init__(**kwargs) | ||
self.code = code | ||
self.message = message |
22 changes: 22 additions & 0 deletions
22
sdk/attestation/azure-attestation/azure/attestation/operations/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from ._policy_operations import PolicyOperations | ||
from ._policy_certificates_operations import PolicyCertificatesOperations | ||
from ._signing_certificates_operations import SigningCertificatesOperations | ||
from ._metadata_configuration_operations import MetadataConfigurationOperations | ||
|
||
__all__ = [ | ||
'PolicyOperations', | ||
'PolicyCertificatesOperations', | ||
'SigningCertificatesOperations', | ||
'MetadataConfigurationOperations', | ||
] |
Oops, something went wrong.