diff --git a/sdk/datashare/azure-mgmt-datashare/HISTORY.rst b/sdk/datashare/azure-mgmt-datashare/HISTORY.rst new file mode 100644 index 000000000000..3dbe37ba7345 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0rc1 (2019-09-29) ++++++++++++++++++++++ + +* Initial Release diff --git a/sdk/datashare/azure-mgmt-datashare/MANIFEST.in b/sdk/datashare/azure-mgmt-datashare/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/datashare/azure-mgmt-datashare/README.rst b/sdk/datashare/azure-mgmt-datashare/README.rst new file mode 100644 index 000000000000..adedd3a7b8c5 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-datashare%2FREADME.png diff --git a/sdk/datashare/azure-mgmt-datashare/azure/__init__.py b/sdk/datashare/azure-mgmt-datashare/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/__init__.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/__init__.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/__init__.py new file mode 100644 index 000000000000..092e5ef32e5f --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/__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 DataShareManagementClientConfiguration +from ._data_share_management_client import DataShareManagementClient +__all__ = ['DataShareManagementClient', 'DataShareManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/_configuration.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/_configuration.py new file mode 100644 index 000000000000..24945998d0fd --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/_configuration.py @@ -0,0 +1,48 @@ +# 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 DataShareManagementClientConfiguration(AzureConfiguration): + """Configuration for DataShareManagementClient + 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 subscription identifier + :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(DataShareManagementClientConfiguration, 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-datashare/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/_data_share_management_client.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/_data_share_management_client.py new file mode 100644 index 000000000000..19a375c22f11 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/_data_share_management_client.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. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import DataShareManagementClientConfiguration +from .operations import AccountsOperations +from .operations import ConsumerInvitationsOperations +from .operations import DataSetsOperations +from .operations import DataSetMappingsOperations +from .operations import InvitationsOperations +from .operations import Operations +from .operations import SharesOperations +from .operations import ProviderShareSubscriptionsOperations +from .operations import ShareSubscriptionsOperations +from .operations import ConsumerSourceDataSetsOperations +from .operations import SynchronizationSettingsOperations +from .operations import TriggersOperations +from . import models + + +class DataShareManagementClient(SDKClient): + """Creates a Microsoft.DataShare management client. + + :ivar config: Configuration for client. + :vartype config: DataShareManagementClientConfiguration + + :ivar accounts: Accounts operations + :vartype accounts: azure.mgmt.datashare.operations.AccountsOperations + :ivar consumer_invitations: ConsumerInvitations operations + :vartype consumer_invitations: azure.mgmt.datashare.operations.ConsumerInvitationsOperations + :ivar data_sets: DataSets operations + :vartype data_sets: azure.mgmt.datashare.operations.DataSetsOperations + :ivar data_set_mappings: DataSetMappings operations + :vartype data_set_mappings: azure.mgmt.datashare.operations.DataSetMappingsOperations + :ivar invitations: Invitations operations + :vartype invitations: azure.mgmt.datashare.operations.InvitationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.datashare.operations.Operations + :ivar shares: Shares operations + :vartype shares: azure.mgmt.datashare.operations.SharesOperations + :ivar provider_share_subscriptions: ProviderShareSubscriptions operations + :vartype provider_share_subscriptions: azure.mgmt.datashare.operations.ProviderShareSubscriptionsOperations + :ivar share_subscriptions: ShareSubscriptions operations + :vartype share_subscriptions: azure.mgmt.datashare.operations.ShareSubscriptionsOperations + :ivar consumer_source_data_sets: ConsumerSourceDataSets operations + :vartype consumer_source_data_sets: azure.mgmt.datashare.operations.ConsumerSourceDataSetsOperations + :ivar synchronization_settings: SynchronizationSettings operations + :vartype synchronization_settings: azure.mgmt.datashare.operations.SynchronizationSettingsOperations + :ivar triggers: Triggers operations + :vartype triggers: azure.mgmt.datashare.operations.TriggersOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription identifier + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = DataShareManagementClientConfiguration(credentials, subscription_id, base_url) + super(DataShareManagementClient, 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-11-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.accounts = AccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.consumer_invitations = ConsumerInvitationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.data_sets = DataSetsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.data_set_mappings = DataSetMappingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.invitations = InvitationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.shares = SharesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.provider_share_subscriptions = ProviderShareSubscriptionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.share_subscriptions = ShareSubscriptionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.consumer_source_data_sets = ConsumerSourceDataSetsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.synchronization_settings = SynchronizationSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.triggers = TriggersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/__init__.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/__init__.py new file mode 100644 index 000000000000..b48f8c52adac --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/__init__.py @@ -0,0 +1,224 @@ +# 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 Account + from ._models_py3 import AccountUpdateParameters + from ._models_py3 import ADLSGen1FileDataSet + from ._models_py3 import ADLSGen1FolderDataSet + from ._models_py3 import ADLSGen2FileDataSet + from ._models_py3 import ADLSGen2FileDataSetMapping + from ._models_py3 import ADLSGen2FileSystemDataSet + from ._models_py3 import ADLSGen2FileSystemDataSetMapping + from ._models_py3 import ADLSGen2FolderDataSet + from ._models_py3 import ADLSGen2FolderDataSetMapping + from ._models_py3 import BlobContainerDataSet + from ._models_py3 import BlobContainerDataSetMapping + from ._models_py3 import BlobDataSet + from ._models_py3 import BlobDataSetMapping + from ._models_py3 import BlobFolderDataSet + from ._models_py3 import BlobFolderDataSetMapping + from ._models_py3 import ConsumerInvitation + from ._models_py3 import ConsumerSourceDataSet + from ._models_py3 import DataSet + from ._models_py3 import DataSetMapping + from ._models_py3 import DataShareError, DataShareErrorException + from ._models_py3 import DataShareErrorInfo + from ._models_py3 import DefaultDto + from ._models_py3 import DimensionProperties + from ._models_py3 import Identity + from ._models_py3 import Invitation + from ._models_py3 import OperationMetaLogSpecification + from ._models_py3 import OperationMetaMetricSpecification + from ._models_py3 import OperationMetaServiceSpecification + from ._models_py3 import OperationModel + from ._models_py3 import OperationModelProperties + from ._models_py3 import OperationResponse + from ._models_py3 import ProviderShareSubscription + from ._models_py3 import ProxyDto + from ._models_py3 import ScheduledSourceSynchronizationSetting + from ._models_py3 import ScheduledSynchronizationSetting + from ._models_py3 import ScheduledTrigger + from ._models_py3 import Share + from ._models_py3 import ShareSubscription + from ._models_py3 import ShareSubscriptionSynchronization + from ._models_py3 import ShareSynchronization + from ._models_py3 import SourceShareSynchronizationSetting + from ._models_py3 import SqlDBTableDataSet + from ._models_py3 import SqlDBTableDataSetMapping + from ._models_py3 import SqlDWTableDataSet + from ._models_py3 import SqlDWTableDataSetMapping + from ._models_py3 import SynchronizationDetails + from ._models_py3 import SynchronizationSetting + from ._models_py3 import Synchronize + from ._models_py3 import Trigger +except (SyntaxError, ImportError): + from ._models import Account + from ._models import AccountUpdateParameters + from ._models import ADLSGen1FileDataSet + from ._models import ADLSGen1FolderDataSet + from ._models import ADLSGen2FileDataSet + from ._models import ADLSGen2FileDataSetMapping + from ._models import ADLSGen2FileSystemDataSet + from ._models import ADLSGen2FileSystemDataSetMapping + from ._models import ADLSGen2FolderDataSet + from ._models import ADLSGen2FolderDataSetMapping + from ._models import BlobContainerDataSet + from ._models import BlobContainerDataSetMapping + from ._models import BlobDataSet + from ._models import BlobDataSetMapping + from ._models import BlobFolderDataSet + from ._models import BlobFolderDataSetMapping + from ._models import ConsumerInvitation + from ._models import ConsumerSourceDataSet + from ._models import DataSet + from ._models import DataSetMapping + from ._models import DataShareError, DataShareErrorException + from ._models import DataShareErrorInfo + from ._models import DefaultDto + from ._models import DimensionProperties + from ._models import Identity + from ._models import Invitation + from ._models import OperationMetaLogSpecification + from ._models import OperationMetaMetricSpecification + from ._models import OperationMetaServiceSpecification + from ._models import OperationModel + from ._models import OperationModelProperties + from ._models import OperationResponse + from ._models import ProviderShareSubscription + from ._models import ProxyDto + from ._models import ScheduledSourceSynchronizationSetting + from ._models import ScheduledSynchronizationSetting + from ._models import ScheduledTrigger + from ._models import Share + from ._models import ShareSubscription + from ._models import ShareSubscriptionSynchronization + from ._models import ShareSynchronization + from ._models import SourceShareSynchronizationSetting + from ._models import SqlDBTableDataSet + from ._models import SqlDBTableDataSetMapping + from ._models import SqlDWTableDataSet + from ._models import SqlDWTableDataSetMapping + from ._models import SynchronizationDetails + from ._models import SynchronizationSetting + from ._models import Synchronize + from ._models import Trigger +from ._paged_models import AccountPaged +from ._paged_models import ConsumerInvitationPaged +from ._paged_models import ConsumerSourceDataSetPaged +from ._paged_models import DataSetMappingPaged +from ._paged_models import DataSetPaged +from ._paged_models import InvitationPaged +from ._paged_models import OperationModelPaged +from ._paged_models import ProviderShareSubscriptionPaged +from ._paged_models import SharePaged +from ._paged_models import ShareSubscriptionPaged +from ._paged_models import ShareSubscriptionSynchronizationPaged +from ._paged_models import ShareSynchronizationPaged +from ._paged_models import SourceShareSynchronizationSettingPaged +from ._paged_models import SynchronizationDetailsPaged +from ._paged_models import SynchronizationSettingPaged +from ._paged_models import TriggerPaged +from ._data_share_management_client_enums import ( + Type, + ProvisioningState, + Status, + InvitationStatus, + ShareKind, + DataSetType, + ShareSubscriptionStatus, + SynchronizationMode, + RecurrenceInterval, + TriggerStatus, + DataSetMappingStatus, + OutputType, +) + +__all__ = [ + 'Account', + 'AccountUpdateParameters', + 'ADLSGen1FileDataSet', + 'ADLSGen1FolderDataSet', + 'ADLSGen2FileDataSet', + 'ADLSGen2FileDataSetMapping', + 'ADLSGen2FileSystemDataSet', + 'ADLSGen2FileSystemDataSetMapping', + 'ADLSGen2FolderDataSet', + 'ADLSGen2FolderDataSetMapping', + 'BlobContainerDataSet', + 'BlobContainerDataSetMapping', + 'BlobDataSet', + 'BlobDataSetMapping', + 'BlobFolderDataSet', + 'BlobFolderDataSetMapping', + 'ConsumerInvitation', + 'ConsumerSourceDataSet', + 'DataSet', + 'DataSetMapping', + 'DataShareError', 'DataShareErrorException', + 'DataShareErrorInfo', + 'DefaultDto', + 'DimensionProperties', + 'Identity', + 'Invitation', + 'OperationMetaLogSpecification', + 'OperationMetaMetricSpecification', + 'OperationMetaServiceSpecification', + 'OperationModel', + 'OperationModelProperties', + 'OperationResponse', + 'ProviderShareSubscription', + 'ProxyDto', + 'ScheduledSourceSynchronizationSetting', + 'ScheduledSynchronizationSetting', + 'ScheduledTrigger', + 'Share', + 'ShareSubscription', + 'ShareSubscriptionSynchronization', + 'ShareSynchronization', + 'SourceShareSynchronizationSetting', + 'SqlDBTableDataSet', + 'SqlDBTableDataSetMapping', + 'SqlDWTableDataSet', + 'SqlDWTableDataSetMapping', + 'SynchronizationDetails', + 'SynchronizationSetting', + 'Synchronize', + 'Trigger', + 'AccountPaged', + 'ConsumerInvitationPaged', + 'DataSetPaged', + 'DataSetMappingPaged', + 'InvitationPaged', + 'OperationModelPaged', + 'SharePaged', + 'ShareSynchronizationPaged', + 'SynchronizationDetailsPaged', + 'ProviderShareSubscriptionPaged', + 'SourceShareSynchronizationSettingPaged', + 'ShareSubscriptionSynchronizationPaged', + 'ShareSubscriptionPaged', + 'ConsumerSourceDataSetPaged', + 'SynchronizationSettingPaged', + 'TriggerPaged', + 'Type', + 'ProvisioningState', + 'Status', + 'InvitationStatus', + 'ShareKind', + 'DataSetType', + 'ShareSubscriptionStatus', + 'SynchronizationMode', + 'RecurrenceInterval', + 'TriggerStatus', + 'DataSetMappingStatus', + 'OutputType', +] diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_data_share_management_client_enums.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_data_share_management_client_enums.py new file mode 100644 index 000000000000..e826669fcf9f --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_data_share_management_client_enums.py @@ -0,0 +1,102 @@ +# 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 Type(str, Enum): + + system_assigned = "SystemAssigned" + + +class ProvisioningState(str, Enum): + + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + moving = "Moving" + failed = "Failed" + + +class Status(str, Enum): + + accepted = "Accepted" + in_progress = "InProgress" + transient_failure = "TransientFailure" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + + +class InvitationStatus(str, Enum): + + pending = "Pending" + accepted = "Accepted" + rejected = "Rejected" + withdrawn = "Withdrawn" + + +class ShareKind(str, Enum): + + copy_based = "CopyBased" + + +class DataSetType(str, Enum): + + blob = "Blob" + container = "Container" + blob_folder = "BlobFolder" + adls_gen2_file_system = "AdlsGen2FileSystem" + adls_gen2_folder = "AdlsGen2Folder" + adls_gen2_file = "AdlsGen2File" + adls_gen1_folder = "AdlsGen1Folder" + adls_gen1_file = "AdlsGen1File" + sql_db_table = "SqlDBTable" + sql_dw_table = "SqlDWTable" + + +class ShareSubscriptionStatus(str, Enum): + + active = "Active" + revoked = "Revoked" + source_deleted = "SourceDeleted" + revoking = "Revoking" + + +class SynchronizationMode(str, Enum): + + incremental = "Incremental" + full_sync = "FullSync" + + +class RecurrenceInterval(str, Enum): + + hour = "Hour" + day = "Day" + + +class TriggerStatus(str, Enum): + + active = "Active" + inactive = "Inactive" + source_synchronization_setting_deleted = "SourceSynchronizationSettingDeleted" + + +class DataSetMappingStatus(str, Enum): + + ok = "Ok" + broken = "Broken" + + +class OutputType(str, Enum): + + csv = "Csv" + parquet = "Parquet" diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_models.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_models.py new file mode 100644 index 000000000000..0a6a6c191321 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_models.py @@ -0,0 +1,2718 @@ +# 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 DefaultDto(Model): + """Base data transfer object implementation for default resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :param location: Location of the azure resource. + :type location: str + :ivar name: Name of the azure resource + :vartype name: str + :param tags: Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Type of the azure resource + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DefaultDto, self).__init__(**kwargs) + self.id = None + self.location = kwargs.get('location', None) + self.name = None + self.tags = kwargs.get('tags', None) + self.type = None + + +class Account(DefaultDto): + """An account data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :param location: Location of the azure resource. + :type location: str + :ivar name: Name of the azure resource + :vartype name: str + :param tags: Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Type of the azure resource + :vartype type: str + :param identity: Required. Identity Info on the Account + :type identity: ~azure.mgmt.datashare.models.Identity + :ivar created_at: Time at which the account was created. + :vartype created_at: datetime + :ivar created_by: Name of the user who created the account. + :vartype created_by: str + :ivar provisioning_state: Provisioning state of the Account. Possible + values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.datashare.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identity': {'required': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Account, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.created_at = None + self.created_by = None + self.provisioning_state = None + + +class AccountUpdateParameters(Model): + """Update parameters for accounts. + + :param tags: Tags on the azure resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(AccountUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class ProxyDto(Model): + """Base data transfer object implementation for proxy resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyDto, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class DataSet(ProxyDto): + """A DataSet data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BlobDataSet, BlobFolderDataSet, BlobContainerDataSet, + ADLSGen2FileDataSet, ADLSGen2FolderDataSet, ADLSGen2FileSystemDataSet, + ADLSGen1FolderDataSet, ADLSGen1FileDataSet, SqlDWTableDataSet, + SqlDBTableDataSet + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Blob': 'BlobDataSet', 'BlobFolder': 'BlobFolderDataSet', 'Container': 'BlobContainerDataSet', 'AdlsGen2File': 'ADLSGen2FileDataSet', 'AdlsGen2Folder': 'ADLSGen2FolderDataSet', 'AdlsGen2FileSystem': 'ADLSGen2FileSystemDataSet', 'AdlsGen1Folder': 'ADLSGen1FolderDataSet', 'AdlsGen1File': 'ADLSGen1FileDataSet', 'SqlDWTable': 'SqlDWTableDataSet', 'SqlDBTable': 'SqlDBTableDataSet'} + } + + def __init__(self, **kwargs): + super(DataSet, self).__init__(**kwargs) + self.kind = None + self.kind = 'DataSet' + + +class ADLSGen1FileDataSet(DataSet): + """An ADLS Gen 1 file dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param account_name: Required. The ADLS account name. + :type account_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param file_name: Required. The file name in the ADLS account. + :type file_name: str + :param folder_path: Required. The folder path within the ADLS account. + :type folder_path: str + :param resource_group: Required. Resource group of ADLS account. + :type resource_group: str + :param subscription_id: Required. Subscription id of ADLS account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'account_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_name': {'required': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ADLSGen1FileDataSet, self).__init__(**kwargs) + self.account_name = kwargs.get('account_name', None) + self.data_set_id = None + self.file_name = kwargs.get('file_name', None) + self.folder_path = kwargs.get('folder_path', None) + self.resource_group = kwargs.get('resource_group', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'AdlsGen1File' + + +class ADLSGen1FolderDataSet(DataSet): + """An ADLS Gen 1 folder dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param account_name: Required. The ADLS account name. + :type account_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param folder_path: Required. The folder path within the ADLS account. + :type folder_path: str + :param resource_group: Required. Resource group of ADLS account. + :type resource_group: str + :param subscription_id: Required. Subscription id of ADLS account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'account_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ADLSGen1FolderDataSet, self).__init__(**kwargs) + self.account_name = kwargs.get('account_name', None) + self.data_set_id = None + self.folder_path = kwargs.get('folder_path', None) + self.resource_group = kwargs.get('resource_group', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'AdlsGen1Folder' + + +class ADLSGen2FileDataSet(DataSet): + """An ADLS Gen 2 file dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param file_path: Required. File path within the file system. + :type file_path: str + :param file_system: Required. File system to which the file belongs. + :type file_system: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_path': {'required': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ADLSGen2FileDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.file_path = kwargs.get('file_path', None) + self.file_system = kwargs.get('file_system', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'AdlsGen2File' + + +class DataSetMapping(ProxyDto): + """A dataset mapping data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BlobDataSetMapping, BlobFolderDataSetMapping, + BlobContainerDataSetMapping, ADLSGen2FileDataSetMapping, + ADLSGen2FolderDataSetMapping, ADLSGen2FileSystemDataSetMapping, + SqlDWTableDataSetMapping, SqlDBTableDataSetMapping + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Blob': 'BlobDataSetMapping', 'BlobFolder': 'BlobFolderDataSetMapping', 'Container': 'BlobContainerDataSetMapping', 'AdlsGen2File': 'ADLSGen2FileDataSetMapping', 'AdlsGen2Folder': 'ADLSGen2FolderDataSetMapping', 'AdlsGen2FileSystem': 'ADLSGen2FileSystemDataSetMapping', 'SqlDWTable': 'SqlDWTableDataSetMapping', 'SqlDBTable': 'SqlDBTableDataSetMapping'} + } + + def __init__(self, **kwargs): + super(DataSetMapping, self).__init__(**kwargs) + self.kind = None + self.kind = 'DataSetMapping' + + +class ADLSGen2FileDataSetMapping(DataSetMapping): + """An ADLS Gen2 file dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param file_path: Required. File path within the file system. + :type file_path: str + :param file_system: Required. File system to which the file belongs. + :type file_system: str + :param output_type: Type of output file. Possible values include: 'Csv', + 'Parquet' + :type output_type: str or ~azure.mgmt.datashare.models.OutputType + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'file_path': {'required': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'output_type': {'key': 'properties.outputType', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ADLSGen2FileDataSetMapping, self).__init__(**kwargs) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = kwargs.get('data_set_mapping_status', None) + self.file_path = kwargs.get('file_path', None) + self.file_system = kwargs.get('file_system', None) + self.output_type = kwargs.get('output_type', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'AdlsGen2File' + + +class ADLSGen2FileSystemDataSet(DataSet): + """An ADLS Gen 2 file system dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param file_system: Required. The file system name. + :type file_system: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ADLSGen2FileSystemDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.file_system = kwargs.get('file_system', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'AdlsGen2FileSystem' + + +class ADLSGen2FileSystemDataSetMapping(DataSetMapping): + """An ADLS Gen2 file system dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param file_system: Required. The file system name. + :type file_system: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ADLSGen2FileSystemDataSetMapping, self).__init__(**kwargs) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = kwargs.get('data_set_mapping_status', None) + self.file_system = kwargs.get('file_system', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'AdlsGen2FileSystem' + + +class ADLSGen2FolderDataSet(DataSet): + """An ADLS Gen 2 folder dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param file_system: Required. File system to which the folder belongs. + :type file_system: str + :param folder_path: Required. Folder path within the file system. + :type folder_path: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_system': {'required': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ADLSGen2FolderDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.file_system = kwargs.get('file_system', None) + self.folder_path = kwargs.get('folder_path', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'AdlsGen2Folder' + + +class ADLSGen2FolderDataSetMapping(DataSetMapping): + """An ADLS Gen2 folder dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param file_system: Required. File system to which the folder belongs. + :type file_system: str + :param folder_path: Required. Folder path within the file system. + :type folder_path: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'file_system': {'required': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ADLSGen2FolderDataSetMapping, self).__init__(**kwargs) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = kwargs.get('data_set_mapping_status', None) + self.file_system = kwargs.get('file_system', None) + self.folder_path = kwargs.get('folder_path', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'AdlsGen2Folder' + + +class BlobContainerDataSet(DataSet): + """An Azure storage blob container dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. BLOB Container name. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BlobContainerDataSet, self).__init__(**kwargs) + self.container_name = kwargs.get('container_name', None) + self.data_set_id = None + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'Container' + + +class BlobContainerDataSetMapping(DataSetMapping): + """A Blob container dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. BLOB Container name. + :type container_name: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BlobContainerDataSetMapping, self).__init__(**kwargs) + self.container_name = kwargs.get('container_name', None) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = kwargs.get('data_set_mapping_status', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'Container' + + +class BlobDataSet(DataSet): + """An Azure storage blob dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. Container that has the file path. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param file_path: Required. File path within the source data set + :type file_path: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BlobDataSet, self).__init__(**kwargs) + self.container_name = kwargs.get('container_name', None) + self.data_set_id = None + self.file_path = kwargs.get('file_path', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'Blob' + + +class BlobDataSetMapping(DataSetMapping): + """A Blob dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. Container that has the file path. + :type container_name: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param file_path: Required. File path within the source data set + :type file_path: str + :param output_type: File output type. Possible values include: 'Csv', + 'Parquet' + :type output_type: str or ~azure.mgmt.datashare.models.OutputType + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'file_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'output_type': {'key': 'properties.outputType', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BlobDataSetMapping, self).__init__(**kwargs) + self.container_name = kwargs.get('container_name', None) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = kwargs.get('data_set_mapping_status', None) + self.file_path = kwargs.get('file_path', None) + self.output_type = kwargs.get('output_type', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'Blob' + + +class BlobFolderDataSet(DataSet): + """An Azure storage blob folder dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. Container that has the file path. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param prefix: Required. Prefix for blob folder + :type prefix: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'prefix': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BlobFolderDataSet, self).__init__(**kwargs) + self.container_name = kwargs.get('container_name', None) + self.data_set_id = None + self.prefix = kwargs.get('prefix', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'BlobFolder' + + +class BlobFolderDataSetMapping(DataSetMapping): + """A Blob folder dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. Container that has the file path. + :type container_name: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param prefix: Required. Prefix for blob folder + :type prefix: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'prefix': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BlobFolderDataSetMapping, self).__init__(**kwargs) + self.container_name = kwargs.get('container_name', None) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = kwargs.get('data_set_mapping_status', None) + self.prefix = kwargs.get('prefix', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.kind = 'BlobFolder' + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ConsumerInvitation(ProxyDto): + """A consumer Invitation data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar data_set_count: Number of data sets in a share + :vartype data_set_count: int + :ivar description: Description shared when the invitation was created + :vartype description: str + :param invitation_id: Required. Unique id of the invitation. + :type invitation_id: str + :ivar invitation_status: The status of the invitation. Possible values + include: 'Pending', 'Accepted', 'Rejected', 'Withdrawn' + :vartype invitation_status: str or + ~azure.mgmt.datashare.models.InvitationStatus + :ivar location: invitation location + :vartype location: str + :ivar responded_at: The time the recipient responded to the invitation. + :vartype responded_at: datetime + :ivar sender: Gets the name of the sender. + :vartype sender: str + :ivar sender_company_name: Gets the company name of the sender. + :vartype sender_company_name: str + :ivar sent_at: Gets the time at which the invitation was sent. + :vartype sent_at: datetime + :ivar share_name: Gets the source share Name. + :vartype share_name: str + :ivar terms_of_use: Terms of use shared when the invitation was created + :vartype terms_of_use: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_set_count': {'readonly': True}, + 'description': {'readonly': True}, + 'invitation_id': {'required': True}, + 'invitation_status': {'readonly': True}, + 'location': {'readonly': True}, + 'responded_at': {'readonly': True}, + 'sender': {'readonly': True}, + 'sender_company_name': {'readonly': True}, + 'sent_at': {'readonly': True}, + 'share_name': {'readonly': True}, + 'terms_of_use': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_set_count': {'key': 'properties.dataSetCount', 'type': 'int'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'invitation_status': {'key': 'properties.invitationStatus', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'responded_at': {'key': 'properties.respondedAt', 'type': 'iso-8601'}, + 'sender': {'key': 'properties.sender', 'type': 'str'}, + 'sender_company_name': {'key': 'properties.senderCompanyName', 'type': 'str'}, + 'sent_at': {'key': 'properties.sentAt', 'type': 'iso-8601'}, + 'share_name': {'key': 'properties.shareName', 'type': 'str'}, + 'terms_of_use': {'key': 'properties.termsOfUse', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConsumerInvitation, self).__init__(**kwargs) + self.data_set_count = None + self.description = None + self.invitation_id = kwargs.get('invitation_id', None) + self.invitation_status = None + self.location = None + self.responded_at = None + self.sender = None + self.sender_company_name = None + self.sent_at = None + self.share_name = None + self.terms_of_use = None + + +class ConsumerSourceDataSet(ProxyDto): + """A consumer side dataSet data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar data_set_id: DataSet Id + :vartype data_set_id: str + :ivar data_set_name: DataSet name + :vartype data_set_name: str + :ivar data_set_type: Type of dataSet. Possible values include: 'Blob', + 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'SqlDBTable', + 'SqlDWTable' + :vartype data_set_type: str or ~azure.mgmt.datashare.models.DataSetType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_set_id': {'readonly': True}, + 'data_set_name': {'readonly': True}, + 'data_set_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_name': {'key': 'properties.dataSetName', 'type': 'str'}, + 'data_set_type': {'key': 'properties.dataSetType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConsumerSourceDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.data_set_name = None + self.data_set_type = None + + +class DataShareError(Model): + """The data share error model. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The data share error body + :type error: ~azure.mgmt.datashare.models.DataShareErrorInfo + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DataShareErrorInfo'}, + } + + def __init__(self, **kwargs): + super(DataShareError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class DataShareErrorException(HttpOperationError): + """Server responsed with exception of type: 'DataShareError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DataShareErrorException, self).__init__(deserialize, response, 'DataShareError', *args) + + +class DataShareErrorInfo(Model): + """The data share error body model. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Code of the error + :type code: str + :param details: Nested details of the error model + :type details: list[~azure.mgmt.datashare.models.DataShareErrorInfo] + :param message: Required. Message of the error + :type message: str + :param target: Target of the error + :type target: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DataShareErrorInfo]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataShareErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.details = kwargs.get('details', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + + +class DimensionProperties(Model): + """properties for dimension. + + :param display_name: localized display name of the dimension to customer + :type display_name: str + :param name: dimension name + :type name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DimensionProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.name = kwargs.get('name', None) + + +class Identity(Model): + """Identity of resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: service principal Id + :vartype principal_id: str + :ivar tenant_id: Tenant Id + :vartype tenant_id: str + :param type: Identity Type. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.datashare.models.Type + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class Invitation(ProxyDto): + """A Invitation data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar invitation_id: unique invitation id + :vartype invitation_id: str + :ivar invitation_status: The status of the invitation. Possible values + include: 'Pending', 'Accepted', 'Rejected', 'Withdrawn' + :vartype invitation_status: str or + ~azure.mgmt.datashare.models.InvitationStatus + :ivar responded_at: The time the recipient responded to the invitation. + :vartype responded_at: datetime + :ivar sender: Gets the name of the sender. + :vartype sender: str + :ivar sent_at: Gets the time at which the invitation was sent. + :vartype sent_at: datetime + :param target_active_directory_id: The target Azure AD Id. Can't be + combined with email. + :type target_active_directory_id: str + :param target_email: The email the invitation is directed to. + :type target_email: str + :param target_object_id: The target user or application Id that invitation + is being sent to. + Must be specified along TargetActiveDirectoryId. This enables sending + invitations to specific users or applications in an AD tenant. + :type target_object_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invitation_id': {'readonly': True}, + 'invitation_status': {'readonly': True}, + 'responded_at': {'readonly': True}, + 'sender': {'readonly': True}, + 'sent_at': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'invitation_status': {'key': 'properties.invitationStatus', 'type': 'str'}, + 'responded_at': {'key': 'properties.respondedAt', 'type': 'iso-8601'}, + 'sender': {'key': 'properties.sender', 'type': 'str'}, + 'sent_at': {'key': 'properties.sentAt', 'type': 'iso-8601'}, + 'target_active_directory_id': {'key': 'properties.targetActiveDirectoryId', 'type': 'str'}, + 'target_email': {'key': 'properties.targetEmail', 'type': 'str'}, + 'target_object_id': {'key': 'properties.targetObjectId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Invitation, self).__init__(**kwargs) + self.invitation_id = None + self.invitation_status = None + self.responded_at = None + self.sender = None + self.sent_at = None + self.target_active_directory_id = kwargs.get('target_active_directory_id', None) + self.target_email = kwargs.get('target_email', None) + self.target_object_id = kwargs.get('target_object_id', None) + + +class OperationMetaLogSpecification(Model): + """log specifications for operation api. + + :param blob_duration: blob duration of the log + :type blob_duration: str + :param display_name: localized name of the log category + :type display_name: str + :param name: name of the log category + :type name: str + """ + + _attribute_map = { + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetaLogSpecification, self).__init__(**kwargs) + self.blob_duration = kwargs.get('blob_duration', None) + self.display_name = kwargs.get('display_name', None) + self.name = kwargs.get('name', None) + + +class OperationMetaMetricSpecification(Model): + """metric specifications for the operation. + + :param aggregation_type: aggregation type of metric + :type aggregation_type: str + :param dimensions: properties for dimension + :type dimensions: list[~azure.mgmt.datashare.models.DimensionProperties] + :param display_description: description of the metric + :type display_description: str + :param display_name: localized name of the metric + :type display_name: str + :param enable_regional_mdm_account: enable regional mdm account + :type enable_regional_mdm_account: str + :param internal_metric_name: internal metric name + :type internal_metric_name: str + :param name: name of the metric + :type name: str + :param resource_id_dimension_name_override: dimension name use to replace + resource id if specified + :type resource_id_dimension_name_override: str + :param supported_aggregation_types: supported aggregation types + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: supported time grain types + :type supported_time_grain_types: list[str] + :param unit: units for the metric + :type unit: str + """ + + _attribute_map = { + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[DimensionProperties]'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetaMetricSpecification, self).__init__(**kwargs) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.dimensions = kwargs.get('dimensions', None) + self.display_description = kwargs.get('display_description', None) + self.display_name = kwargs.get('display_name', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + self.name = kwargs.get('name', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.unit = kwargs.get('unit', None) + + +class OperationMetaServiceSpecification(Model): + """The operation meta service specification. + + :param log_specifications: log specifications for the operation + :type log_specifications: + list[~azure.mgmt.datashare.models.OperationMetaLogSpecification] + :param metric_specifications: metric specifications for the operation + :type metric_specifications: + list[~azure.mgmt.datashare.models.OperationMetaMetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[OperationMetaLogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetaMetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(OperationMetaServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class OperationModel(Model): + """The response model for get operations. + + :param display: Properties on the operation + :type display: ~azure.mgmt.datashare.models.OperationModelProperties + :param name: Operation name for display purposes + :type name: str + :param origin: origin of the operation + :type origin: str + :param service_specification: meta service specification + :type service_specification: + ~azure.mgmt.datashare.models.OperationMetaServiceSpecification + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'OperationModelProperties'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationMetaServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(OperationModel, self).__init__(**kwargs) + self.display = kwargs.get('display', None) + self.name = kwargs.get('name', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationModelProperties(Model): + """Properties on operations. + + :param description: Description of the operation for display purposes + :type description: str + :param operation: Name of the operation for display purposes + :type operation: str + :param provider: Name of the provider for display purposes + :type provider: str + :param resource: Name of the resource type for display purposes + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationModelProperties, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + + +class OperationResponse(Model): + """Response for long running operation. + + All required parameters must be populated in order to send to Azure. + + :param end_time: start time + :type end_time: datetime + :param error: The error property when status is failed. + :type error: ~azure.mgmt.datashare.models.DataShareErrorInfo + :param start_time: start time + :type start_time: datetime + :param status: Required. Operation state of the long running operation. + Possible values include: 'Accepted', 'InProgress', 'TransientFailure', + 'Succeeded', 'Failed', 'Canceled' + :type status: str or ~azure.mgmt.datashare.models.Status + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'DataShareErrorInfo'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationResponse, self).__init__(**kwargs) + self.end_time = kwargs.get('end_time', None) + self.error = kwargs.get('error', None) + self.start_time = kwargs.get('start_time', None) + self.status = kwargs.get('status', None) + + +class ProviderShareSubscription(ProxyDto): + """A provider side share subscription data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar company: Company name + :vartype company: str + :ivar created_at: created at + :vartype created_at: datetime + :ivar created_by: Created by + :vartype created_by: str + :ivar shared_at: Shared at + :vartype shared_at: datetime + :ivar shared_by: Shared by + :vartype shared_by: str + :ivar share_subscription_object_id: share Subscription Object Id + :vartype share_subscription_object_id: str + :ivar share_subscription_status: Gets the status of share subscription. + Possible values include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking' + :vartype share_subscription_status: str or + ~azure.mgmt.datashare.models.ShareSubscriptionStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'company': {'readonly': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'shared_at': {'readonly': True}, + 'shared_by': {'readonly': True}, + 'share_subscription_object_id': {'readonly': True}, + 'share_subscription_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'company': {'key': 'properties.company', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'shared_at': {'key': 'properties.sharedAt', 'type': 'iso-8601'}, + 'shared_by': {'key': 'properties.sharedBy', 'type': 'str'}, + 'share_subscription_object_id': {'key': 'properties.shareSubscriptionObjectId', 'type': 'str'}, + 'share_subscription_status': {'key': 'properties.shareSubscriptionStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProviderShareSubscription, self).__init__(**kwargs) + self.company = None + self.created_at = None + self.created_by = None + self.shared_at = None + self.shared_by = None + self.share_subscription_object_id = None + self.share_subscription_status = None + + +class SourceShareSynchronizationSetting(Model): + """A view of synchronization setting added by the provider. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledSourceSynchronizationSetting + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledSourceSynchronizationSetting'} + } + + def __init__(self, **kwargs): + super(SourceShareSynchronizationSetting, self).__init__(**kwargs) + self.kind = None + + +class ScheduledSourceSynchronizationSetting(SourceShareSynchronizationSetting): + """A type of synchronization setting based on schedule. + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Constant filled by server. + :type kind: str + :param recurrence_interval: Recurrence Interval. Possible values include: + 'Hour', 'Day' + :type recurrence_interval: str or + ~azure.mgmt.datashare.models.RecurrenceInterval + :param synchronization_time: Synchronization time + :type synchronization_time: datetime + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ScheduledSourceSynchronizationSetting, self).__init__(**kwargs) + self.recurrence_interval = kwargs.get('recurrence_interval', None) + self.synchronization_time = kwargs.get('synchronization_time', None) + self.kind = 'ScheduleBased' + + +class SynchronizationSetting(ProxyDto): + """A Synchronization Setting data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledSynchronizationSetting + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledSynchronizationSetting'} + } + + def __init__(self, **kwargs): + super(SynchronizationSetting, self).__init__(**kwargs) + self.kind = None + self.kind = 'SynchronizationSetting' + + +class ScheduledSynchronizationSetting(SynchronizationSetting): + """A type of synchronization setting based on schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar created_at: Time at which the synchronization setting was created. + :vartype created_at: datetime + :ivar created_by: Name of the user who created the synchronization + setting. + :vartype created_by: str + :ivar provisioning_state: Gets or sets the provisioning state. Possible + values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.datashare.models.ProvisioningState + :param recurrence_interval: Required. Recurrence Interval. Possible values + include: 'Hour', 'Day' + :type recurrence_interval: str or + ~azure.mgmt.datashare.models.RecurrenceInterval + :param synchronization_time: Required. Synchronization time + :type synchronization_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'recurrence_interval': {'required': True}, + 'synchronization_time': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ScheduledSynchronizationSetting, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.provisioning_state = None + self.recurrence_interval = kwargs.get('recurrence_interval', None) + self.synchronization_time = kwargs.get('synchronization_time', None) + self.kind = 'ScheduleBased' + + +class Trigger(ProxyDto): + """A Trigger data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledTrigger + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledTrigger'} + } + + def __init__(self, **kwargs): + super(Trigger, self).__init__(**kwargs) + self.kind = None + self.kind = 'Trigger' + + +class ScheduledTrigger(Trigger): + """A type of trigger based on schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar created_at: Time at which the trigger was created. + :vartype created_at: datetime + :ivar created_by: Name of the user who created the trigger. + :vartype created_by: str + :ivar provisioning_state: Gets the provisioning state. Possible values + include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.datashare.models.ProvisioningState + :param recurrence_interval: Required. Recurrence Interval. Possible values + include: 'Hour', 'Day' + :type recurrence_interval: str or + ~azure.mgmt.datashare.models.RecurrenceInterval + :param synchronization_mode: Synchronization mode. Possible values + include: 'Incremental', 'FullSync' + :type synchronization_mode: str or + ~azure.mgmt.datashare.models.SynchronizationMode + :param synchronization_time: Required. Synchronization time + :type synchronization_time: datetime + :ivar trigger_status: Gets the trigger state. Possible values include: + 'Active', 'Inactive', 'SourceSynchronizationSettingDeleted' + :vartype trigger_status: str or ~azure.mgmt.datashare.models.TriggerStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'recurrence_interval': {'required': True}, + 'synchronization_time': {'required': True}, + 'trigger_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_mode': {'key': 'properties.synchronizationMode', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + 'trigger_status': {'key': 'properties.triggerStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScheduledTrigger, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.provisioning_state = None + self.recurrence_interval = kwargs.get('recurrence_interval', None) + self.synchronization_mode = kwargs.get('synchronization_mode', None) + self.synchronization_time = kwargs.get('synchronization_time', None) + self.trigger_status = None + self.kind = 'ScheduleBased' + + +class Share(ProxyDto): + """A share data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar created_at: Time at which the share was created. + :vartype created_at: datetime + :ivar created_by: Name of the user who created the share. + :vartype created_by: str + :param description: Share description. + :type description: str + :ivar provisioning_state: Gets or sets the provisioning state. Possible + values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.datashare.models.ProvisioningState + :param share_kind: Share kind. Possible values include: 'CopyBased' + :type share_kind: str or ~azure.mgmt.datashare.models.ShareKind + :param terms: Share terms. + :type terms: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'share_kind': {'key': 'properties.shareKind', 'type': 'str'}, + 'terms': {'key': 'properties.terms', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Share, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.description = kwargs.get('description', None) + self.provisioning_state = None + self.share_kind = kwargs.get('share_kind', None) + self.terms = kwargs.get('terms', None) + + +class ShareSubscription(ProxyDto): + """A share subscription data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar created_at: Time at which the share subscription was created. + :vartype created_at: datetime + :ivar created_by: The user who created the share subscription. + :vartype created_by: str + :param invitation_id: Required. The invitation id. + :type invitation_id: str + :ivar provisioning_state: Provisioning state of the share subscription. + Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.datashare.models.ProvisioningState + :ivar share_description: Description of share + :vartype share_description: str + :ivar share_kind: Kind of share. Possible values include: 'CopyBased' + :vartype share_kind: str or ~azure.mgmt.datashare.models.ShareKind + :ivar share_name: Name of the share + :vartype share_name: str + :ivar share_sender: Sender of the share + :vartype share_sender: str + :ivar share_sender_company_name: Company name of the share sender + :vartype share_sender_company_name: str + :ivar share_subscription_status: Gets the current status of share + subscription. Possible values include: 'Active', 'Revoked', + 'SourceDeleted', 'Revoking' + :vartype share_subscription_status: str or + ~azure.mgmt.datashare.models.ShareSubscriptionStatus + :ivar share_terms: Terms of a share + :vartype share_terms: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'invitation_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'share_description': {'readonly': True}, + 'share_kind': {'readonly': True}, + 'share_name': {'readonly': True}, + 'share_sender': {'readonly': True}, + 'share_sender_company_name': {'readonly': True}, + 'share_subscription_status': {'readonly': True}, + 'share_terms': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'share_description': {'key': 'properties.shareDescription', 'type': 'str'}, + 'share_kind': {'key': 'properties.shareKind', 'type': 'str'}, + 'share_name': {'key': 'properties.shareName', 'type': 'str'}, + 'share_sender': {'key': 'properties.shareSender', 'type': 'str'}, + 'share_sender_company_name': {'key': 'properties.shareSenderCompanyName', 'type': 'str'}, + 'share_subscription_status': {'key': 'properties.shareSubscriptionStatus', 'type': 'str'}, + 'share_terms': {'key': 'properties.shareTerms', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ShareSubscription, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.invitation_id = kwargs.get('invitation_id', None) + self.provisioning_state = None + self.share_description = None + self.share_kind = None + self.share_name = None + self.share_sender = None + self.share_sender_company_name = None + self.share_subscription_status = None + self.share_terms = None + + +class ShareSubscriptionSynchronization(Model): + """A ShareSubscriptionSynchronization data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar duration_ms: Synchronization duration + :vartype duration_ms: int + :ivar end_time: End time of synchronization + :vartype end_time: datetime + :ivar message: message of Synchronization + :vartype message: str + :ivar start_time: start time of synchronization + :vartype start_time: datetime + :ivar status: Raw Status + :vartype status: str + :param synchronization_id: Required. Synchronization id + :type synchronization_id: str + """ + + _validation = { + 'duration_ms': {'readonly': True}, + 'end_time': {'readonly': True}, + 'message': {'readonly': True}, + 'start_time': {'readonly': True}, + 'status': {'readonly': True}, + 'synchronization_id': {'required': True}, + } + + _attribute_map = { + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'synchronization_id': {'key': 'synchronizationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ShareSubscriptionSynchronization, self).__init__(**kwargs) + self.duration_ms = None + self.end_time = None + self.message = None + self.start_time = None + self.status = None + self.synchronization_id = kwargs.get('synchronization_id', None) + + +class ShareSynchronization(Model): + """A ShareSynchronization data transfer object. + + :param company: Company name + :type company: str + :param duration_ms: synchronization duration + :type duration_ms: int + :param end_time: End time of synchronization + :type end_time: datetime + :param message: message of synchronization + :type message: str + :param recipient: Recipient id + :type recipient: str + :param start_time: start time of synchronization + :type start_time: datetime + :param status: Raw Status + :type status: str + :param synchronization_id: Synchronization id + :type synchronization_id: str + """ + + _attribute_map = { + 'company': {'key': 'company', 'type': 'str'}, + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recipient': {'key': 'recipient', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'synchronization_id': {'key': 'synchronizationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ShareSynchronization, self).__init__(**kwargs) + self.company = kwargs.get('company', None) + self.duration_ms = kwargs.get('duration_ms', None) + self.end_time = kwargs.get('end_time', None) + self.message = kwargs.get('message', None) + self.recipient = kwargs.get('recipient', None) + self.start_time = kwargs.get('start_time', None) + self.status = kwargs.get('status', None) + self.synchronization_id = kwargs.get('synchronization_id', None) + + +class SqlDBTableDataSet(DataSet): + """A SQL DB table dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param database_name: Database name of the source data set + :type database_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param sql_server_resource_id: Resource id of SQL server + :type sql_server_resource_id: str + :param table_name: SQL DB table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlDBTableDataSet, self).__init__(**kwargs) + self.database_name = kwargs.get('database_name', None) + self.data_set_id = None + self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) + self.table_name = kwargs.get('table_name', None) + self.kind = 'SqlDBTable' + + +class SqlDBTableDataSetMapping(DataSetMapping): + """A SQL DB Table dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param database_name: Required. DatabaseName name of the sink data set + :type database_name: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param sql_server_resource_id: Required. Resource id of SQL server + :type sql_server_resource_id: str + :param table_name: Required. SQL DB table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'database_name': {'required': True}, + 'sql_server_resource_id': {'required': True}, + 'table_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlDBTableDataSetMapping, self).__init__(**kwargs) + self.database_name = kwargs.get('database_name', None) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = kwargs.get('data_set_mapping_status', None) + self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) + self.table_name = kwargs.get('table_name', None) + self.kind = 'SqlDBTable' + + +class SqlDWTableDataSet(DataSet): + """A SQL DW table dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param data_warehouse_name: DataWarehouse name of the source data set + :type data_warehouse_name: str + :param sql_server_resource_id: Resource id of SQL server + :type sql_server_resource_id: str + :param table_name: SQL DW table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_warehouse_name': {'key': 'properties.dataWarehouseName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlDWTableDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.data_warehouse_name = kwargs.get('data_warehouse_name', None) + self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) + self.table_name = kwargs.get('table_name', None) + self.kind = 'SqlDWTable' + + +class SqlDWTableDataSetMapping(DataSetMapping): + """A SQL DW Table dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param data_warehouse_name: Required. DataWarehouse name of the source + data set + :type data_warehouse_name: str + :param sql_server_resource_id: Required. Resource id of SQL server + :type sql_server_resource_id: str + :param table_name: Required. SQL DW table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_warehouse_name': {'required': True}, + 'sql_server_resource_id': {'required': True}, + 'table_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'data_warehouse_name': {'key': 'properties.dataWarehouseName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlDWTableDataSetMapping, self).__init__(**kwargs) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = kwargs.get('data_set_mapping_status', None) + self.data_warehouse_name = kwargs.get('data_warehouse_name', None) + self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) + self.table_name = kwargs.get('table_name', None) + self.kind = 'SqlDWTable' + + +class SynchronizationDetails(Model): + """Synchronization details at dataset level. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar data_set_id: id of dataSet + :vartype data_set_id: str + :ivar data_set_type: type of DataSet. Possible values include: 'Blob', + 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'SqlDBTable', + 'SqlDWTable' + :vartype data_set_type: str or ~azure.mgmt.datashare.models.DataSetType + :ivar duration_ms: duration of dataset level copy + :vartype duration_ms: int + :ivar end_time: End time of dataset level copy + :vartype end_time: datetime + :ivar files_read: The number of files read from the source dataset. + :vartype files_read: long + :ivar files_written: The number of files written into the sink dataset. + :vartype files_written: long + :ivar message: Error Message if any + :vartype message: str + :ivar name: name of dataSet + :vartype name: str + :ivar rows_copied: The number of files copied into the sink dataset. + :vartype rows_copied: long + :ivar rows_read: The number of rows read from the source dataset. + :vartype rows_read: long + :ivar size_read: The size of the data read from the source dataset in + bytes. + :vartype size_read: long + :ivar size_written: The size of the data written into the sink dataset in + bytes. + :vartype size_written: long + :ivar start_time: start time of dataset level copy + :vartype start_time: datetime + :ivar status: Raw Status + :vartype status: str + :ivar v_core: The vCore units consumed for the dataset synchronization. + :vartype v_core: long + """ + + _validation = { + 'data_set_id': {'readonly': True}, + 'data_set_type': {'readonly': True}, + 'duration_ms': {'readonly': True}, + 'end_time': {'readonly': True}, + 'files_read': {'readonly': True}, + 'files_written': {'readonly': True}, + 'message': {'readonly': True}, + 'name': {'readonly': True}, + 'rows_copied': {'readonly': True}, + 'rows_read': {'readonly': True}, + 'size_read': {'readonly': True}, + 'size_written': {'readonly': True}, + 'start_time': {'readonly': True}, + 'status': {'readonly': True}, + 'v_core': {'readonly': True}, + } + + _attribute_map = { + 'data_set_id': {'key': 'dataSetId', 'type': 'str'}, + 'data_set_type': {'key': 'dataSetType', 'type': 'str'}, + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'files_read': {'key': 'filesRead', 'type': 'long'}, + 'files_written': {'key': 'filesWritten', 'type': 'long'}, + 'message': {'key': 'message', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'rows_copied': {'key': 'rowsCopied', 'type': 'long'}, + 'rows_read': {'key': 'rowsRead', 'type': 'long'}, + 'size_read': {'key': 'sizeRead', 'type': 'long'}, + 'size_written': {'key': 'sizeWritten', 'type': 'long'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'v_core': {'key': 'vCore', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(SynchronizationDetails, self).__init__(**kwargs) + self.data_set_id = None + self.data_set_type = None + self.duration_ms = None + self.end_time = None + self.files_read = None + self.files_written = None + self.message = None + self.name = None + self.rows_copied = None + self.rows_read = None + self.size_read = None + self.size_written = None + self.start_time = None + self.status = None + self.v_core = None + + +class Synchronize(Model): + """Payload for the synchronizing the data. + + :param synchronization_mode: Mode of synchronization used in triggers and + snapshot sync. Incremental by default. Possible values include: + 'Incremental', 'FullSync' + :type synchronization_mode: str or + ~azure.mgmt.datashare.models.SynchronizationMode + """ + + _attribute_map = { + 'synchronization_mode': {'key': 'synchronizationMode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Synchronize, self).__init__(**kwargs) + self.synchronization_mode = kwargs.get('synchronization_mode', None) diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_models_py3.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_models_py3.py new file mode 100644 index 000000000000..41d0603e9c0c --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_models_py3.py @@ -0,0 +1,2718 @@ +# 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 DefaultDto(Model): + """Base data transfer object implementation for default resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :param location: Location of the azure resource. + :type location: str + :ivar name: Name of the azure resource + :vartype name: str + :param tags: Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Type of the azure resource + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(DefaultDto, self).__init__(**kwargs) + self.id = None + self.location = location + self.name = None + self.tags = tags + self.type = None + + +class Account(DefaultDto): + """An account data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :param location: Location of the azure resource. + :type location: str + :ivar name: Name of the azure resource + :vartype name: str + :param tags: Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Type of the azure resource + :vartype type: str + :param identity: Required. Identity Info on the Account + :type identity: ~azure.mgmt.datashare.models.Identity + :ivar created_at: Time at which the account was created. + :vartype created_at: datetime + :ivar created_by: Name of the user who created the account. + :vartype created_by: str + :ivar provisioning_state: Provisioning state of the Account. Possible + values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.datashare.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identity': {'required': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, identity, location: str=None, tags=None, **kwargs) -> None: + super(Account, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity + self.created_at = None + self.created_by = None + self.provisioning_state = None + + +class AccountUpdateParameters(Model): + """Update parameters for accounts. + + :param tags: Tags on the azure resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(AccountUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class ProxyDto(Model): + """Base data transfer object implementation for proxy resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyDto, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class DataSet(ProxyDto): + """A DataSet data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BlobDataSet, BlobFolderDataSet, BlobContainerDataSet, + ADLSGen2FileDataSet, ADLSGen2FolderDataSet, ADLSGen2FileSystemDataSet, + ADLSGen1FolderDataSet, ADLSGen1FileDataSet, SqlDWTableDataSet, + SqlDBTableDataSet + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Blob': 'BlobDataSet', 'BlobFolder': 'BlobFolderDataSet', 'Container': 'BlobContainerDataSet', 'AdlsGen2File': 'ADLSGen2FileDataSet', 'AdlsGen2Folder': 'ADLSGen2FolderDataSet', 'AdlsGen2FileSystem': 'ADLSGen2FileSystemDataSet', 'AdlsGen1Folder': 'ADLSGen1FolderDataSet', 'AdlsGen1File': 'ADLSGen1FileDataSet', 'SqlDWTable': 'SqlDWTableDataSet', 'SqlDBTable': 'SqlDBTableDataSet'} + } + + def __init__(self, **kwargs) -> None: + super(DataSet, self).__init__(**kwargs) + self.kind = None + self.kind = 'DataSet' + + +class ADLSGen1FileDataSet(DataSet): + """An ADLS Gen 1 file dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param account_name: Required. The ADLS account name. + :type account_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param file_name: Required. The file name in the ADLS account. + :type file_name: str + :param folder_path: Required. The folder path within the ADLS account. + :type folder_path: str + :param resource_group: Required. Resource group of ADLS account. + :type resource_group: str + :param subscription_id: Required. Subscription id of ADLS account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'account_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_name': {'required': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, account_name: str, file_name: str, folder_path: str, resource_group: str, subscription_id: str, **kwargs) -> None: + super(ADLSGen1FileDataSet, self).__init__(**kwargs) + self.account_name = account_name + self.data_set_id = None + self.file_name = file_name + self.folder_path = folder_path + self.resource_group = resource_group + self.subscription_id = subscription_id + self.kind = 'AdlsGen1File' + + +class ADLSGen1FolderDataSet(DataSet): + """An ADLS Gen 1 folder dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param account_name: Required. The ADLS account name. + :type account_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param folder_path: Required. The folder path within the ADLS account. + :type folder_path: str + :param resource_group: Required. Resource group of ADLS account. + :type resource_group: str + :param subscription_id: Required. Subscription id of ADLS account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'account_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, account_name: str, folder_path: str, resource_group: str, subscription_id: str, **kwargs) -> None: + super(ADLSGen1FolderDataSet, self).__init__(**kwargs) + self.account_name = account_name + self.data_set_id = None + self.folder_path = folder_path + self.resource_group = resource_group + self.subscription_id = subscription_id + self.kind = 'AdlsGen1Folder' + + +class ADLSGen2FileDataSet(DataSet): + """An ADLS Gen 2 file dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param file_path: Required. File path within the file system. + :type file_path: str + :param file_system: Required. File system to which the file belongs. + :type file_system: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_path': {'required': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, file_path: str, file_system: str, resource_group: str, storage_account_name: str, subscription_id: str, **kwargs) -> None: + super(ADLSGen2FileDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.file_path = file_path + self.file_system = file_system + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'AdlsGen2File' + + +class DataSetMapping(ProxyDto): + """A dataset mapping data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BlobDataSetMapping, BlobFolderDataSetMapping, + BlobContainerDataSetMapping, ADLSGen2FileDataSetMapping, + ADLSGen2FolderDataSetMapping, ADLSGen2FileSystemDataSetMapping, + SqlDWTableDataSetMapping, SqlDBTableDataSetMapping + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Blob': 'BlobDataSetMapping', 'BlobFolder': 'BlobFolderDataSetMapping', 'Container': 'BlobContainerDataSetMapping', 'AdlsGen2File': 'ADLSGen2FileDataSetMapping', 'AdlsGen2Folder': 'ADLSGen2FolderDataSetMapping', 'AdlsGen2FileSystem': 'ADLSGen2FileSystemDataSetMapping', 'SqlDWTable': 'SqlDWTableDataSetMapping', 'SqlDBTable': 'SqlDBTableDataSetMapping'} + } + + def __init__(self, **kwargs) -> None: + super(DataSetMapping, self).__init__(**kwargs) + self.kind = None + self.kind = 'DataSetMapping' + + +class ADLSGen2FileDataSetMapping(DataSetMapping): + """An ADLS Gen2 file dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param file_path: Required. File path within the file system. + :type file_path: str + :param file_system: Required. File system to which the file belongs. + :type file_system: str + :param output_type: Type of output file. Possible values include: 'Csv', + 'Parquet' + :type output_type: str or ~azure.mgmt.datashare.models.OutputType + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'file_path': {'required': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'output_type': {'key': 'properties.outputType', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, file_path: str, file_system: str, resource_group: str, storage_account_name: str, subscription_id: str, data_set_id: str=None, data_set_mapping_status=None, output_type=None, **kwargs) -> None: + super(ADLSGen2FileDataSetMapping, self).__init__(**kwargs) + self.data_set_id = data_set_id + self.data_set_mapping_status = data_set_mapping_status + self.file_path = file_path + self.file_system = file_system + self.output_type = output_type + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'AdlsGen2File' + + +class ADLSGen2FileSystemDataSet(DataSet): + """An ADLS Gen 2 file system dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param file_system: Required. The file system name. + :type file_system: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, file_system: str, resource_group: str, storage_account_name: str, subscription_id: str, **kwargs) -> None: + super(ADLSGen2FileSystemDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.file_system = file_system + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'AdlsGen2FileSystem' + + +class ADLSGen2FileSystemDataSetMapping(DataSetMapping): + """An ADLS Gen2 file system dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param file_system: Required. The file system name. + :type file_system: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, file_system: str, resource_group: str, storage_account_name: str, subscription_id: str, data_set_id: str=None, data_set_mapping_status=None, **kwargs) -> None: + super(ADLSGen2FileSystemDataSetMapping, self).__init__(**kwargs) + self.data_set_id = data_set_id + self.data_set_mapping_status = data_set_mapping_status + self.file_system = file_system + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'AdlsGen2FileSystem' + + +class ADLSGen2FolderDataSet(DataSet): + """An ADLS Gen 2 folder dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param file_system: Required. File system to which the folder belongs. + :type file_system: str + :param folder_path: Required. Folder path within the file system. + :type folder_path: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_system': {'required': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, file_system: str, folder_path: str, resource_group: str, storage_account_name: str, subscription_id: str, **kwargs) -> None: + super(ADLSGen2FolderDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.file_system = file_system + self.folder_path = folder_path + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'AdlsGen2Folder' + + +class ADLSGen2FolderDataSetMapping(DataSetMapping): + """An ADLS Gen2 folder dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param file_system: Required. File system to which the folder belongs. + :type file_system: str + :param folder_path: Required. Folder path within the file system. + :type folder_path: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'file_system': {'required': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, file_system: str, folder_path: str, resource_group: str, storage_account_name: str, subscription_id: str, data_set_id: str=None, data_set_mapping_status=None, **kwargs) -> None: + super(ADLSGen2FolderDataSetMapping, self).__init__(**kwargs) + self.data_set_id = data_set_id + self.data_set_mapping_status = data_set_mapping_status + self.file_system = file_system + self.folder_path = folder_path + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'AdlsGen2Folder' + + +class BlobContainerDataSet(DataSet): + """An Azure storage blob container dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. BLOB Container name. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, container_name: str, resource_group: str, storage_account_name: str, subscription_id: str, **kwargs) -> None: + super(BlobContainerDataSet, self).__init__(**kwargs) + self.container_name = container_name + self.data_set_id = None + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'Container' + + +class BlobContainerDataSetMapping(DataSetMapping): + """A Blob container dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. BLOB Container name. + :type container_name: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, container_name: str, resource_group: str, storage_account_name: str, subscription_id: str, data_set_id: str=None, data_set_mapping_status=None, **kwargs) -> None: + super(BlobContainerDataSetMapping, self).__init__(**kwargs) + self.container_name = container_name + self.data_set_id = data_set_id + self.data_set_mapping_status = data_set_mapping_status + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'Container' + + +class BlobDataSet(DataSet): + """An Azure storage blob dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. Container that has the file path. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param file_path: Required. File path within the source data set + :type file_path: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, container_name: str, file_path: str, resource_group: str, storage_account_name: str, subscription_id: str, **kwargs) -> None: + super(BlobDataSet, self).__init__(**kwargs) + self.container_name = container_name + self.data_set_id = None + self.file_path = file_path + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'Blob' + + +class BlobDataSetMapping(DataSetMapping): + """A Blob dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. Container that has the file path. + :type container_name: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param file_path: Required. File path within the source data set + :type file_path: str + :param output_type: File output type. Possible values include: 'Csv', + 'Parquet' + :type output_type: str or ~azure.mgmt.datashare.models.OutputType + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'file_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'output_type': {'key': 'properties.outputType', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, container_name: str, file_path: str, resource_group: str, storage_account_name: str, subscription_id: str, data_set_id: str=None, data_set_mapping_status=None, output_type=None, **kwargs) -> None: + super(BlobDataSetMapping, self).__init__(**kwargs) + self.container_name = container_name + self.data_set_id = data_set_id + self.data_set_mapping_status = data_set_mapping_status + self.file_path = file_path + self.output_type = output_type + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'Blob' + + +class BlobFolderDataSet(DataSet): + """An Azure storage blob folder dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. Container that has the file path. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param prefix: Required. Prefix for blob folder + :type prefix: str + :param resource_group: Required. Resource group of storage account + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'prefix': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, container_name: str, prefix: str, resource_group: str, storage_account_name: str, subscription_id: str, **kwargs) -> None: + super(BlobFolderDataSet, self).__init__(**kwargs) + self.container_name = container_name + self.data_set_id = None + self.prefix = prefix + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'BlobFolder' + + +class BlobFolderDataSetMapping(DataSetMapping): + """A Blob folder dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param container_name: Required. Container that has the file path. + :type container_name: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param prefix: Required. Prefix for blob folder + :type prefix: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source + data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'prefix': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__(self, *, container_name: str, prefix: str, resource_group: str, storage_account_name: str, subscription_id: str, data_set_id: str=None, data_set_mapping_status=None, **kwargs) -> None: + super(BlobFolderDataSetMapping, self).__init__(**kwargs) + self.container_name = container_name + self.data_set_id = data_set_id + self.data_set_mapping_status = data_set_mapping_status + self.prefix = prefix + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + self.kind = 'BlobFolder' + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ConsumerInvitation(ProxyDto): + """A consumer Invitation data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar data_set_count: Number of data sets in a share + :vartype data_set_count: int + :ivar description: Description shared when the invitation was created + :vartype description: str + :param invitation_id: Required. Unique id of the invitation. + :type invitation_id: str + :ivar invitation_status: The status of the invitation. Possible values + include: 'Pending', 'Accepted', 'Rejected', 'Withdrawn' + :vartype invitation_status: str or + ~azure.mgmt.datashare.models.InvitationStatus + :ivar location: invitation location + :vartype location: str + :ivar responded_at: The time the recipient responded to the invitation. + :vartype responded_at: datetime + :ivar sender: Gets the name of the sender. + :vartype sender: str + :ivar sender_company_name: Gets the company name of the sender. + :vartype sender_company_name: str + :ivar sent_at: Gets the time at which the invitation was sent. + :vartype sent_at: datetime + :ivar share_name: Gets the source share Name. + :vartype share_name: str + :ivar terms_of_use: Terms of use shared when the invitation was created + :vartype terms_of_use: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_set_count': {'readonly': True}, + 'description': {'readonly': True}, + 'invitation_id': {'required': True}, + 'invitation_status': {'readonly': True}, + 'location': {'readonly': True}, + 'responded_at': {'readonly': True}, + 'sender': {'readonly': True}, + 'sender_company_name': {'readonly': True}, + 'sent_at': {'readonly': True}, + 'share_name': {'readonly': True}, + 'terms_of_use': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_set_count': {'key': 'properties.dataSetCount', 'type': 'int'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'invitation_status': {'key': 'properties.invitationStatus', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'responded_at': {'key': 'properties.respondedAt', 'type': 'iso-8601'}, + 'sender': {'key': 'properties.sender', 'type': 'str'}, + 'sender_company_name': {'key': 'properties.senderCompanyName', 'type': 'str'}, + 'sent_at': {'key': 'properties.sentAt', 'type': 'iso-8601'}, + 'share_name': {'key': 'properties.shareName', 'type': 'str'}, + 'terms_of_use': {'key': 'properties.termsOfUse', 'type': 'str'}, + } + + def __init__(self, *, invitation_id: str, **kwargs) -> None: + super(ConsumerInvitation, self).__init__(**kwargs) + self.data_set_count = None + self.description = None + self.invitation_id = invitation_id + self.invitation_status = None + self.location = None + self.responded_at = None + self.sender = None + self.sender_company_name = None + self.sent_at = None + self.share_name = None + self.terms_of_use = None + + +class ConsumerSourceDataSet(ProxyDto): + """A consumer side dataSet data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar data_set_id: DataSet Id + :vartype data_set_id: str + :ivar data_set_name: DataSet name + :vartype data_set_name: str + :ivar data_set_type: Type of dataSet. Possible values include: 'Blob', + 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'SqlDBTable', + 'SqlDWTable' + :vartype data_set_type: str or ~azure.mgmt.datashare.models.DataSetType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_set_id': {'readonly': True}, + 'data_set_name': {'readonly': True}, + 'data_set_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_name': {'key': 'properties.dataSetName', 'type': 'str'}, + 'data_set_type': {'key': 'properties.dataSetType', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ConsumerSourceDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.data_set_name = None + self.data_set_type = None + + +class DataShareError(Model): + """The data share error model. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The data share error body + :type error: ~azure.mgmt.datashare.models.DataShareErrorInfo + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DataShareErrorInfo'}, + } + + def __init__(self, *, error, **kwargs) -> None: + super(DataShareError, self).__init__(**kwargs) + self.error = error + + +class DataShareErrorException(HttpOperationError): + """Server responsed with exception of type: 'DataShareError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(DataShareErrorException, self).__init__(deserialize, response, 'DataShareError', *args) + + +class DataShareErrorInfo(Model): + """The data share error body model. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Code of the error + :type code: str + :param details: Nested details of the error model + :type details: list[~azure.mgmt.datashare.models.DataShareErrorInfo] + :param message: Required. Message of the error + :type message: str + :param target: Target of the error + :type target: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DataShareErrorInfo]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str, details=None, target: str=None, **kwargs) -> None: + super(DataShareErrorInfo, self).__init__(**kwargs) + self.code = code + self.details = details + self.message = message + self.target = target + + +class DimensionProperties(Model): + """properties for dimension. + + :param display_name: localized display name of the dimension to customer + :type display_name: str + :param name: dimension name + :type name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, name: str=None, **kwargs) -> None: + super(DimensionProperties, self).__init__(**kwargs) + self.display_name = display_name + self.name = name + + +class Identity(Model): + """Identity of resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: service principal Id + :vartype principal_id: str + :ivar tenant_id: Tenant Id + :vartype tenant_id: str + :param type: Identity Type. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.datashare.models.Type + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class Invitation(ProxyDto): + """A Invitation data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar invitation_id: unique invitation id + :vartype invitation_id: str + :ivar invitation_status: The status of the invitation. Possible values + include: 'Pending', 'Accepted', 'Rejected', 'Withdrawn' + :vartype invitation_status: str or + ~azure.mgmt.datashare.models.InvitationStatus + :ivar responded_at: The time the recipient responded to the invitation. + :vartype responded_at: datetime + :ivar sender: Gets the name of the sender. + :vartype sender: str + :ivar sent_at: Gets the time at which the invitation was sent. + :vartype sent_at: datetime + :param target_active_directory_id: The target Azure AD Id. Can't be + combined with email. + :type target_active_directory_id: str + :param target_email: The email the invitation is directed to. + :type target_email: str + :param target_object_id: The target user or application Id that invitation + is being sent to. + Must be specified along TargetActiveDirectoryId. This enables sending + invitations to specific users or applications in an AD tenant. + :type target_object_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invitation_id': {'readonly': True}, + 'invitation_status': {'readonly': True}, + 'responded_at': {'readonly': True}, + 'sender': {'readonly': True}, + 'sent_at': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'invitation_status': {'key': 'properties.invitationStatus', 'type': 'str'}, + 'responded_at': {'key': 'properties.respondedAt', 'type': 'iso-8601'}, + 'sender': {'key': 'properties.sender', 'type': 'str'}, + 'sent_at': {'key': 'properties.sentAt', 'type': 'iso-8601'}, + 'target_active_directory_id': {'key': 'properties.targetActiveDirectoryId', 'type': 'str'}, + 'target_email': {'key': 'properties.targetEmail', 'type': 'str'}, + 'target_object_id': {'key': 'properties.targetObjectId', 'type': 'str'}, + } + + def __init__(self, *, target_active_directory_id: str=None, target_email: str=None, target_object_id: str=None, **kwargs) -> None: + super(Invitation, self).__init__(**kwargs) + self.invitation_id = None + self.invitation_status = None + self.responded_at = None + self.sender = None + self.sent_at = None + self.target_active_directory_id = target_active_directory_id + self.target_email = target_email + self.target_object_id = target_object_id + + +class OperationMetaLogSpecification(Model): + """log specifications for operation api. + + :param blob_duration: blob duration of the log + :type blob_duration: str + :param display_name: localized name of the log category + :type display_name: str + :param name: name of the log category + :type name: str + """ + + _attribute_map = { + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, blob_duration: str=None, display_name: str=None, name: str=None, **kwargs) -> None: + super(OperationMetaLogSpecification, self).__init__(**kwargs) + self.blob_duration = blob_duration + self.display_name = display_name + self.name = name + + +class OperationMetaMetricSpecification(Model): + """metric specifications for the operation. + + :param aggregation_type: aggregation type of metric + :type aggregation_type: str + :param dimensions: properties for dimension + :type dimensions: list[~azure.mgmt.datashare.models.DimensionProperties] + :param display_description: description of the metric + :type display_description: str + :param display_name: localized name of the metric + :type display_name: str + :param enable_regional_mdm_account: enable regional mdm account + :type enable_regional_mdm_account: str + :param internal_metric_name: internal metric name + :type internal_metric_name: str + :param name: name of the metric + :type name: str + :param resource_id_dimension_name_override: dimension name use to replace + resource id if specified + :type resource_id_dimension_name_override: str + :param supported_aggregation_types: supported aggregation types + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: supported time grain types + :type supported_time_grain_types: list[str] + :param unit: units for the metric + :type unit: str + """ + + _attribute_map = { + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[DimensionProperties]'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, *, aggregation_type: str=None, dimensions=None, display_description: str=None, display_name: str=None, enable_regional_mdm_account: str=None, internal_metric_name: str=None, name: str=None, resource_id_dimension_name_override: str=None, supported_aggregation_types=None, supported_time_grain_types=None, unit: str=None, **kwargs) -> None: + super(OperationMetaMetricSpecification, self).__init__(**kwargs) + self.aggregation_type = aggregation_type + self.dimensions = dimensions + self.display_description = display_description + self.display_name = display_name + self.enable_regional_mdm_account = enable_regional_mdm_account + self.internal_metric_name = internal_metric_name + self.name = name + self.resource_id_dimension_name_override = resource_id_dimension_name_override + self.supported_aggregation_types = supported_aggregation_types + self.supported_time_grain_types = supported_time_grain_types + self.unit = unit + + +class OperationMetaServiceSpecification(Model): + """The operation meta service specification. + + :param log_specifications: log specifications for the operation + :type log_specifications: + list[~azure.mgmt.datashare.models.OperationMetaLogSpecification] + :param metric_specifications: metric specifications for the operation + :type metric_specifications: + list[~azure.mgmt.datashare.models.OperationMetaMetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[OperationMetaLogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetaMetricSpecification]'}, + } + + def __init__(self, *, log_specifications=None, metric_specifications=None, **kwargs) -> None: + super(OperationMetaServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications + self.metric_specifications = metric_specifications + + +class OperationModel(Model): + """The response model for get operations. + + :param display: Properties on the operation + :type display: ~azure.mgmt.datashare.models.OperationModelProperties + :param name: Operation name for display purposes + :type name: str + :param origin: origin of the operation + :type origin: str + :param service_specification: meta service specification + :type service_specification: + ~azure.mgmt.datashare.models.OperationMetaServiceSpecification + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'OperationModelProperties'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationMetaServiceSpecification'}, + } + + def __init__(self, *, display=None, name: str=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(OperationModel, self).__init__(**kwargs) + self.display = display + self.name = name + self.origin = origin + self.service_specification = service_specification + + +class OperationModelProperties(Model): + """Properties on operations. + + :param description: Description of the operation for display purposes + :type description: str + :param operation: Name of the operation for display purposes + :type operation: str + :param provider: Name of the provider for display purposes + :type provider: str + :param resource: Name of the resource type for display purposes + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None: + super(OperationModelProperties, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource + + +class OperationResponse(Model): + """Response for long running operation. + + All required parameters must be populated in order to send to Azure. + + :param end_time: start time + :type end_time: datetime + :param error: The error property when status is failed. + :type error: ~azure.mgmt.datashare.models.DataShareErrorInfo + :param start_time: start time + :type start_time: datetime + :param status: Required. Operation state of the long running operation. + Possible values include: 'Accepted', 'InProgress', 'TransientFailure', + 'Succeeded', 'Failed', 'Canceled' + :type status: str or ~azure.mgmt.datashare.models.Status + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'DataShareErrorInfo'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status, end_time=None, error=None, start_time=None, **kwargs) -> None: + super(OperationResponse, self).__init__(**kwargs) + self.end_time = end_time + self.error = error + self.start_time = start_time + self.status = status + + +class ProviderShareSubscription(ProxyDto): + """A provider side share subscription data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar company: Company name + :vartype company: str + :ivar created_at: created at + :vartype created_at: datetime + :ivar created_by: Created by + :vartype created_by: str + :ivar shared_at: Shared at + :vartype shared_at: datetime + :ivar shared_by: Shared by + :vartype shared_by: str + :ivar share_subscription_object_id: share Subscription Object Id + :vartype share_subscription_object_id: str + :ivar share_subscription_status: Gets the status of share subscription. + Possible values include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking' + :vartype share_subscription_status: str or + ~azure.mgmt.datashare.models.ShareSubscriptionStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'company': {'readonly': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'shared_at': {'readonly': True}, + 'shared_by': {'readonly': True}, + 'share_subscription_object_id': {'readonly': True}, + 'share_subscription_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'company': {'key': 'properties.company', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'shared_at': {'key': 'properties.sharedAt', 'type': 'iso-8601'}, + 'shared_by': {'key': 'properties.sharedBy', 'type': 'str'}, + 'share_subscription_object_id': {'key': 'properties.shareSubscriptionObjectId', 'type': 'str'}, + 'share_subscription_status': {'key': 'properties.shareSubscriptionStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProviderShareSubscription, self).__init__(**kwargs) + self.company = None + self.created_at = None + self.created_by = None + self.shared_at = None + self.shared_by = None + self.share_subscription_object_id = None + self.share_subscription_status = None + + +class SourceShareSynchronizationSetting(Model): + """A view of synchronization setting added by the provider. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledSourceSynchronizationSetting + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledSourceSynchronizationSetting'} + } + + def __init__(self, **kwargs) -> None: + super(SourceShareSynchronizationSetting, self).__init__(**kwargs) + self.kind = None + + +class ScheduledSourceSynchronizationSetting(SourceShareSynchronizationSetting): + """A type of synchronization setting based on schedule. + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Constant filled by server. + :type kind: str + :param recurrence_interval: Recurrence Interval. Possible values include: + 'Hour', 'Day' + :type recurrence_interval: str or + ~azure.mgmt.datashare.models.RecurrenceInterval + :param synchronization_time: Synchronization time + :type synchronization_time: datetime + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, recurrence_interval=None, synchronization_time=None, **kwargs) -> None: + super(ScheduledSourceSynchronizationSetting, self).__init__(**kwargs) + self.recurrence_interval = recurrence_interval + self.synchronization_time = synchronization_time + self.kind = 'ScheduleBased' + + +class SynchronizationSetting(ProxyDto): + """A Synchronization Setting data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledSynchronizationSetting + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledSynchronizationSetting'} + } + + def __init__(self, **kwargs) -> None: + super(SynchronizationSetting, self).__init__(**kwargs) + self.kind = None + self.kind = 'SynchronizationSetting' + + +class ScheduledSynchronizationSetting(SynchronizationSetting): + """A type of synchronization setting based on schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar created_at: Time at which the synchronization setting was created. + :vartype created_at: datetime + :ivar created_by: Name of the user who created the synchronization + setting. + :vartype created_by: str + :ivar provisioning_state: Gets or sets the provisioning state. Possible + values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.datashare.models.ProvisioningState + :param recurrence_interval: Required. Recurrence Interval. Possible values + include: 'Hour', 'Day' + :type recurrence_interval: str or + ~azure.mgmt.datashare.models.RecurrenceInterval + :param synchronization_time: Required. Synchronization time + :type synchronization_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'recurrence_interval': {'required': True}, + 'synchronization_time': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, recurrence_interval, synchronization_time, **kwargs) -> None: + super(ScheduledSynchronizationSetting, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.provisioning_state = None + self.recurrence_interval = recurrence_interval + self.synchronization_time = synchronization_time + self.kind = 'ScheduleBased' + + +class Trigger(ProxyDto): + """A Trigger data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledTrigger + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledTrigger'} + } + + def __init__(self, **kwargs) -> None: + super(Trigger, self).__init__(**kwargs) + self.kind = None + self.kind = 'Trigger' + + +class ScheduledTrigger(Trigger): + """A type of trigger based on schedule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar created_at: Time at which the trigger was created. + :vartype created_at: datetime + :ivar created_by: Name of the user who created the trigger. + :vartype created_by: str + :ivar provisioning_state: Gets the provisioning state. Possible values + include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.datashare.models.ProvisioningState + :param recurrence_interval: Required. Recurrence Interval. Possible values + include: 'Hour', 'Day' + :type recurrence_interval: str or + ~azure.mgmt.datashare.models.RecurrenceInterval + :param synchronization_mode: Synchronization mode. Possible values + include: 'Incremental', 'FullSync' + :type synchronization_mode: str or + ~azure.mgmt.datashare.models.SynchronizationMode + :param synchronization_time: Required. Synchronization time + :type synchronization_time: datetime + :ivar trigger_status: Gets the trigger state. Possible values include: + 'Active', 'Inactive', 'SourceSynchronizationSettingDeleted' + :vartype trigger_status: str or ~azure.mgmt.datashare.models.TriggerStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'recurrence_interval': {'required': True}, + 'synchronization_time': {'required': True}, + 'trigger_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_mode': {'key': 'properties.synchronizationMode', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + 'trigger_status': {'key': 'properties.triggerStatus', 'type': 'str'}, + } + + def __init__(self, *, recurrence_interval, synchronization_time, synchronization_mode=None, **kwargs) -> None: + super(ScheduledTrigger, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.provisioning_state = None + self.recurrence_interval = recurrence_interval + self.synchronization_mode = synchronization_mode + self.synchronization_time = synchronization_time + self.trigger_status = None + self.kind = 'ScheduleBased' + + +class Share(ProxyDto): + """A share data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar created_at: Time at which the share was created. + :vartype created_at: datetime + :ivar created_by: Name of the user who created the share. + :vartype created_by: str + :param description: Share description. + :type description: str + :ivar provisioning_state: Gets or sets the provisioning state. Possible + values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.datashare.models.ProvisioningState + :param share_kind: Share kind. Possible values include: 'CopyBased' + :type share_kind: str or ~azure.mgmt.datashare.models.ShareKind + :param terms: Share terms. + :type terms: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'share_kind': {'key': 'properties.shareKind', 'type': 'str'}, + 'terms': {'key': 'properties.terms', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, share_kind=None, terms: str=None, **kwargs) -> None: + super(Share, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.description = description + self.provisioning_state = None + self.share_kind = share_kind + self.terms = terms + + +class ShareSubscription(ProxyDto): + """A share subscription data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :ivar created_at: Time at which the share subscription was created. + :vartype created_at: datetime + :ivar created_by: The user who created the share subscription. + :vartype created_by: str + :param invitation_id: Required. The invitation id. + :type invitation_id: str + :ivar provisioning_state: Provisioning state of the share subscription. + Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.datashare.models.ProvisioningState + :ivar share_description: Description of share + :vartype share_description: str + :ivar share_kind: Kind of share. Possible values include: 'CopyBased' + :vartype share_kind: str or ~azure.mgmt.datashare.models.ShareKind + :ivar share_name: Name of the share + :vartype share_name: str + :ivar share_sender: Sender of the share + :vartype share_sender: str + :ivar share_sender_company_name: Company name of the share sender + :vartype share_sender_company_name: str + :ivar share_subscription_status: Gets the current status of share + subscription. Possible values include: 'Active', 'Revoked', + 'SourceDeleted', 'Revoking' + :vartype share_subscription_status: str or + ~azure.mgmt.datashare.models.ShareSubscriptionStatus + :ivar share_terms: Terms of a share + :vartype share_terms: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'invitation_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'share_description': {'readonly': True}, + 'share_kind': {'readonly': True}, + 'share_name': {'readonly': True}, + 'share_sender': {'readonly': True}, + 'share_sender_company_name': {'readonly': True}, + 'share_subscription_status': {'readonly': True}, + 'share_terms': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'share_description': {'key': 'properties.shareDescription', 'type': 'str'}, + 'share_kind': {'key': 'properties.shareKind', 'type': 'str'}, + 'share_name': {'key': 'properties.shareName', 'type': 'str'}, + 'share_sender': {'key': 'properties.shareSender', 'type': 'str'}, + 'share_sender_company_name': {'key': 'properties.shareSenderCompanyName', 'type': 'str'}, + 'share_subscription_status': {'key': 'properties.shareSubscriptionStatus', 'type': 'str'}, + 'share_terms': {'key': 'properties.shareTerms', 'type': 'str'}, + } + + def __init__(self, *, invitation_id: str, **kwargs) -> None: + super(ShareSubscription, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.invitation_id = invitation_id + self.provisioning_state = None + self.share_description = None + self.share_kind = None + self.share_name = None + self.share_sender = None + self.share_sender_company_name = None + self.share_subscription_status = None + self.share_terms = None + + +class ShareSubscriptionSynchronization(Model): + """A ShareSubscriptionSynchronization data transfer object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar duration_ms: Synchronization duration + :vartype duration_ms: int + :ivar end_time: End time of synchronization + :vartype end_time: datetime + :ivar message: message of Synchronization + :vartype message: str + :ivar start_time: start time of synchronization + :vartype start_time: datetime + :ivar status: Raw Status + :vartype status: str + :param synchronization_id: Required. Synchronization id + :type synchronization_id: str + """ + + _validation = { + 'duration_ms': {'readonly': True}, + 'end_time': {'readonly': True}, + 'message': {'readonly': True}, + 'start_time': {'readonly': True}, + 'status': {'readonly': True}, + 'synchronization_id': {'required': True}, + } + + _attribute_map = { + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'synchronization_id': {'key': 'synchronizationId', 'type': 'str'}, + } + + def __init__(self, *, synchronization_id: str, **kwargs) -> None: + super(ShareSubscriptionSynchronization, self).__init__(**kwargs) + self.duration_ms = None + self.end_time = None + self.message = None + self.start_time = None + self.status = None + self.synchronization_id = synchronization_id + + +class ShareSynchronization(Model): + """A ShareSynchronization data transfer object. + + :param company: Company name + :type company: str + :param duration_ms: synchronization duration + :type duration_ms: int + :param end_time: End time of synchronization + :type end_time: datetime + :param message: message of synchronization + :type message: str + :param recipient: Recipient id + :type recipient: str + :param start_time: start time of synchronization + :type start_time: datetime + :param status: Raw Status + :type status: str + :param synchronization_id: Synchronization id + :type synchronization_id: str + """ + + _attribute_map = { + 'company': {'key': 'company', 'type': 'str'}, + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recipient': {'key': 'recipient', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'synchronization_id': {'key': 'synchronizationId', 'type': 'str'}, + } + + def __init__(self, *, company: str=None, duration_ms: int=None, end_time=None, message: str=None, recipient: str=None, start_time=None, status: str=None, synchronization_id: str=None, **kwargs) -> None: + super(ShareSynchronization, self).__init__(**kwargs) + self.company = company + self.duration_ms = duration_ms + self.end_time = end_time + self.message = message + self.recipient = recipient + self.start_time = start_time + self.status = status + self.synchronization_id = synchronization_id + + +class SqlDBTableDataSet(DataSet): + """A SQL DB table dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param database_name: Database name of the source data set + :type database_name: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param sql_server_resource_id: Resource id of SQL server + :type sql_server_resource_id: str + :param table_name: SQL DB table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__(self, *, database_name: str=None, sql_server_resource_id: str=None, table_name: str=None, **kwargs) -> None: + super(SqlDBTableDataSet, self).__init__(**kwargs) + self.database_name = database_name + self.data_set_id = None + self.sql_server_resource_id = sql_server_resource_id + self.table_name = table_name + self.kind = 'SqlDBTable' + + +class SqlDBTableDataSetMapping(DataSetMapping): + """A SQL DB Table dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param database_name: Required. DatabaseName name of the sink data set + :type database_name: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param sql_server_resource_id: Required. Resource id of SQL server + :type sql_server_resource_id: str + :param table_name: Required. SQL DB table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'database_name': {'required': True}, + 'sql_server_resource_id': {'required': True}, + 'table_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__(self, *, database_name: str, sql_server_resource_id: str, table_name: str, data_set_id: str=None, data_set_mapping_status=None, **kwargs) -> None: + super(SqlDBTableDataSetMapping, self).__init__(**kwargs) + self.database_name = database_name + self.data_set_id = data_set_id + self.data_set_mapping_status = data_set_mapping_status + self.sql_server_resource_id = sql_server_resource_id + self.table_name = table_name + self.kind = 'SqlDBTable' + + +class SqlDWTableDataSet(DataSet): + """A SQL DW table dataset. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_set_id: Unique id for identifying a data set resource + :vartype data_set_id: str + :param data_warehouse_name: DataWarehouse name of the source data set + :type data_warehouse_name: str + :param sql_server_resource_id: Resource id of SQL server + :type sql_server_resource_id: str + :param table_name: SQL DW table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_warehouse_name': {'key': 'properties.dataWarehouseName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__(self, *, data_warehouse_name: str=None, sql_server_resource_id: str=None, table_name: str=None, **kwargs) -> None: + super(SqlDWTableDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.data_warehouse_name = data_warehouse_name + self.sql_server_resource_id = sql_server_resource_id + self.table_name = table_name + self.kind = 'SqlDWTable' + + +class SqlDWTableDataSetMapping(DataSetMapping): + """A SQL DW Table dataset mapping. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource + :vartype id: str + :ivar name: Name of the azure resource + :vartype name: str + :ivar type: Type of the azure resource + :vartype type: str + :param kind: Required. Constant filled by server. + :type kind: str + :param data_set_id: Gets the id of source dataset. + :type data_set_id: str + :param data_set_mapping_status: Gets the status of the dataset mapping. + Possible values include: 'Ok', 'Broken' + :type data_set_mapping_status: str or + ~azure.mgmt.datashare.models.DataSetMappingStatus + :param data_warehouse_name: Required. DataWarehouse name of the source + data set + :type data_warehouse_name: str + :param sql_server_resource_id: Required. Resource id of SQL server + :type sql_server_resource_id: str + :param table_name: Required. SQL DW table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_warehouse_name': {'required': True}, + 'sql_server_resource_id': {'required': True}, + 'table_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'data_warehouse_name': {'key': 'properties.dataWarehouseName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__(self, *, data_warehouse_name: str, sql_server_resource_id: str, table_name: str, data_set_id: str=None, data_set_mapping_status=None, **kwargs) -> None: + super(SqlDWTableDataSetMapping, self).__init__(**kwargs) + self.data_set_id = data_set_id + self.data_set_mapping_status = data_set_mapping_status + self.data_warehouse_name = data_warehouse_name + self.sql_server_resource_id = sql_server_resource_id + self.table_name = table_name + self.kind = 'SqlDWTable' + + +class SynchronizationDetails(Model): + """Synchronization details at dataset level. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar data_set_id: id of dataSet + :vartype data_set_id: str + :ivar data_set_type: type of DataSet. Possible values include: 'Blob', + 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'SqlDBTable', + 'SqlDWTable' + :vartype data_set_type: str or ~azure.mgmt.datashare.models.DataSetType + :ivar duration_ms: duration of dataset level copy + :vartype duration_ms: int + :ivar end_time: End time of dataset level copy + :vartype end_time: datetime + :ivar files_read: The number of files read from the source dataset. + :vartype files_read: long + :ivar files_written: The number of files written into the sink dataset. + :vartype files_written: long + :ivar message: Error Message if any + :vartype message: str + :ivar name: name of dataSet + :vartype name: str + :ivar rows_copied: The number of files copied into the sink dataset. + :vartype rows_copied: long + :ivar rows_read: The number of rows read from the source dataset. + :vartype rows_read: long + :ivar size_read: The size of the data read from the source dataset in + bytes. + :vartype size_read: long + :ivar size_written: The size of the data written into the sink dataset in + bytes. + :vartype size_written: long + :ivar start_time: start time of dataset level copy + :vartype start_time: datetime + :ivar status: Raw Status + :vartype status: str + :ivar v_core: The vCore units consumed for the dataset synchronization. + :vartype v_core: long + """ + + _validation = { + 'data_set_id': {'readonly': True}, + 'data_set_type': {'readonly': True}, + 'duration_ms': {'readonly': True}, + 'end_time': {'readonly': True}, + 'files_read': {'readonly': True}, + 'files_written': {'readonly': True}, + 'message': {'readonly': True}, + 'name': {'readonly': True}, + 'rows_copied': {'readonly': True}, + 'rows_read': {'readonly': True}, + 'size_read': {'readonly': True}, + 'size_written': {'readonly': True}, + 'start_time': {'readonly': True}, + 'status': {'readonly': True}, + 'v_core': {'readonly': True}, + } + + _attribute_map = { + 'data_set_id': {'key': 'dataSetId', 'type': 'str'}, + 'data_set_type': {'key': 'dataSetType', 'type': 'str'}, + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'files_read': {'key': 'filesRead', 'type': 'long'}, + 'files_written': {'key': 'filesWritten', 'type': 'long'}, + 'message': {'key': 'message', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'rows_copied': {'key': 'rowsCopied', 'type': 'long'}, + 'rows_read': {'key': 'rowsRead', 'type': 'long'}, + 'size_read': {'key': 'sizeRead', 'type': 'long'}, + 'size_written': {'key': 'sizeWritten', 'type': 'long'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'v_core': {'key': 'vCore', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(SynchronizationDetails, self).__init__(**kwargs) + self.data_set_id = None + self.data_set_type = None + self.duration_ms = None + self.end_time = None + self.files_read = None + self.files_written = None + self.message = None + self.name = None + self.rows_copied = None + self.rows_read = None + self.size_read = None + self.size_written = None + self.start_time = None + self.status = None + self.v_core = None + + +class Synchronize(Model): + """Payload for the synchronizing the data. + + :param synchronization_mode: Mode of synchronization used in triggers and + snapshot sync. Incremental by default. Possible values include: + 'Incremental', 'FullSync' + :type synchronization_mode: str or + ~azure.mgmt.datashare.models.SynchronizationMode + """ + + _attribute_map = { + 'synchronization_mode': {'key': 'synchronizationMode', 'type': 'str'}, + } + + def __init__(self, *, synchronization_mode=None, **kwargs) -> None: + super(Synchronize, self).__init__(**kwargs) + self.synchronization_mode = synchronization_mode diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_paged_models.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_paged_models.py new file mode 100644 index 000000000000..25b47dc1b6d7 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/models/_paged_models.py @@ -0,0 +1,222 @@ +# 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 AccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`Account ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Account]'} + } + + def __init__(self, *args, **kwargs): + + super(AccountPaged, self).__init__(*args, **kwargs) +class ConsumerInvitationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ConsumerInvitation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConsumerInvitation]'} + } + + def __init__(self, *args, **kwargs): + + super(ConsumerInvitationPaged, self).__init__(*args, **kwargs) +class DataSetPaged(Paged): + """ + A paging container for iterating over a list of :class:`DataSet ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataSet]'} + } + + def __init__(self, *args, **kwargs): + + super(DataSetPaged, self).__init__(*args, **kwargs) +class DataSetMappingPaged(Paged): + """ + A paging container for iterating over a list of :class:`DataSetMapping ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataSetMapping]'} + } + + def __init__(self, *args, **kwargs): + + super(DataSetMappingPaged, self).__init__(*args, **kwargs) +class InvitationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Invitation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Invitation]'} + } + + def __init__(self, *args, **kwargs): + + super(InvitationPaged, self).__init__(*args, **kwargs) +class OperationModelPaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationModel ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationModel]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationModelPaged, self).__init__(*args, **kwargs) +class SharePaged(Paged): + """ + A paging container for iterating over a list of :class:`Share ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Share]'} + } + + def __init__(self, *args, **kwargs): + + super(SharePaged, self).__init__(*args, **kwargs) +class ShareSynchronizationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ShareSynchronization ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ShareSynchronization]'} + } + + def __init__(self, *args, **kwargs): + + super(ShareSynchronizationPaged, self).__init__(*args, **kwargs) +class SynchronizationDetailsPaged(Paged): + """ + A paging container for iterating over a list of :class:`SynchronizationDetails ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SynchronizationDetails]'} + } + + def __init__(self, *args, **kwargs): + + super(SynchronizationDetailsPaged, self).__init__(*args, **kwargs) +class ProviderShareSubscriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ProviderShareSubscription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ProviderShareSubscription]'} + } + + def __init__(self, *args, **kwargs): + + super(ProviderShareSubscriptionPaged, self).__init__(*args, **kwargs) +class SourceShareSynchronizationSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`SourceShareSynchronizationSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SourceShareSynchronizationSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(SourceShareSynchronizationSettingPaged, self).__init__(*args, **kwargs) +class ShareSubscriptionSynchronizationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ShareSubscriptionSynchronization ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ShareSubscriptionSynchronization]'} + } + + def __init__(self, *args, **kwargs): + + super(ShareSubscriptionSynchronizationPaged, self).__init__(*args, **kwargs) +class ShareSubscriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ShareSubscription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ShareSubscription]'} + } + + def __init__(self, *args, **kwargs): + + super(ShareSubscriptionPaged, self).__init__(*args, **kwargs) +class ConsumerSourceDataSetPaged(Paged): + """ + A paging container for iterating over a list of :class:`ConsumerSourceDataSet ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConsumerSourceDataSet]'} + } + + def __init__(self, *args, **kwargs): + + super(ConsumerSourceDataSetPaged, self).__init__(*args, **kwargs) +class SynchronizationSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`SynchronizationSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SynchronizationSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(SynchronizationSettingPaged, self).__init__(*args, **kwargs) +class TriggerPaged(Paged): + """ + A paging container for iterating over a list of :class:`Trigger ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Trigger]'} + } + + def __init__(self, *args, **kwargs): + + super(TriggerPaged, self).__init__(*args, **kwargs) diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/__init__.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/__init__.py new file mode 100644 index 000000000000..1a56f7b5ccf6 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/__init__.py @@ -0,0 +1,38 @@ +# 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 ._accounts_operations import AccountsOperations +from ._consumer_invitations_operations import ConsumerInvitationsOperations +from ._data_sets_operations import DataSetsOperations +from ._data_set_mappings_operations import DataSetMappingsOperations +from ._invitations_operations import InvitationsOperations +from ._operations import Operations +from ._shares_operations import SharesOperations +from ._provider_share_subscriptions_operations import ProviderShareSubscriptionsOperations +from ._share_subscriptions_operations import ShareSubscriptionsOperations +from ._consumer_source_data_sets_operations import ConsumerSourceDataSetsOperations +from ._synchronization_settings_operations import SynchronizationSettingsOperations +from ._triggers_operations import TriggersOperations + +__all__ = [ + 'AccountsOperations', + 'ConsumerInvitationsOperations', + 'DataSetsOperations', + 'DataSetMappingsOperations', + 'InvitationsOperations', + 'Operations', + 'SharesOperations', + 'ProviderShareSubscriptionsOperations', + 'ShareSubscriptionsOperations', + 'ConsumerSourceDataSetsOperations', + 'SynchronizationSettingsOperations', + 'TriggersOperations', +] diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_accounts_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_accounts_operations.py new file mode 100644 index 000000000000..041eeb9f054d --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_accounts_operations.py @@ -0,0 +1,515 @@ +# 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 AccountsOperations(object): + """AccountsOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Get an account under a resource group. + + Get an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_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: Account or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.Account or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + + def _create_initial( + self, resource_group_name, account_name, account, 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'), + 'accountName': self._serialize.url("account_name", account_name, '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(account, 'Account') + + # 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Account', response) + if response.status_code == 201: + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, account, custom_headers=None, raw=False, polling=True, **operation_config): + """Create an account in the given resource group. + + Create an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param account: The account payload. + :type account: ~azure.mgmt.datashare.models.Account + :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 Account or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datashare.models.Account] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datashare.models.Account]] + :raises: + :class:`DataShareErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + account=account, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Account', 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.DataShare/accounts/{accountName}'} + + + def _delete_initial( + self, resource_group_name, account_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'), + 'accountName': self._serialize.url("account_name", account_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete an account. + + DeleteAccount. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_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 OperationResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datashare.models.OperationResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datashare.models.OperationResponse]] + :raises: + :class:`DataShareErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationResponse', 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + def update( + self, resource_group_name, account_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Patch a given account. + + Patch an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param tags: Tags on the azure resource. + :type tags: dict[str, 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: Account or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.Account or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + account_update_parameters = models.AccountUpdateParameters(tags=tags) + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, '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(account_update_parameters, 'AccountUpdateParameters') + + # 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]: + raise models.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Account', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + def list_by_subscription( + self, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List Accounts in a subscription. + + List Accounts in Subscription. + + :param skip_token: Continuation token + :type skip_token: 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 Account + :rtype: + ~azure.mgmt.datashare.models.AccountPaged[~azure.mgmt.datashare.models.Account] + :raises: + :class:`DataShareErrorException` + """ + 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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts'} + + def list_by_resource_group( + self, resource_group_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List Accounts in a resource group. + + List Accounts in ResourceGroup. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param skip_token: Continuation token + :type skip_token: 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 Account + :rtype: + ~azure.mgmt.datashare.models.AccountPaged[~azure.mgmt.datashare.models.Account] + :raises: + :class:`DataShareErrorException` + """ + 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') + } + 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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_consumer_invitations_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_consumer_invitations_operations.py new file mode 100644 index 000000000000..c0c6d93723e7 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_consumer_invitations_operations.py @@ -0,0 +1,233 @@ +# 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 ConsumerInvitationsOperations(object): + """ConsumerInvitationsOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def reject_invitation( + self, location, invitation_id, custom_headers=None, raw=False, **operation_config): + """Rejects the invitation identified by invitationId. + + Reject an invitation. + + :param location: Location of the invitation + :type location: str + :param invitation_id: Unique id of the invitation. + :type invitation_id: 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: ConsumerInvitation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.ConsumerInvitation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + invitation = models.ConsumerInvitation(invitation_id=invitation_id) + + # Construct URL + url = self.reject_invitation.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, '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(invitation, 'ConsumerInvitation') + + # 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConsumerInvitation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + reject_invitation.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/RejectInvitation'} + + def get( + self, location, invitation_id, custom_headers=None, raw=False, **operation_config): + """Gets the invitation identified by invitationId. + + Get an invitation. + + :param location: Location of the invitation + :type location: str + :param invitation_id: An invitation id + :type invitation_id: 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: ConsumerInvitation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.ConsumerInvitation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'invitationId': self._serialize.url("invitation_id", invitation_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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConsumerInvitation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId}'} + + def list_invitations( + self, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List the invitations. + + Lists invitations. + + :param skip_token: The continuation token + :type skip_token: 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 ConsumerInvitation + :rtype: + ~azure.mgmt.datashare.models.ConsumerInvitationPaged[~azure.mgmt.datashare.models.ConsumerInvitation] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_invitations.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ConsumerInvitationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_invitations.metadata = {'url': '/providers/Microsoft.DataShare/ListInvitations'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_consumer_source_data_sets_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_consumer_source_data_sets_operations.py new file mode 100644 index 000000000000..2cb4202b633c --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_consumer_source_data_sets_operations.py @@ -0,0 +1,119 @@ +# 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 ConsumerSourceDataSetsOperations(object): + """ConsumerSourceDataSetsOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list_by_share_subscription( + self, resource_group_name, account_name, share_subscription_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Get source dataSets of a shareSubscription. + + Get source dataSets of a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param skip_token: Continuation token + :type skip_token: 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 ConsumerSourceDataSet + :rtype: + ~azure.mgmt.datashare.models.ConsumerSourceDataSetPaged[~azure.mgmt.datashare.models.ConsumerSourceDataSet] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share_subscription.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ConsumerSourceDataSetPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/ConsumerSourceDataSets'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_data_set_mappings_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_data_set_mappings_operations.py new file mode 100644 index 000000000000..bd36b6b4ae08 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_data_set_mappings_operations.py @@ -0,0 +1,327 @@ +# 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 DataSetMappingsOperations(object): + """DataSetMappingsOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, account_name, share_subscription_name, data_set_mapping_name, custom_headers=None, raw=False, **operation_config): + """Get DataSetMapping in a shareSubscription. + + Get a DataSetMapping in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param data_set_mapping_name: The name of the dataSetMapping. + :type data_set_mapping_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: DataSetMapping or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.DataSetMapping or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'dataSetMappingName': self._serialize.url("data_set_mapping_name", data_set_mapping_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataSetMapping', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + + def create( + self, resource_group_name, account_name, share_subscription_name, data_set_mapping_name, data_set_mapping, custom_headers=None, raw=False, **operation_config): + """Maps a source data set in the source share to a sink data set in the + share subscription. + Enables copying the data set from source to destination. + + Create a DataSetMapping . + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription + which will hold the data set sink. + :type share_subscription_name: str + :param data_set_mapping_name: The Id of the source data set being + mapped. + :type data_set_mapping_name: str + :param data_set_mapping: Destination data set configuration details. + :type data_set_mapping: ~azure.mgmt.datashare.models.DataSetMapping + :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: DataSetMapping or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.DataSetMapping or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'dataSetMappingName': self._serialize.url("data_set_mapping_name", data_set_mapping_name, '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(data_set_mapping, 'DataSetMapping') + + # 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataSetMapping', response) + if response.status_code == 201: + deserialized = self._deserialize('DataSetMapping', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + + def delete( + self, resource_group_name, account_name, share_subscription_name, data_set_mapping_name, custom_headers=None, raw=False, **operation_config): + """Delete DataSetMapping in a shareSubscription. + + Delete a DataSetMapping in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param data_set_mapping_name: The name of the dataSetMapping. + :type data_set_mapping_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'dataSetMappingName': self._serialize.url("data_set_mapping_name", data_set_mapping_name, '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 = {} + 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, 204]: + raise models.DataShareErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + + def list_by_share_subscription( + self, resource_group_name, account_name, share_subscription_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List DataSetMappings in a share subscription. + + List DataSetMappings in a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param skip_token: Continuation token + :type skip_token: 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 DataSetMapping + :rtype: + ~azure.mgmt.datashare.models.DataSetMappingPaged[~azure.mgmt.datashare.models.DataSetMapping] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share_subscription.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DataSetMappingPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_data_sets_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_data_sets_operations.py new file mode 100644 index 000000000000..c2be6f2ce06f --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_data_sets_operations.py @@ -0,0 +1,323 @@ +# 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 DataSetsOperations(object): + """DataSetsOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, account_name, share_name, data_set_name, custom_headers=None, raw=False, **operation_config): + """Get DataSet in a share. + + Get a DataSet in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param data_set_name: The name of the dataSet. + :type data_set_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: DataSet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.DataSet or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'dataSetName': self._serialize.url("data_set_name", data_set_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataSet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + def create( + self, resource_group_name, account_name, share_name, data_set_name, data_set, custom_headers=None, raw=False, **operation_config): + """Adds a new data set to an existing share or updates it if existing. + + Create a DataSet . + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to add the data set to. + :type share_name: str + :param data_set_name: The name of the dataSet. + :type data_set_name: str + :param data_set: The new data set information. + :type data_set: ~azure.mgmt.datashare.models.DataSet + :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: DataSet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.DataSet or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'dataSetName': self._serialize.url("data_set_name", data_set_name, '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(data_set, 'DataSet') + + # 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataSet', response) + if response.status_code == 201: + deserialized = self._deserialize('DataSet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + def delete( + self, resource_group_name, account_name, share_name, data_set_name, custom_headers=None, raw=False, **operation_config): + """Delete DataSet in a share. + + Delete a DataSet in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param data_set_name: The name of the dataSet. + :type data_set_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'dataSetName': self._serialize.url("data_set_name", data_set_name, '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 = {} + 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, 204]: + raise models.DataShareErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + def list_by_share( + self, resource_group_name, account_name, share_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List DataSets in a share. + + List DataSets in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: continuation token + :type skip_token: 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 DataSet + :rtype: + ~azure.mgmt.datashare.models.DataSetPaged[~azure.mgmt.datashare.models.DataSet] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DataSetPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_invitations_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_invitations_operations.py new file mode 100644 index 000000000000..ad724a72d10e --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_invitations_operations.py @@ -0,0 +1,323 @@ +# 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 InvitationsOperations(object): + """InvitationsOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, account_name, share_name, invitation_name, custom_headers=None, raw=False, **operation_config): + """Get Invitation in a share. + + Get an invitation in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param invitation_name: The name of the invitation. + :type invitation_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: Invitation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.Invitation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'invitationName': self._serialize.url("invitation_name", invitation_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Invitation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + + def create( + self, resource_group_name, account_name, share_name, invitation_name, invitation, custom_headers=None, raw=False, **operation_config): + """Sends a new invitation to a recipient to access a share. + + Create an invitation . + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to send the invitation for. + :type share_name: str + :param invitation_name: The name of the invitation. + :type invitation_name: str + :param invitation: Invitation details. + :type invitation: ~azure.mgmt.datashare.models.Invitation + :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: Invitation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.Invitation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'invitationName': self._serialize.url("invitation_name", invitation_name, '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(invitation, 'Invitation') + + # 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Invitation', response) + if response.status_code == 201: + deserialized = self._deserialize('Invitation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + + def delete( + self, resource_group_name, account_name, share_name, invitation_name, custom_headers=None, raw=False, **operation_config): + """Delete Invitation in a share. + + Delete an invitation in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param invitation_name: The name of the invitation. + :type invitation_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'invitationName': self._serialize.url("invitation_name", invitation_name, '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 = {} + 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, 204]: + raise models.DataShareErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + + def list_by_share( + self, resource_group_name, account_name, share_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List all Invitations in a share. + + List invitations in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: The continuation token + :type skip_token: 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 Invitation + :rtype: + ~azure.mgmt.datashare.models.InvitationPaged[~azure.mgmt.datashare.models.Invitation] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.InvitationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_operations.py new file mode 100644 index 000000000000..6e1c462d5f96 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_operations.py @@ -0,0 +1,102 @@ +# 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available operations. + + List of available 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 OperationModel + :rtype: + ~azure.mgmt.datashare.models.OperationModelPaged[~azure.mgmt.datashare.models.OperationModel] + :raises: + :class:`DataShareErrorException` + """ + 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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationModelPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.DataShare/operations'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_provider_share_subscriptions_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_provider_share_subscriptions_operations.py new file mode 100644 index 000000000000..974f567e0f9b --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_provider_share_subscriptions_operations.py @@ -0,0 +1,362 @@ +# 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 ProviderShareSubscriptionsOperations(object): + """ProviderShareSubscriptionsOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get_by_share( + self, resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers=None, raw=False, **operation_config): + """Get share subscription in a provider share. + + Get share subscription in a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param provider_share_subscription_id: To locate shareSubscription + :type provider_share_subscription_id: 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: ProviderShareSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.ProviderShareSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # Construct URL + url = self.get_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'providerShareSubscriptionId': self._serialize.url("provider_share_subscription_id", provider_share_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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProviderShareSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}'} + + def list_by_share( + self, resource_group_name, account_name, share_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List of available share subscriptions to a provider share. + + List share subscriptions in a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: Continuation Token + :type skip_token: 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 ProviderShareSubscription + :rtype: + ~azure.mgmt.datashare.models.ProviderShareSubscriptionPaged[~azure.mgmt.datashare.models.ProviderShareSubscription] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ProviderShareSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions'} + + + def _revoke_initial( + self, resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.revoke.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'providerShareSubscriptionId': self._serialize.url("provider_share_subscription_id", provider_share_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' + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.DataShareErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ProviderShareSubscription', response) + if response.status_code == 202: + deserialized = self._deserialize('ProviderShareSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def revoke( + self, resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Revoke share subscription in a provider share. + + Revoke share subscription in a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param provider_share_subscription_id: To locate shareSubscription + :type provider_share_subscription_id: 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 + ProviderShareSubscription or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datashare.models.ProviderShareSubscription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datashare.models.ProviderShareSubscription]] + :raises: + :class:`DataShareErrorException` + """ + raw_result = self._revoke_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + provider_share_subscription_id=provider_share_subscription_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ProviderShareSubscription', 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + revoke.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} + + def reinstate( + self, resource_group_name, account_name, share_name, provider_share_subscription_id, custom_headers=None, raw=False, **operation_config): + """Reinstate share subscription in a provider share. + + Reinstate share subscription in a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param provider_share_subscription_id: To locate shareSubscription + :type provider_share_subscription_id: 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: ProviderShareSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.ProviderShareSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # Construct URL + url = self.reinstate.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'providerShareSubscriptionId': self._serialize.url("provider_share_subscription_id", provider_share_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' + 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProviderShareSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + reinstate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_share_subscriptions_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_share_subscriptions_operations.py new file mode 100644 index 000000000000..20d62b7af51b --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_share_subscriptions_operations.py @@ -0,0 +1,828 @@ +# 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 ShareSubscriptionsOperations(object): + """ShareSubscriptionsOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, account_name, share_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get shareSubscription in an account. + + Get a shareSubscription in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_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: ShareSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.ShareSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ShareSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + def create( + self, resource_group_name, account_name, share_subscription_name, invitation_id, custom_headers=None, raw=False, **operation_config): + """Create shareSubscription in an account. + + Create a shareSubscription in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param invitation_id: The invitation id. + :type invitation_id: 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: ShareSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.ShareSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + share_subscription = models.ShareSubscription(invitation_id=invitation_id) + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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(share_subscription, 'ShareSubscription') + + # 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ShareSubscription', response) + if response.status_code == 201: + deserialized = self._deserialize('ShareSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + + def _delete_initial( + self, resource_group_name, account_name, share_subscription_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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, account_name, share_subscription_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete shareSubscription in an account. + + Delete a shareSubscription in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_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 OperationResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datashare.models.OperationResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datashare.models.OperationResponse]] + :raises: + :class:`DataShareErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationResponse', 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + def list_source_share_synchronization_settings( + self, resource_group_name, account_name, share_subscription_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Get source share synchronization settings for a shareSubscription. + + Get synchronization settings set on a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param skip_token: Continuation token + :type skip_token: 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 + SourceShareSynchronizationSetting + :rtype: + ~azure.mgmt.datashare.models.SourceShareSynchronizationSettingPaged[~azure.mgmt.datashare.models.SourceShareSynchronizationSetting] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_source_share_synchronization_settings.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.post(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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SourceShareSynchronizationSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_source_share_synchronization_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings'} + + def list_synchronizations( + self, resource_group_name, account_name, share_subscription_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List Synchronizations in a share subscription. + + List synchronizations of a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param skip_token: Continuation token + :type skip_token: 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 ShareSubscriptionSynchronization + :rtype: + ~azure.mgmt.datashare.models.ShareSubscriptionSynchronizationPaged[~azure.mgmt.datashare.models.ShareSubscriptionSynchronization] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronizations.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.post(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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ShareSubscriptionSynchronizationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_synchronizations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations'} + + def list_synchronization_details( + self, resource_group_name, account_name, share_subscription_name, synchronization_id, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List data set level details for a share subscription synchronization. + + List synchronization details. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param synchronization_id: Synchronization id + :type synchronization_id: str + :param skip_token: Continuation token + :type skip_token: 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 SynchronizationDetails + :rtype: + ~azure.mgmt.datashare.models.SynchronizationDetailsPaged[~azure.mgmt.datashare.models.SynchronizationDetails] + :raises: + :class:`DataShareErrorException` + """ + share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization_details.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + else: + url = next_link + query_parameters = {} + + # 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(share_subscription_synchronization, 'ShareSubscriptionSynchronization') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SynchronizationDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_synchronization_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails'} + + + def _synchronize_method_initial( + self, resource_group_name, account_name, share_subscription_name, synchronization_mode=None, custom_headers=None, raw=False, **operation_config): + synchronize = models.Synchronize(synchronization_mode=synchronization_mode) + + # Construct URL + url = self.synchronize_method.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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(synchronize, 'Synchronize') + + # 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, 202]: + raise models.DataShareErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ShareSubscriptionSynchronization', response) + if response.status_code == 202: + deserialized = self._deserialize('ShareSubscriptionSynchronization', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def synchronize_method( + self, resource_group_name, account_name, share_subscription_name, synchronization_mode=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Initiate an asynchronous data share job. + + Initiate a copy. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of share subscription + :type share_subscription_name: str + :param synchronization_mode: Mode of synchronization used in triggers + and snapshot sync. Incremental by default. Possible values include: + 'Incremental', 'FullSync' + :type synchronization_mode: str or + ~azure.mgmt.datashare.models.SynchronizationMode + :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 + ShareSubscriptionSynchronization or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datashare.models.ShareSubscriptionSynchronization] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datashare.models.ShareSubscriptionSynchronization]] + :raises: + :class:`DataShareErrorException` + """ + raw_result = self._synchronize_method_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_mode=synchronization_mode, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ShareSubscriptionSynchronization', 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + synchronize_method.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} + + + def _cancel_synchronization_initial( + self, resource_group_name, account_name, share_subscription_name, synchronization_id, custom_headers=None, raw=False, **operation_config): + share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) + + # Construct URL + url = self.cancel_synchronization.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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(share_subscription_synchronization, 'ShareSubscriptionSynchronization') + + # 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, 202]: + raise models.DataShareErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ShareSubscriptionSynchronization', response) + if response.status_code == 202: + deserialized = self._deserialize('ShareSubscriptionSynchronization', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def cancel_synchronization( + self, resource_group_name, account_name, share_subscription_name, synchronization_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Request cancellation of a data share snapshot. + + Request to cancel a synchronization. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param synchronization_id: Synchronization id + :type synchronization_id: 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 + ShareSubscriptionSynchronization or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datashare.models.ShareSubscriptionSynchronization] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datashare.models.ShareSubscriptionSynchronization]] + :raises: + :class:`DataShareErrorException` + """ + raw_result = self._cancel_synchronization_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_id=synchronization_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ShareSubscriptionSynchronization', 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + cancel_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} + + def list_by_account( + self, resource_group_name, account_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List of available share subscriptions under an account. + + List share subscriptions in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param skip_token: Continuation Token + :type skip_token: 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 ShareSubscription + :rtype: + ~azure.mgmt.datashare.models.ShareSubscriptionPaged[~azure.mgmt.datashare.models.ShareSubscription] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_account.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'), + 'accountName': self._serialize.url("account_name", account_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ShareSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_shares_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_shares_operations.py new file mode 100644 index 000000000000..dd320f8c8334 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_shares_operations.py @@ -0,0 +1,521 @@ +# 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 SharesOperations(object): + """SharesOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, account_name, share_name, custom_headers=None, raw=False, **operation_config): + """Get a specified share. + + Get a share . + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to retrieve. + :type share_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: Share or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.Share or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + def create( + self, resource_group_name, account_name, share_name, share, custom_headers=None, raw=False, **operation_config): + """Create a share in the given account. + + Create a share . + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param share: The share payload + :type share: ~azure.mgmt.datashare.models.Share + :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: Share or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.Share or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, '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(share, 'Share') + + # 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', response) + if response.status_code == 201: + deserialized = self._deserialize('Share', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + + def _delete_initial( + self, resource_group_name, account_name, share_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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, account_name, share_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a share. + + Delete a share . + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_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 OperationResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datashare.models.OperationResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datashare.models.OperationResponse]] + :raises: + :class:`DataShareErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationResponse', 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + def list_by_account( + self, resource_group_name, account_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List of available shares under an account. + + List shares in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param skip_token: Continuation Token + :type skip_token: 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 Share + :rtype: + ~azure.mgmt.datashare.models.SharePaged[~azure.mgmt.datashare.models.Share] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_account.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'), + 'accountName': self._serialize.url("account_name", account_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SharePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares'} + + def list_synchronizations( + self, resource_group_name, account_name, share_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List Synchronizations in a share. + + List synchronizations of a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: Continuation token + :type skip_token: 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 ShareSynchronization + :rtype: + ~azure.mgmt.datashare.models.ShareSynchronizationPaged[~azure.mgmt.datashare.models.ShareSynchronization] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronizations.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.post(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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ShareSynchronizationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_synchronizations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations'} + + def list_synchronization_details( + self, resource_group_name, account_name, share_name, share_synchronization, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List data set level details for a share synchronization. + + List synchronization details. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param share_synchronization: Share Synchronization payload. + :type share_synchronization: + ~azure.mgmt.datashare.models.ShareSynchronization + :param skip_token: Continuation token + :type skip_token: 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 SynchronizationDetails + :rtype: + ~azure.mgmt.datashare.models.SynchronizationDetailsPaged[~azure.mgmt.datashare.models.SynchronizationDetails] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization_details.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + else: + url = next_link + query_parameters = {} + + # 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(share_synchronization, 'ShareSynchronization') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SynchronizationDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_synchronization_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_synchronization_settings_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_synchronization_settings_operations.py new file mode 100644 index 000000000000..d7ebbb9438d4 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_synchronization_settings_operations.py @@ -0,0 +1,374 @@ +# 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 SynchronizationSettingsOperations(object): + """SynchronizationSettingsOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, account_name, share_name, synchronization_setting_name, custom_headers=None, raw=False, **operation_config): + """Get synchronizationSetting in a share. + + Get a synchronizationSetting in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param synchronization_setting_name: The name of the + synchronizationSetting. + :type synchronization_setting_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: SynchronizationSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.SynchronizationSetting or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'synchronizationSettingName': self._serialize.url("synchronization_setting_name", synchronization_setting_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SynchronizationSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + def create( + self, resource_group_name, account_name, share_name, synchronization_setting_name, synchronization_setting, custom_headers=None, raw=False, **operation_config): + """Adds a new synchronization setting to an existing share or updates it + if existing. + + Create or update a synchronizationSetting . + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to add the synchronization + setting to. + :type share_name: str + :param synchronization_setting_name: The name of the + synchronizationSetting. + :type synchronization_setting_name: str + :param synchronization_setting: The new synchronization setting + information. + :type synchronization_setting: + ~azure.mgmt.datashare.models.SynchronizationSetting + :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: SynchronizationSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.SynchronizationSetting or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'synchronizationSettingName': self._serialize.url("synchronization_setting_name", synchronization_setting_name, '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(synchronization_setting, 'SynchronizationSetting') + + # 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SynchronizationSetting', response) + if response.status_code == 201: + deserialized = self._deserialize('SynchronizationSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + + def _delete_initial( + self, resource_group_name, account_name, share_name, synchronization_setting_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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'synchronizationSettingName': self._serialize.url("synchronization_setting_name", synchronization_setting_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, account_name, share_name, synchronization_setting_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete synchronizationSetting in a share. + + Delete a synchronizationSetting in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param synchronization_setting_name: The name of the + synchronizationSetting . + :type synchronization_setting_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 OperationResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datashare.models.OperationResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datashare.models.OperationResponse]] + :raises: + :class:`DataShareErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + synchronization_setting_name=synchronization_setting_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationResponse', 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + def list_by_share( + self, resource_group_name, account_name, share_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List synchronizationSettings in a share. + + List synchronizationSettings in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: continuation token + :type skip_token: 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 SynchronizationSetting + :rtype: + ~azure.mgmt.datashare.models.SynchronizationSettingPaged[~azure.mgmt.datashare.models.SynchronizationSetting] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SynchronizationSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_triggers_operations.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_triggers_operations.py new file mode 100644 index 000000000000..1c0b64e563e0 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/operations/_triggers_operations.py @@ -0,0 +1,403 @@ +# 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 TriggersOperations(object): + """TriggersOperations 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 use. Constant value: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, account_name, share_subscription_name, trigger_name, custom_headers=None, raw=False, **operation_config): + """Get Trigger in a shareSubscription. + + Get a Trigger in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param trigger_name: The name of the trigger. + :type trigger_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: Trigger or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datashare.models.Trigger or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`DataShareErrorException` + """ + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Trigger', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + + def _create_initial( + self, resource_group_name, account_name, share_subscription_name, trigger_name, trigger, 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, '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(trigger, 'Trigger') + + # 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Trigger', response) + if response.status_code == 201: + deserialized = self._deserialize('Trigger', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, share_subscription_name, trigger_name, trigger, custom_headers=None, raw=False, polling=True, **operation_config): + """This method creates a trigger for a share subscription. + + Create a Trigger . + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription + which will hold the data set sink. + :type share_subscription_name: str + :param trigger_name: The name of the trigger. + :type trigger_name: str + :param trigger: Trigger details. + :type trigger: ~azure.mgmt.datashare.models.Trigger + :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 Trigger or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datashare.models.Trigger] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datashare.models.Trigger]] + :raises: + :class:`DataShareErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name, + trigger=trigger, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Trigger', 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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + + def _delete_initial( + self, resource_group_name, account_name, share_subscription_name, trigger_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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, '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' + 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.DataShareErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, account_name, share_subscription_name, trigger_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete Trigger in a shareSubscription. + + Delete a Trigger in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param trigger_name: The name of the trigger. + :type trigger_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 OperationResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datashare.models.OperationResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datashare.models.OperationResponse]] + :raises: + :class:`DataShareErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationResponse', 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + def list_by_share_subscription( + self, resource_group_name, account_name, share_subscription_name, skip_token=None, custom_headers=None, raw=False, **operation_config): + """List Triggers in a share subscription. + + List Triggers in a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param skip_token: Continuation token + :type skip_token: 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 Trigger + :rtype: + ~azure.mgmt.datashare.models.TriggerPaged[~azure.mgmt.datashare.models.Trigger] + :raises: + :class:`DataShareErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share_subscription.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, '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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.DataShareErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TriggerPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers'} diff --git a/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/version.py b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/version.py new file mode 100644 index 000000000000..3266861fd6b3 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/version.py @@ -0,0 +1,12 @@ +# 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.1.0rc1" diff --git a/sdk/datashare/azure-mgmt-datashare/sdk_packaging.toml b/sdk/datashare/azure-mgmt-datashare/sdk_packaging.toml new file mode 100644 index 000000000000..53e86ee0c3ac --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-datashare" +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/datashare/azure-mgmt-datashare/setup.cfg b/sdk/datashare/azure-mgmt-datashare/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/datashare/azure-mgmt-datashare/setup.py b/sdk/datashare/azure-mgmt-datashare/setup.py new file mode 100644 index 000000000000..1cc6a1330972 --- /dev/null +++ b/sdk/datashare/azure-mgmt-datashare/setup.py @@ -0,0 +1,87 @@ +#!/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-datashare" +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'), '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.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', + 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', + '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.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)