diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/CHANGELOG.md b/sdk/confidentialledger/azure-mgmt-confidentialledger/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/MANIFEST.in b/sdk/confidentialledger/azure-mgmt-confidentialledger/MANIFEST.in new file mode 100644 index 000000000000..3a9b6517412b --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/README.md b/sdk/confidentialledger/azure-mgmt-confidentialledger/README.md new file mode 100644 index 000000000000..6047a14216be --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-confidentialledger%2FREADME.png) diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/_meta.json b/sdk/confidentialledger/azure-mgmt-confidentialledger/_meta.json new file mode 100644 index 000000000000..7d6842e15eb1 --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "caa633d21cb88b343bd25a1732e984ec9546ca12", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/confidentialledger/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/confidentialledger/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/__init__.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/__init__.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/__init__.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/__init__.py new file mode 100644 index 000000000000..d5dc95e4ca17 --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/__init__.py @@ -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 ConfidentialLedgerConfiguration +from ._confidential_ledger import ConfidentialLedger +__all__ = ['ConfidentialLedger', 'ConfidentialLedgerConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/_confidential_ledger.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/_confidential_ledger.py new file mode 100644 index 000000000000..7d50a4097903 --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/_confidential_ledger.py @@ -0,0 +1,56 @@ +# 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 ConfidentialLedgerConfiguration +from .operations import ConfidentialLedgerOperationsMixin +from .operations import Operations +from .operations import LedgerOperations +from . import models + + +class ConfidentialLedger(ConfidentialLedgerOperationsMixin, SDKClient): + """Microsoft Azure Confidential Compute Ledger Control Plane REST API version 2020-12-01-preview. + + :ivar config: Configuration for client. + :vartype config: ConfidentialLedgerConfiguration + + :ivar operations: Operations operations + :vartype operations: microsoft.confidentialledger.operations.Operations + :ivar ledger: Ledger operations + :vartype ledger: microsoft.confidentialledger.operations.LedgerOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ConfidentialLedgerConfiguration(credentials, subscription_id, base_url) + super(ConfidentialLedger, 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 = '2021-05-13-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.ledger = LedgerOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/_configuration.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/_configuration.py new file mode 100644 index 000000000000..2e5b5f3dd3da --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/_configuration.py @@ -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) 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 ConfidentialLedgerConfiguration(AzureConfiguration): + """Configuration for ConfidentialLedger + 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` + :param subscription_id: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(ConfidentialLedgerConfiguration, 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-mgmt-confidentialledger/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/__init__.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/__init__.py new file mode 100644 index 000000000000..5d48a7a11093 --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/__init__.py @@ -0,0 +1,77 @@ +# 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 AADBasedSecurityPrincipal + from ._models_py3 import CertBasedSecurityPrincipal + from ._models_py3 import CheckNameAvailabilityRequest + from ._models_py3 import CheckNameAvailabilityResponse + from ._models_py3 import ConfidentialLedgerModel + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import LedgerProperties + from ._models_py3 import Location + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperationDefinition + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import SystemData + from ._models_py3 import Tags +except (SyntaxError, ImportError): + from ._models import AADBasedSecurityPrincipal + from ._models import CertBasedSecurityPrincipal + from ._models import CheckNameAvailabilityRequest + from ._models import CheckNameAvailabilityResponse + from ._models import ConfidentialLedgerModel + from ._models import ErrorAdditionalInfo + from ._models import ErrorDetail + from ._models import ErrorResponse, ErrorResponseException + from ._models import LedgerProperties + from ._models import Location + from ._models import Resource + from ._models import ResourceProviderOperationDefinition + from ._models import ResourceProviderOperationDisplay + from ._models import SystemData + from ._models import Tags +from ._paged_models import ConfidentialLedgerModelPaged +from ._paged_models import ResourceProviderOperationDefinitionPaged +from ._confidential_ledger_enums import ( + CreatedByType, + LedgerType, + ProvisioningState, + LedgerRoleName, + CheckNameAvailabilityReason, +) + +__all__ = [ + 'AADBasedSecurityPrincipal', + 'CertBasedSecurityPrincipal', + 'CheckNameAvailabilityRequest', + 'CheckNameAvailabilityResponse', + 'ConfidentialLedgerModel', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'ErrorResponseException', + 'LedgerProperties', + 'Location', + 'Resource', + 'ResourceProviderOperationDefinition', + 'ResourceProviderOperationDisplay', + 'SystemData', + 'Tags', + 'ResourceProviderOperationDefinitionPaged', + 'ConfidentialLedgerModelPaged', + 'CreatedByType', + 'LedgerType', + 'ProvisioningState', + 'LedgerRoleName', + 'CheckNameAvailabilityReason', +] diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_confidential_ledger_enums.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_confidential_ledger_enums.py new file mode 100644 index 000000000000..2260642ddaed --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_confidential_ledger_enums.py @@ -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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + +class LedgerType(str, Enum): + + unknown = "Unknown" + public = "Public" + private = "Private" + + +class ProvisioningState(str, Enum): + + unknown = "Unknown" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + creating = "Creating" + deleting = "Deleting" + updating = "Updating" + + +class LedgerRoleName(str, Enum): + + reader = "Reader" + contributor = "Contributor" + administrator = "Administrator" + + +class CheckNameAvailabilityReason(str, Enum): + + invalid = "Invalid" + already_exists = "AlreadyExists" diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_models.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_models.py new file mode 100644 index 000000000000..27fb2c69a79f --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_models.py @@ -0,0 +1,506 @@ +# 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 AADBasedSecurityPrincipal(Model): + """AAD based security principal with associated Ledger RoleName. + + :param principal_id: UUID/GUID based Principal Id of the Security + Principal + :type principal_id: str + :param tenant_id: UUID/GUID based Tenant Id of the Security Principal + :type tenant_id: str + :param ledger_role_name: Possible values include: 'Reader', 'Contributor', + 'Administrator' + :type ledger_role_name: str or + ~microsoft.confidentialledger.models.LedgerRoleName + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'ledger_role_name': {'key': 'ledgerRoleName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AADBasedSecurityPrincipal, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.ledger_role_name = kwargs.get('ledger_role_name', None) + + +class CertBasedSecurityPrincipal(Model): + """Cert based security principal with Ledger RoleName. + + :param cert: Base64 encoded public key of the user cert (.pem or .cer) + :type cert: str + :param ledger_role_name: Possible values include: 'Reader', 'Contributor', + 'Administrator' + :type ledger_role_name: str or + ~microsoft.confidentialledger.models.LedgerRoleName + """ + + _attribute_map = { + 'cert': {'key': 'cert', 'type': 'str'}, + 'ledger_role_name': {'key': 'ledgerRoleName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertBasedSecurityPrincipal, self).__init__(**kwargs) + self.cert = kwargs.get('cert', None) + self.ledger_role_name = kwargs.get('ledger_role_name', None) + + +class CheckNameAvailabilityRequest(Model): + """The check availability request body. + + :param name: The name of the resource for which availability needs to be + checked. + :type name: str + :param type: The resource type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class CheckNameAvailabilityResponse(Model): + """The check availability result. + + :param name_available: Indicates if the resource name is available. + :type name_available: bool + :param reason: The reason why the given name is not available. Possible + values include: 'Invalid', 'AlreadyExists' + :type reason: str or + ~microsoft.confidentialledger.models.CheckNameAvailabilityReason + :param message: Detailed reason why the given name is available. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResponse, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ConfidentialLedgerModel(Model): + """Confidential Ledger. Contains the properties of Confidential Ledger + Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Resource. + :vartype name: str + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification + of the resource + :vartype system_data: ~microsoft.confidentialledger.models.SystemData + :param location: The Azure location where the Confidential Ledger is + running. + :type location: str + :param tags: Additional tags for Confidential Ledger + :type tags: dict[str, str] + :param properties: Properties of Confidential Ledger Resource. + :type properties: ~microsoft.confidentialledger.models.LedgerProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'LedgerProperties'}, + } + + def __init__(self, **kwargs): + super(ConfidentialLedgerModel, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.system_data = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + 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: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + 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[~microsoft.confidentialledger.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~microsoft.confidentialledger.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: ~microsoft.confidentialledger.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class LedgerProperties(Model): + """LedgerProperties. + + Additional Confidential Ledger properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar ledger_name: Unique name for the Confidential Ledger. + :vartype ledger_name: str + :ivar ledger_uri: Endpoint for calling Ledger Service. + :vartype ledger_uri: str + :ivar identity_service_uri: Endpoint for accessing network identity. + :vartype identity_service_uri: str + :ivar ledger_internal_namespace: Internal namespace for the Ledger + :vartype ledger_internal_namespace: str + :param ledger_type: Type of Confidential Ledger. Possible values include: + 'Unknown', 'Public', 'Private' + :type ledger_type: str or ~microsoft.confidentialledger.models.LedgerType + :ivar provisioning_state: Provisioning state of Ledger Resource. Possible + values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Creating', + 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~microsoft.confidentialledger.models.ProvisioningState + :param aad_based_security_principals: Array of all AAD based Security + Principals. + :type aad_based_security_principals: + list[~microsoft.confidentialledger.models.AADBasedSecurityPrincipal] + :param cert_based_security_principals: Array of all cert based Security + Principals. + :type cert_based_security_principals: + list[~microsoft.confidentialledger.models.CertBasedSecurityPrincipal] + """ + + _validation = { + 'ledger_name': {'readonly': True}, + 'ledger_uri': {'readonly': True}, + 'identity_service_uri': {'readonly': True}, + 'ledger_internal_namespace': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'ledger_name': {'key': 'ledgerName', 'type': 'str'}, + 'ledger_uri': {'key': 'ledgerUri', 'type': 'str'}, + 'identity_service_uri': {'key': 'identityServiceUri', 'type': 'str'}, + 'ledger_internal_namespace': {'key': 'ledgerInternalNamespace', 'type': 'str'}, + 'ledger_type': {'key': 'ledgerType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'aad_based_security_principals': {'key': 'aadBasedSecurityPrincipals', 'type': '[AADBasedSecurityPrincipal]'}, + 'cert_based_security_principals': {'key': 'certBasedSecurityPrincipals', 'type': '[CertBasedSecurityPrincipal]'}, + } + + def __init__(self, **kwargs): + super(LedgerProperties, self).__init__(**kwargs) + self.ledger_name = None + self.ledger_uri = None + self.identity_service_uri = None + self.ledger_internal_namespace = None + self.ledger_type = kwargs.get('ledger_type', None) + self.provisioning_state = None + self.aad_based_security_principals = kwargs.get('aad_based_security_principals', None) + self.cert_based_security_principals = kwargs.get('cert_based_security_principals', None) + + +class Location(Model): + """Location of the ARM Resource. + + :param location: The Azure location where the Confidential Ledger is + running. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Location, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + + +class Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Resource. + :vartype name: str + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification + of the resource + :vartype system_data: ~microsoft.confidentialledger.models.SystemData + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.system_data = None + + +class ResourceProviderOperationDefinition(Model): + """Describes the Resource Provider Operation. + + :param name: Resource provider operation name. + :type name: str + :param is_data_action: Indicates whether the operation is data action or + not. + :type is_data_action: bool + :param display: Details about the operations + :type display: + ~microsoft.confidentialledger.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + + +class ResourceProviderOperationDisplay(Model): + """Describes the properties of the Operation. + + :param provider: Name of the resource provider. + :type provider: str + :param resource: Name of the resource type. + :type resource: str + :param operation: Name of the resource provider operation. + :type operation: str + :param description: Description of the resource provider operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~microsoft.confidentialledger.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~microsoft.confidentialledger.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class Tags(Model): + """Tags for Confidential Ledger Resource. + + :param tags: Additional tags for Confidential Ledger + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Tags, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_models_py3.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_models_py3.py new file mode 100644 index 000000000000..25467194d54e --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_models_py3.py @@ -0,0 +1,506 @@ +# 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 AADBasedSecurityPrincipal(Model): + """AAD based security principal with associated Ledger RoleName. + + :param principal_id: UUID/GUID based Principal Id of the Security + Principal + :type principal_id: str + :param tenant_id: UUID/GUID based Tenant Id of the Security Principal + :type tenant_id: str + :param ledger_role_name: Possible values include: 'Reader', 'Contributor', + 'Administrator' + :type ledger_role_name: str or + ~microsoft.confidentialledger.models.LedgerRoleName + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'ledger_role_name': {'key': 'ledgerRoleName', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, tenant_id: str=None, ledger_role_name=None, **kwargs) -> None: + super(AADBasedSecurityPrincipal, self).__init__(**kwargs) + self.principal_id = principal_id + self.tenant_id = tenant_id + self.ledger_role_name = ledger_role_name + + +class CertBasedSecurityPrincipal(Model): + """Cert based security principal with Ledger RoleName. + + :param cert: Base64 encoded public key of the user cert (.pem or .cer) + :type cert: str + :param ledger_role_name: Possible values include: 'Reader', 'Contributor', + 'Administrator' + :type ledger_role_name: str or + ~microsoft.confidentialledger.models.LedgerRoleName + """ + + _attribute_map = { + 'cert': {'key': 'cert', 'type': 'str'}, + 'ledger_role_name': {'key': 'ledgerRoleName', 'type': 'str'}, + } + + def __init__(self, *, cert: str=None, ledger_role_name=None, **kwargs) -> None: + super(CertBasedSecurityPrincipal, self).__init__(**kwargs) + self.cert = cert + self.ledger_role_name = ledger_role_name + + +class CheckNameAvailabilityRequest(Model): + """The check availability request body. + + :param name: The name of the resource for which availability needs to be + checked. + :type name: str + :param type: The resource type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CheckNameAvailabilityResponse(Model): + """The check availability result. + + :param name_available: Indicates if the resource name is available. + :type name_available: bool + :param reason: The reason why the given name is not available. Possible + values include: 'Invalid', 'AlreadyExists' + :type reason: str or + ~microsoft.confidentialledger.models.CheckNameAvailabilityReason + :param message: Detailed reason why the given name is available. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason=None, message: str=None, **kwargs) -> None: + super(CheckNameAvailabilityResponse, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ConfidentialLedgerModel(Model): + """Confidential Ledger. Contains the properties of Confidential Ledger + Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Resource. + :vartype name: str + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification + of the resource + :vartype system_data: ~microsoft.confidentialledger.models.SystemData + :param location: The Azure location where the Confidential Ledger is + running. + :type location: str + :param tags: Additional tags for Confidential Ledger + :type tags: dict[str, str] + :param properties: Properties of Confidential Ledger Resource. + :type properties: ~microsoft.confidentialledger.models.LedgerProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'LedgerProperties'}, + } + + def __init__(self, *, location: str=None, tags=None, properties=None, **kwargs) -> None: + super(ConfidentialLedgerModel, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.system_data = None + self.location = location + self.tags = tags + self.properties = properties + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + 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: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(Model): + """The error detail. + + 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[~microsoft.confidentialledger.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~microsoft.confidentialledger.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(Model): + """Error response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + :param error: The error object. + :type error: ~microsoft.confidentialledger.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class LedgerProperties(Model): + """LedgerProperties. + + Additional Confidential Ledger properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar ledger_name: Unique name for the Confidential Ledger. + :vartype ledger_name: str + :ivar ledger_uri: Endpoint for calling Ledger Service. + :vartype ledger_uri: str + :ivar identity_service_uri: Endpoint for accessing network identity. + :vartype identity_service_uri: str + :ivar ledger_internal_namespace: Internal namespace for the Ledger + :vartype ledger_internal_namespace: str + :param ledger_type: Type of Confidential Ledger. Possible values include: + 'Unknown', 'Public', 'Private' + :type ledger_type: str or ~microsoft.confidentialledger.models.LedgerType + :ivar provisioning_state: Provisioning state of Ledger Resource. Possible + values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Creating', + 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~microsoft.confidentialledger.models.ProvisioningState + :param aad_based_security_principals: Array of all AAD based Security + Principals. + :type aad_based_security_principals: + list[~microsoft.confidentialledger.models.AADBasedSecurityPrincipal] + :param cert_based_security_principals: Array of all cert based Security + Principals. + :type cert_based_security_principals: + list[~microsoft.confidentialledger.models.CertBasedSecurityPrincipal] + """ + + _validation = { + 'ledger_name': {'readonly': True}, + 'ledger_uri': {'readonly': True}, + 'identity_service_uri': {'readonly': True}, + 'ledger_internal_namespace': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'ledger_name': {'key': 'ledgerName', 'type': 'str'}, + 'ledger_uri': {'key': 'ledgerUri', 'type': 'str'}, + 'identity_service_uri': {'key': 'identityServiceUri', 'type': 'str'}, + 'ledger_internal_namespace': {'key': 'ledgerInternalNamespace', 'type': 'str'}, + 'ledger_type': {'key': 'ledgerType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'aad_based_security_principals': {'key': 'aadBasedSecurityPrincipals', 'type': '[AADBasedSecurityPrincipal]'}, + 'cert_based_security_principals': {'key': 'certBasedSecurityPrincipals', 'type': '[CertBasedSecurityPrincipal]'}, + } + + def __init__(self, *, ledger_type=None, aad_based_security_principals=None, cert_based_security_principals=None, **kwargs) -> None: + super(LedgerProperties, self).__init__(**kwargs) + self.ledger_name = None + self.ledger_uri = None + self.identity_service_uri = None + self.ledger_internal_namespace = None + self.ledger_type = ledger_type + self.provisioning_state = None + self.aad_based_security_principals = aad_based_security_principals + self.cert_based_security_principals = cert_based_security_principals + + +class Location(Model): + """Location of the ARM Resource. + + :param location: The Azure location where the Confidential Ledger is + running. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, **kwargs) -> None: + super(Location, self).__init__(**kwargs) + self.location = location + + +class Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Resource. + :vartype name: str + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification + of the resource + :vartype system_data: ~microsoft.confidentialledger.models.SystemData + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.system_data = None + + +class ResourceProviderOperationDefinition(Model): + """Describes the Resource Provider Operation. + + :param name: Resource provider operation name. + :type name: str + :param is_data_action: Indicates whether the operation is data action or + not. + :type is_data_action: bool + :param display: Details about the operations + :type display: + ~microsoft.confidentialledger.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, **kwargs) -> None: + super(ResourceProviderOperationDefinition, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + + +class ResourceProviderOperationDisplay(Model): + """Describes the properties of the Operation. + + :param provider: Name of the resource provider. + :type provider: str + :param resource: Name of the resource type. + :type resource: str + :param operation: Name of the resource provider operation. + :type operation: str + :param description: Description of the resource provider operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~microsoft.confidentialledger.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~microsoft.confidentialledger.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class Tags(Model): + """Tags for Confidential Ledger Resource. + + :param tags: Additional tags for Confidential Ledger + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(Tags, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_paged_models.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_paged_models.py new file mode 100644 index 000000000000..fded1d013445 --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/models/_paged_models.py @@ -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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ResourceProviderOperationDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceProviderOperationDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceProviderOperationDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceProviderOperationDefinitionPaged, self).__init__(*args, **kwargs) +class ConfidentialLedgerModelPaged(Paged): + """ + A paging container for iterating over a list of :class:`ConfidentialLedgerModel ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConfidentialLedgerModel]'} + } + + def __init__(self, *args, **kwargs): + + super(ConfidentialLedgerModelPaged, self).__init__(*args, **kwargs) diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/__init__.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/__init__.py new file mode 100644 index 000000000000..3a7ce50fe267 --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/__init__.py @@ -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 ._operations import Operations +from ._ledger_operations import LedgerOperations +from ._confidential_ledger_operations import ConfidentialLedgerOperationsMixin + +__all__ = [ + 'Operations', + 'LedgerOperations', + 'ConfidentialLedgerOperationsMixin', +] diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/_confidential_ledger_operations.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/_confidential_ledger_operations.py new file mode 100644 index 000000000000..2137fbabe3ff --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/_confidential_ledger_operations.py @@ -0,0 +1,86 @@ +# 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.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling +from .. import models +import uuid + + +class ConfidentialLedgerOperationsMixin(object): + + def check_name_availability( + self, name=None, type=None, custom_headers=None, raw=False, **operation_config): + """To check whether a resource name is available. + + :param name: The name of the resource for which availability needs to + be checked. + :type name: str + :param type: The resource type. + :type type: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameAvailabilityResponse or ClientRawResponse if + raw=true + :rtype: + ~microsoft.confidentialledger.models.CheckNameAvailabilityResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + name_availability_request = models.CheckNameAvailabilityRequest(name=name, type=type) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(name_availability_request, 'CheckNameAvailabilityRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConfidentialLedger/checkNameAvailability'} diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/_ledger_operations.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/_ledger_operations.py new file mode 100644 index 000000000000..20da73f08d1d --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/_ledger_operations.py @@ -0,0 +1,537 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class LedgerOperations(object): + """LedgerOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2021-05-13-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-05-13-preview" + + self.config = config + + def get( + self, resource_group_name, ledger_name, custom_headers=None, raw=False, **operation_config): + """Retrieves information about a Confidential Ledger resource. + + Retrieves the properties of a Confidential Ledger. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ledger_name: Name of the Confidential Ledger + :type ledger_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConfidentialLedgerModel or ClientRawResponse if raw=true + :rtype: ~microsoft.confidentialledger.models.ConfidentialLedgerModel + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=3), + 'ledgerName': self._serialize.url("ledger_name", ledger_name, 'str', pattern=r'^[a-zA-Z0-9]') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConfidentialLedgerModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}'} + + + def _delete_initial( + self, resource_group_name, ledger_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=3), + 'ledgerName': self._serialize.url("ledger_name", ledger_name, 'str', pattern=r'^[a-zA-Z0-9]') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, ledger_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a Confidential Ledger resource. + + Deletes an existing Confidential Ledger. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ledger_name: Name of the Confidential Ledger + :type ledger_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + ledger_name=ledger_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}'} + + + def _create_initial( + self, resource_group_name, ledger_name, confidential_ledger, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=3), + 'ledgerName': self._serialize.url("ledger_name", ledger_name, 'str', pattern=r'^[a-zA-Z0-9]') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(confidential_ledger, 'ConfidentialLedgerModel') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConfidentialLedgerModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, ledger_name, confidential_ledger, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a Confidential Ledger. + + Creates a Confidential Ledger with the specified ledger parameters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ledger_name: Name of the Confidential Ledger + :type ledger_name: str + :param confidential_ledger: Confidential Ledger Create Request Body + :type confidential_ledger: + ~microsoft.confidentialledger.models.ConfidentialLedgerModel + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConfidentialLedgerModel + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~microsoft.confidentialledger.models.ConfidentialLedgerModel] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~microsoft.confidentialledger.models.ConfidentialLedgerModel]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + ledger_name=ledger_name, + confidential_ledger=confidential_ledger, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfidentialLedgerModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}'} + + + def _update_initial( + self, resource_group_name, ledger_name, confidential_ledger, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=3), + 'ledgerName': self._serialize.url("ledger_name", ledger_name, 'str', pattern=r'^[a-zA-Z0-9]') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(confidential_ledger, 'ConfidentialLedgerModel') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConfidentialLedgerModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, ledger_name, confidential_ledger, custom_headers=None, raw=False, polling=True, **operation_config): + """Update Confidential Ledger properties. + + Updates properties of Confidential Ledger. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param ledger_name: Name of the Confidential Ledger + :type ledger_name: str + :param confidential_ledger: Confidential Ledger request body for + Updating Ledger + :type confidential_ledger: + ~microsoft.confidentialledger.models.ConfidentialLedgerModel + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConfidentialLedgerModel + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~microsoft.confidentialledger.models.ConfidentialLedgerModel] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~microsoft.confidentialledger.models.ConfidentialLedgerModel]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + ledger_name=ledger_name, + confidential_ledger=confidential_ledger, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfidentialLedgerModel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers/{ledgerName}'} + + def list_by_resource_group( + self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieves information about all Confidential Ledger resources under the + given subscription and resource group. + + Retrieves the properties of all Confidential Ledgers. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param filter: The filter to apply on the list operation. eg. + $filter=ledgerType eq 'Public' + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConfidentialLedgerModel + :rtype: + ~microsoft.confidentialledger.models.ConfidentialLedgerModelPaged[~microsoft.confidentialledger.models.ConfidentialLedgerModel] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ConfidentialLedgerModelPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/ledgers'} + + def list_by_subscription( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieves information about all Confidential Ledger resources under the + given subscription. + + Retrieves the properties of all Confidential Ledgers. + + :param filter: The filter to apply on the list operation. eg. + $filter=ledgerType eq 'Public' + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConfidentialLedgerModel + :rtype: + ~microsoft.confidentialledger.models.ConfidentialLedgerModelPaged[~microsoft.confidentialledger.models.ConfidentialLedgerModel] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ConfidentialLedgerModelPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ConfidentialLedger/ledgers/'} diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/_operations.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/_operations.py new file mode 100644 index 000000000000..dae003f7b8c4 --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to be used with the HTTP request. Constant value: "2021-05-13-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-05-13-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Retrieves a list of available API operations under this Resource + Provider. + + Retrieves a list of available API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + ResourceProviderOperationDefinition + :rtype: + ~microsoft.confidentialledger.models.ResourceProviderOperationDefinitionPaged[~microsoft.confidentialledger.models.ResourceProviderOperationDefinition] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ResourceProviderOperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ConfidentialLedger/operations'} diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/version.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/version.py new file mode 100644 index 000000000000..b8ffb04f789f --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.0.1" + diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/sdk_packaging.toml b/sdk/confidentialledger/azure-mgmt-confidentialledger/sdk_packaging.toml new file mode 100644 index 000000000000..3e7058610a2e --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-confidentialledger" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/setup.cfg b/sdk/confidentialledger/azure-mgmt-confidentialledger/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/confidentialledger/azure-mgmt-confidentialledger/setup.py b/sdk/confidentialledger/azure-mgmt-confidentialledger/setup.py new file mode 100644 index 000000000000..08aee616897e --- /dev/null +++ b/sdk/confidentialledger/azure-mgmt-confidentialledger/setup.py @@ -0,0 +1,91 @@ +#!/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-confidentialledger" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# 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', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.6.21', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/sdk/confidentialledger/ci.yml b/sdk/confidentialledger/ci.yml new file mode 100644 index 000000000000..4c679189ef0b --- /dev/null +++ b/sdk/confidentialledger/ci.yml @@ -0,0 +1,35 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/confidentialledger/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/confidentialledger/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: confidentialledger + Artifacts: + - name: azure-mgmt-confidentialledger + safeName: azuremgmtconfidentialledger